Link_to_remote id or class


#1

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


#2

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’ }


#3

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?


#4

On Mar 9, 2006, at 12:58 AM, John wrote:

Why don’t you put the link_to_remote in a 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 :slight_smile:

Sebastian


#5

Why don’t you put the link_to_remote in a div.


#6

… 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 :slight_smile:

Thanks, I’ll take a closer look.

Clint