# degrading link\_to\_remote

**URL:** <https://discuss.rubyonrails.org/t/degrading-link-to-remote/144>\
**Category:** rubyonrails-talk\
**Created:** [August 21, 2006, 5:08am UTC](https://discuss.rubyonrails.org/t/degrading-link-to-remote/144 "2006-08-21T05:08:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hammed\_Malik](https://avatars.discourse-cdn.com/v4/letter/h/e56c9b/32.png) [@Hammed\_Malik](https://discuss.rubyonrails.org/u/Hammed_Malik)\
**Post date:** [August 21, 2006, 5:08am UTC](https://discuss.rubyonrails.org/t/degrading-link-to-remote/144/1 "2006-08-21T05:08:14Z")

</div>

Link to remote allows you to add additional html attributes to the tag:

link\_to\_remote “Delete this post”, :update =\> “posts”, :url =\> { :action =\> “destroy”, :id =\> [post.id](http://post.id) },

{:href =\> url\_for(…)}

Note the href above.

Hammed

---

<div class="post-metadata">

**Author:** ![greg.bluvshteyn](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@greg.bluvshteyn](https://discuss.rubyonrails.org/u/greg.bluvshteyn)\
**Post date:** [August 25, 2006, 4:20pm UTC](https://discuss.rubyonrails.org/t/degrading-link-to-remote/144/2 "2006-08-25T16:20:05Z")

</div>

Using tabs i had to put in the class name in to link\_to\_remote BTW. just to understand this definition for link\_to\_remote

name, options = {}, html\_options = {} - which means that there are 2 types of options there which to be used like that { :update =\> "div\_name", :url =\> {...}} and html\_options {:class =\> "class\_name",:href =\> url\_for(..)}

So thats how I put in my class name

\<%= link\_to\_remote "Parent", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:update =\> "tabs",:url =\> {:action =\> "show\_parent"}}, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:class =\> "active"} %\> BTW, if you are to disable class parameter you can send in nil ( :class =\> nil )

Note: Thats was not intended as tutorial - just something for me to remember in the future.

Hammed Malik wrote:
