Forum: Ruby on Rails How to add hint to link_to_remote?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Cee38055ae36590c654c04c2d5cc2778?d=identicon&s=25 Sky Yin (cookoo)
on 2006-05-18 06:11
To add a hint to normal link is very easy:
link_to 'design', {:action => 'design', :id => survey}, :title =>
'Design the survey'

but, after trying several times, I still can't figure out how to do the
same to link_to_remote. I've tried put :html => {:title => 'blah'}. It
doesn't work.

Anyone has a solution? Thanks.
F719c6cb34bd5b691c12b373b7244b4d?d=identicon&s=25 Dorian Mcfarland (tachekent)
on 2006-05-18 06:29
(Received via mailing list)
try using the format soecified in the API:
link_to_remote(name, options = {}, html_options = {})

so all your none-html options need to sit in a hash, and then all your
html options need to sit in another hash immediately afterwards. from
your previous example, something like this:

link_to 'design', {:action => 'design', :id => survey}, {:title =>
'Design the survey'}

HTH (and works...)

dorian
Cee38055ae36590c654c04c2d5cc2778?d=identicon&s=25 Sky Yin (cookoo)
on 2006-05-18 07:05
dorian mcfarland wrote:
> try using the format soecified in the API:
> link_to_remote(name, options = {}, html_options = {})
>
> so all your none-html options need to sit in a hash, and then all your
> html options need to sit in another hash immediately afterwards. from
> your previous example, something like this:
>
> link_to 'design', {:action => 'design', :id => survey}, {:title =>
> 'Design the survey'}
>
> HTH (and works...)
>
> dorian

Oh I see. Thank you very much.

Actually I tried this but I left a :url => before the 2nd option group
cause I've seen that kind of code style many times and use it by myself
many times as well. I didn't think of that it was this :url that broke
the whole syntax. Now I understand the options group a bit better.
This topic is locked and can not be replied to.