# :class in link\_to\_remote?

**URL:** <https://www.ruby-forum.com/t/class-in-link-to-remote/54423>\
**Category:** Rails\
**Created:** [March 4, 2006, 10:47am UTC](https://www.ruby-forum.com/t/class-in-link-to-remote/54423 "2006-03-04T10:47:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![boram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/7993a0/32.png) [@boram](https://www.ruby-forum.com/u/boram)\
**Post date:** [March 4, 2006, 10:47am UTC](https://www.ruby-forum.com/t/class-in-link-to-remote/54423/1 "2006-03-04T10:47:50Z")

</div>

Is there a way to set the class of a link in link\_to\_remote? I tried  
adding :class =\> “this\_damn\_class” after the :url hash and it didn’t  
work.

I went ahead and did it manually using remote\_function, i.e.

My Link

---

<div class="post-metadata">

**Author:** ![boram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/7993a0/32.png) [@boram](https://www.ruby-forum.com/u/boram)\
**Post date:** [March 4, 2006, 10:56am UTC](https://www.ruby-forum.com/t/class-in-link-to-remote/54423/2 "2006-03-04T10:56:46Z")

</div>

Am Samstag, den 04.03.2006, 10:47 +0100 schrieb Boram Y.:

> Is there a way to set the class of a link in link\_to\_remote? I tried  
> adding :class =\> “this\_damn\_class” after the :url hash and it didn’t  
> work.
> 
> I went ahead and did it manually using remote\_function, i.e.
> 
> My Link

\<%= link\_to\_remote ‘Select’, { :update =\> ‘group\_selector’, :url =\>  
{ :action =\> ‘select\_group’, :id =\> @customer } }, :class =\> ‘button’ %\>

–  
Norman T.

[http://blog.inlet-media.de](http://blog.inlet-media.de)

---

<div class="post-metadata">

**Author:** ![boram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/7993a0/32.png) [@boram](https://www.ruby-forum.com/u/boram)\
**Post date:** [March 4, 2006, 10:59am UTC](https://www.ruby-forum.com/t/class-in-link-to-remote/54423/3 "2006-03-04T10:59:47Z")

</div>

of course there is:

\<%= link\_to\_remote( “name”, {:update =\> “mydiv”, :url =\> {:action =\>  
“my\_action”}}, {:class =\> “my\_class”} )%\>

---

<div class="post-metadata">

**Author:** ![boram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/7993a0/32.png) [@boram](https://www.ruby-forum.com/u/boram)\
**Post date:** [March 4, 2006, 11:18am UTC](https://www.ruby-forum.com/t/class-in-link-to-remote/54423/4 "2006-03-04T11:18:48Z")

</div>

Thanks everyone. I had my brackets in the wrong places.
