I am trying to use link_to_remote to update a div tag with some content. This part works fine. The thing I am having an issue with is that I am trying to format this link with a ''class'' tag and it is being ignored. Can anyone shed some light on this? I have tried brackets in different places with different options and tried other variations with no luck. I am guessing my brackets are wrong but every time I move them my app breaks. Thanks in advance here is the snippet of code i am using: <%= link_to_remote(foo.title, :update =>"show_me", :url => {:action => "show", :id=>foo.id}, :class => "foo_style") %> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Try specifying it within a hash, { :class => "foo_style" } jimmygoogle wrote:> I am trying to use link_to_remote to update a div tag with some > content. This part works fine. The thing I am having an issue with > is that I am trying to format this link with a ''class'' tag and it is > being ignored. Can anyone shed some light on this? I have tried > brackets in different places with different options and tried other > variations with no luck. I am guessing my brackets are wrong but > every time I move them my app breaks. Thanks in advance > > here is the snippet of code i am using: > <%= link_to_remote(foo.title, > :update =>"show_me", > :url => {:action => "show", > :id=>foo.id}, > :class => "foo_style") %> > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I think you''ll need to use two hashes, like so: <%= link_to_remote foo.title, { :update =>"show_me", :url => {:action => "show", :id=>foo.id} }, { :class => "foo_style" } %> -Chris -------------------------- Chris Selmer Software Architect www.intridea.com What''s Your Idea? On 11/20/07, Ryan <radarlistener-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Try specifying it within a hash, > > { :class => "foo_style" } > > jimmygoogle wrote: > > I am trying to use link_to_remote to update a div tag with some > > content. This part works fine. The thing I am having an issue with > > is that I am trying to format this link with a ''class'' tag and it is > > being ignored. Can anyone shed some light on this? I have tried > > brackets in different places with different options and tried other > > variations with no luck. I am guessing my brackets are wrong but > > every time I move them my app breaks. Thanks in advance > > > > here is the snippet of code i am using: > > <%= link_to_remote(foo.title, > > :update =>"show_me", > > :url => {:action => "show", > > :id=>foo.id}, > > :class => "foo_style") %> > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Yeah the two hashes did the trick, thanks. On Nov 20, 12:26 am, "Chris Selmer" <cmsel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I think you''ll need to use two hashes, like so: > <%= link_to_remote foo.title, > { :update =>"show_me", :url => {:action => "show", :id=>foo.id} }, > { :class => "foo_style" } %> > > -Chris > > -------------------------- > Chris Selmer > Software Architectwww.intridea.com > What''s Your Idea? > > On 11/20/07, Ryan <radarliste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Try specifying it within a hash, > > > { :class => "foo_style" } > > > jimmygoogle wrote: > > > I am trying to use link_to_remote to update a div tag with some > > > content. This part works fine. The thing I am having an issue with > > > is that I am trying to format this link with a ''class'' tag and it is > > > being ignored. Can anyone shed some light on this? I have tried > > > brackets in different places with different options and tried other > > > variations with no luck. I am guessing my brackets are wrong but > > > every time I move them my app breaks. Thanks in advance > > > > here is the snippet of code i am using: > > > <%= link_to_remote(foo.title, > > > :update =>"show_me", > > > :url => {:action => "show", > > > :id=>foo.id}, > > > :class => "foo_style") %>--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Nov 20, 2007 7:03 AM, jimmygoogle <jtbutler78-Wuw85uim5zDR7s880joybQ@public.gmane.org> wrote:> > Yeah the two hashes did the trick, thanks. > > On Nov 20, 12:26 am, "Chris Selmer" <cmsel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I think you''ll need to use two hashes, like so: > > <%= link_to_remote foo.title, > > { :update =>"show_me", :url => {:action => "show", :id=>foo.id} }, > > { :class => "foo_style" } %>And because of Ruby syntactic sugar, you can omit the braces from the last hash (only), so this is equivalent: <%= link_to_remote foo.title, { :update =>"show_me", :url => {:action => "show", :id=>foo.id} }, :class => "foo_style" %> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---