For love of God, I banged my head about this for several hours. Using rails3 rc, 1.9.2.
I am trying to create a link_to that sends an ajax request with parameters, class and id and needs a block, so I can insert a span tag around the name. The documentation is absolutely zero, as are numerous search queries. Here is what I have so far:
<%= link_to(
:url=>{
: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}",
:class => "tag") do %>
<span class='subtract'><%= tag %></span>
<% end %>
The generated URL is as follows:
<a href="/explore/index/theme-tag-user-3?url[controller]=themes&url[action]=remove_tag&url[entity_id]=3&url[theme_id]=16&url[entity]=user&url[element_id]=filter-contributor-3&url[parent_id]=filter-contributors&remote=true&class=tag">
Test descriptor
I cannot correctly indicate that the text "test descriptor" is actually correctly included in the range; formatting the code here doesn’t work a bit, however href is wrong, there is no class or id, and it continues to roll downhill
, : url = > {...} ( , ), : remote = > true,: id = > "whatever",: class= > "blah", . ? , , ? , , -...; -)