I''m using link_to_function with visual_effect to toggle a list down and up. I would like to add { :class => ''mystyle'' } to the link_to_function statement but don''t see it accepts html_options based on the API. Is there a work around of some kind to apply a css class style to a link created by link_to_function? Thanks, DAN -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Philip Hallstrom
2007-Feb-10 03:48 UTC
Re: Can I use link_to_function with html_options somehow?
> I''m using link_to_function with visual_effect to toggle a list down and > up. > > I would like to add { :class => ''mystyle'' } to the link_to_function > statement but don''t see it accepts html_options based on the API. > > Is there a work around of some kind to apply a css class style to a link > created by link_to_function?I think it will... http://api.rubyonrails.com/classes/ActionView/Helpers/JavaScriptHelper.html#M000630 link_to_function("Show me more", nil, :id => "more_link") do |page| ..... end Produces: <a href="#" id="more_link" onclick="try { .... The :id made it through in the right spot, so putting :class right there should also work I would think. -philip --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks - I adjusted my parens and got it working. DAN -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---