Forum: Ruby on Rails link_to_remote id or class

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.
Aeb5810616aafc577c999d769d3f1bd2?d=identicon&s=25 Clint Pidlubny (Guest)
on 2006-03-09 01:49
(Received via mailing list)
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
3319ab6fb19fcf97c8a3d66b8a9b68bf?d=identicon&s=25 Josh on Rails (Guest)
on 2006-03-09 02:13
(Received via mailing list)
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' }
Aeb5810616aafc577c999d769d3f1bd2?d=identicon&s=25 Clint Pidlubny (Guest)
on 2006-03-09 05:54
(Received via mailing list)
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?
C6e5054b7ebfb6e7dafb4a575995ae70?d=identicon&s=25 John (Guest)
on 2006-03-09 07:58
Why don't you put the link_to_remote in a div.

<div class='whatever'><link_to_remote etc.></div>
10c741d575988433e3fcd04133f3c462?d=identicon&s=25 Sebastian Friedrich (Guest)
on 2006-03-09 10:38
(Received via mailing list)
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
Aeb5810616aafc577c999d769d3f1bd2?d=identicon&s=25 Clint Pidlubny (Guest)
on 2006-03-09 14:35
(Received via mailing list)
>
> ... 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
This topic is locked and can not be replied to.