Frederick Cheung wrote:
> On Apr 19, 10:14�am, Marika Ahonen <[email protected]>
> wrote:
>>
>> Thank you Fred for your answer, but unfortunately that doesn't work. I
>> get an error:
>> 'undefined method `toggle' for "link_long_23":String'
>> So it gets the id correctly, problem is the toggle? I'm quite new with
>> all this, so I'm sorry if I ask stupid questions ;)
>
> that sounds like you're still doing something like
>
> link_to_function ,'blah', "$('something')".toggle
>
> That's not what you want to do. you want to create the string "$
> ('something').toggle" and pass that as the second argument to
> link_to_function (that second argument should be a fragment of
> javascript).
>
> Fred
Thanks again :) I don't really know how I am supposed to do that :( I'm
doing:
<% linkki = ('link_long_'+link.id.to_s).toggle %>
<%= link_to_function "+", linkki, :style => 'text-decoration:none' %>
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---