Syntax for link_to with block in rails3 with :remote=>true and including :class and :id

戏子无情 提交于 2019-12-06 01:45:39

turns out you have to do url_for(...) instead of :url=>{...} and it all worked as expected.

Just putting wkhatch's comment here so it's nicely formatted.

<%= link_to(
    url_for(:controller=>'themes', 
            :action=>'remove_tag', 
            :entity_id=>entity_id, 
            :theme_id=>theme_id, 
            :entity=>entity, 
            :element_id=>element_id, 
            :parent_id=>parent_id), 
    :remote=>true, 
    :id=>"theme-tag-#{entity}-#{entity_id}") do %>
       <span class='subtract'></span><%= tag %>
<% end %>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!