在 Rails 3 中,使用method
a 的属性时link_to
,我的自定义rel
值被覆盖。
# my code:
link_to 'Add to Favorites',
profile_favorites_path(profile),
:method => :post,
:class => 'button',
:rel => 'favorite'
# expected result:
<a href="/profiles/1/favorites" class="button" data-method="post" rel="favorite nofollow">Add to Favorites</a>
# actual result:
<a href="/profiles/1/favorites" class="button" data-method="post" rel="nofollow">Add to Favorites</a>
这是 Rails 错误/意外功能吗?如何在method
提供自定义值的同时利用内置功能rel
?