Can anyone out there tell me how to add a class or id property to a link using link_to_remote? I''ve been banging my head on this for far too long. Thanks Clint
On 3/8/06, Clint Pidlubny <clint.pidlubny@gmail.com> wrote:> Can anyone out there tell me how to add a class or id > property to a link using link_to_remote? I''ve been banging > my head on this for far too long.I''m not positive, but I think you set them in the html_options hash: link_to_remote "Delete this post", { :update => "posts", :url => { :action => "destroy", :id => post.id } }, { :id => ''link_id_here'' }
That''s what I figured to, but it doesn''t work. Here''s my code: <%= link_to_remote ''Add Partner'', {:loaded => "new Effect.BlindDown(''add_partner'')", :update => ''add_partner'', :url => {:action => ''new_partner'', :id => @site_id}}, {:id => ''test''} %> Is it possible?
Why don''t you put the link_to_remote in a div. <div class=''whatever''><link_to_remote etc.></div> -- Posted via http://www.ruby-forum.com/.
On Mar 9, 2006, at 12:58 AM, John wrote:> Why don''t you put the link_to_remote in a div. > > <div class=''whatever''><link_to_remote etc.></div>... because of this very serious condition: http://en.wikipedia.org/ wiki/Divitis :} Clint, the example you''ve given is correct: <%= link_to_remote ''Add Partner'', {:loaded => "new Effect.BlindDown(''add_partner'')", :update => ''add_partner'', :url => {:action => ''new_partner'', :id => @site_id}}, {:id => ''test''} %> Just to make sure, i tried it out and it works fine for me. So, make sure you''re checking in the right place :) Sebastian
> > ... because of this very serious condition: http://en.wikipedia.org/ > wiki/Divitis :}Exactly Sebastian. Clint, the example you''ve given is correct:> > <%= link_to_remote ''Add Partner'', > {:loaded => "new Effect.BlindDown(''add_partner'')", > :update => ''add_partner'', > :url => {:action => ''new_partner'', :id => @site_id}}, > {:id => ''test''} %> > > Just to make sure, i tried it out and it works fine for me. So, make > sure you''re checking in the right place :)Thanks, I''ll take a closer look. Clint -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060309/c899c928/attachment.html