degrading link_to_remote

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 => },

{:href => url_for(…)}

Note the href above.


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",
                              {:update => "tabs",:url => {:action =>
                              {: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: