I have a link to remote and I''m trying to get the name="" and the class="" attribute in the href so the link will come out like this: <a href="action" onclick"ajax(action)" name="Title Of Link" class="someclass"> So far the link looks like this: <% for course in @courses %> <%= link_to_remote "#{course.title}", {:url => {:action => "add_to_cart", :id => course}, :complete => visual_effect(:highlight, "schedule", :duration => 1.5)}, {:href => url_for(:action => :add_to_cart, :id => course )} %> <% end %> Thanks. -- Posted via http://www.ruby-forum.com/.
David C.
2006-May-09 20:54 UTC
[Rails] Re: name and class href attribute in a link_to_remote
> <%= link_to_remote "#{course.title}", > {:url => {:action => "add_to_cart", :id => course}, > :complete => visual_effect(:highlight, "schedule", :duration => > 1.5)}, > {:href => url_for(:action => :add_to_cart, :id => course )} %><%= link_to_remote "#{course.title}", {:url => {:action => "add_to_cart", :id => course}, :complete => visual_effect(:highlight, "schedule", :duration => 1.5)}, :class => "someClass", :name => "Title Of Link"%> ? -- Posted via http://www.ruby-forum.com/.
David C. wrote:> <%= link_to_remote "#{course.title}", {:url => {:action => > "add_to_cart", :id => course}, :complete => visual_effect(:highlight, > "schedule", :duration => > 1.5)}, :class => "someClass", :name => "Title Of Link"%> > > ?Yeah, tried that, and it would normally work but the weird thing is with the: {:href => url_for(:action => :add_to_cart, :id => course" )} part of the link everything gets screwed up. Usually the class gets appended to the href like this href="/action/?class="someClass" which does me no good. no matter where I put the :class and :name when :href is present, I get some sort of error -- Posted via http://www.ruby-forum.com/.
Apparently Analagous Threads
- using dynamic element ids with visual_effect
- Make link_to_remote call redirect current view, not read redirected content
- How to apply an effect to a link_to_remote :update without using evaluate_remote_response?
- Highlighint rjs problem on a new product
- DRY up link_to_remote and its url_for