# Link\_to\_remote id or class

**URL:** <https://www.ruby-forum.com/t/link-to-remote-id-or-class/54583>\
**Category:** Rails\
**Created:** [March 9, 2006, 1:49am UTC](https://www.ruby-forum.com/t/link-to-remote-id-or-class/54583 "2006-03-09T01:49:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pachl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/5f9b8f/32.png) [@pachl](https://www.ruby-forum.com/u/pachl)\
**Post date:** [March 9, 2006, 1:49am UTC](https://www.ruby-forum.com/t/link-to-remote-id-or-class/54583/1 "2006-03-09T01:49:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pachl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/5f9b8f/32.png) [@pachl](https://www.ruby-forum.com/u/pachl)\
**Post date:** [March 9, 2006, 2:13am UTC](https://www.ruby-forum.com/t/link-to-remote-id-or-class/54583/2 "2006-03-09T02:13:16Z")

</div>

On 3/8/06, Clint P. [removed\_email\_address@domain.invalid](mailto: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’ }

---

<div class="post-metadata">

**Author:** ![pachl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/5f9b8f/32.png) [@pachl](https://www.ruby-forum.com/u/pachl)\
**Post date:** [March 9, 2006, 5:54am UTC](https://www.ruby-forum.com/t/link-to-remote-id-or-class/54583/3 "2006-03-09T05:54:04Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![pachl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/5f9b8f/32.png) [@pachl](https://www.ruby-forum.com/u/pachl)\
**Post date:** [March 9, 2006, 10:38am UTC](https://www.ruby-forum.com/t/link-to-remote-id-or-class/54583/4 "2006-03-09T10:38:25Z")

</div>

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/](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

---

<div class="post-metadata">

**Author:** ![pachl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/5f9b8f/32.png) [@pachl](https://www.ruby-forum.com/u/pachl)\
**Post date:** [March 9, 2006, 7:58am UTC](https://www.ruby-forum.com/t/link-to-remote-id-or-class/54583/5 "2006-03-09T07:58:00Z")

</div>

Why don’t you put the link\_to\_remote in a div.

---

<div class="post-metadata">

**Author:** ![pachl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/5f9b8f/32.png) [@pachl](https://www.ruby-forum.com/u/pachl)\
**Post date:** [March 9, 2006, 2:35pm UTC](https://www.ruby-forum.com/t/link-to-remote-id-or-class/54583/6 "2006-03-09T14:35:45Z")

</div>

> … because of this very serious condition: [http://en.wikipedia.org/](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
