# Html options in link\_to\_remote

**URL:** <https://www.ruby-forum.com/t/html-options-in-link-to-remote/47578>\
**Category:** Rails\
**Created:** [November 12, 2005, 12:49pm UTC](https://www.ruby-forum.com/t/html-options-in-link-to-remote/47578 "2005-11-12T12:49:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adam.groves](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/cab0a1/32.png) [@adam.groves](https://www.ruby-forum.com/u/adam.groves)\
**Post date:** [November 12, 2005, 12:49pm UTC](https://www.ruby-forum.com/t/html-options-in-link-to-remote/47578/1 "2005-11-12T12:49:31Z")

</div>

I’m probably being a bit of a div here but how do I add css class  
attributes  
to a link\_to\_remote?  
I’ve got:  
\<%= link\_to\_remote(“Add an address”,  
:url =\> {:action =\> ‘new\_address’, :project =\> @project},  
:update =\>‘partner\_div’,  
:loading =\> “Element.show(‘loader’)”,  
:complete =\> “Element.hide(‘loader’)”)  
%\>  
I’ve tried sticking in :class =\> ‘myclass’ everywhere but to no avail.  
Where should I place it?  
Thanks in advance  
Adam

---

<div class="post-metadata">

**Author:** ![adam.groves](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/cab0a1/32.png) [@adam.groves](https://www.ruby-forum.com/u/adam.groves)\
**Post date:** [November 12, 2005, 12:49pm UTC](https://www.ruby-forum.com/t/html-options-in-link-to-remote/47578/2 "2005-11-12T12:49:32Z")

</div>

Hi !

2005/11/9, Adam G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> I’ve tried sticking in :class =\> ‘myclass’ everywhere but to no avail. Where  
> should I place it?

You have to add another Hash, like this:  
\<%= link\_to\_remote(“Add an address”,  
{:url =\> {:action =\> …}, :update =\> ‘partner\_div’},  
{:class =\> ‘myclass’, :id =\> ‘test’, :title =\> ‘some title’}) %\>

That’s what the html\_options parameter is on  
[http://api.rubyonrails.com/classes/ActionView/Helpers/JavaScriptHelper.html#M000426](http://api.rubyonrails.com/classes/ActionView/Helpers/JavaScriptHelper.html#M000426)

Hope that helps !  
FranÃ§ois
