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.
Clint P. (Guest)
on 2006-03-09 02: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
Josh on Rails (Guest)
on 2006-03-09 03:13
(Received via mailing list)
On 3/8/06, Clint P. <removed_email_address@domain.invalid> 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' }
Clint P. (Guest)
on 2006-03-09 06: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?
John (Guest)
on 2006-03-09 08:58
Why don't you put the link_to_remote in a div.

<div class='whatever'><link_to_remote etc.></div>
Sebastian F. (Guest)
on 2006-03-09 11: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
Clint P. (Guest)
on 2006-03-09 15: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.