Hi Norbert,

Thanks for the reply, but can you elaborate a little?

On Wednesday, October 10, 2012 12:01:54 PM UTC+1, Norbert Melzer wrote:
>
>
> Am 10.10.2012 09:47 schrieb "paul h" <pa...@hollyer.me.uk <javascript:>>:
>
> > # I want to be able to display 'bar' on the contacts page
> > = link_to "Contacts", contacts_path, :data => {:foo => 'bar'}
>
> Should be params=>.... I here if I recall correctly. 
>

Doesn't appear to be, replacing :data with :params changes the HTML link as 
follows:
data-foo='bar' becomes params="{:foo=>"bar"}"

Changing :data to params just mashes up the html link.

AFAIK the generated HTML link is correct data-foo='bar', shouldn't this be 
accessible in the controller as part of the params hash?

If I inspect the params hash, all that is there is the usual key/value 
pairs: controller, action, (when applicable => id, method, 
authenticity_token).

How can I send an additional data attribute to the controller? Do I have 
problem with my routes?

Thanks

Paul

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/lN53bwOAiNoJ.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to