Topic: link_to_remote - add a class

Is it possible to add a class name to the generated anchor tag using the link_to_remote helper? I have this code

<%= link_to_remote "[ delete ]", :url => page_path(page.section, page), :class => "delete", :method => :delete, :confirm => "Are you sure you want to delete this page?" %>

I want the anchor tag to have <a class="delete" ...

for some styling purposes. This worked when it was just a link_to, am I doing something wrong or can you not use :class => ... with link_to_remote?



Re: link_to_remote - add a class

From the documentation:

link_to_remote(name, options = {}, html_options = {})

So I guess something like this should work:
link_to_remote "delete", {:url => something}, {:class => "delete"}

You can probably omit the {} around class option.

Re: link_to_remote - add a class

Thanks g0nzo! Everything is working fine now.