Forum: Ruby on Rails :class in link_to_remote?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
mofo m. (Guest)
on 2006-03-04 11:47
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.

<a class="this_damn_class" href="#" onclick="<%= remote_function  ...,
:url => {...} %>">My Link</a>
Norman T. (Guest)
on 2006-03-04 11:56
(Received via mailing list)
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.
>
> <a class="this_damn_class" href="#" onclick="<%= remote_function  ...,
> :url => {...} %>">My Link</a>

<%= link_to_remote 'Select', { :update => 'group_selector', :url =>
{ :action => 'select_group', :id => @customer } }, :class => 'button' %>

--
Norman T.

http://blog.inlet-media.de
Peter E. (Guest)
on 2006-03-04 11:59
(Received via mailing list)
of course there is:

<%= link_to_remote( "name", {:update => "mydiv", :url => {:action =>
"my_action"}}, {:class => "my_class"} )%>
mofo m. (Guest)
on 2006-03-04 12:18
Thanks everyone.  I had my brackets in the wrong places.
This topic is locked and can not be replied to.