Re: HTML equivalent to my link_to_remote statement
- From: Phlip <phlip2005@xxxxxxxxx>
- Date: Thu, 09 Apr 2009 07:42:54 -0700
Taneal Bhandari wrote:
I have the following link_to_remote statement that I need to convert
into an <a href> tag, but can't figure it out. I looked at the
rubyonrails api page and did a google search, but they don't have any
examples similar to mine where I can figure it out. Here's my
statement:
<%= link_to_remote tag.name,
:url => {:action => "tag_selector", :id => @order.id},
:html => {:id => tag.id, :class => "tag"},
:with => "'tag=" + tag.id.to_s + "'"%>
I need help understanding the question. (But please consider the Ruby-on-Rails Talk forum at news://news.gmane.org:119/gmane.comp.lang.ruby.rails in future!)
Link_to_remote translates into an a with an href of # and an onclick of a ton of JavaScript. The code you wrote is already converted. Try this:
<%=
x = link_to_remote tag.name,
:url => {:action => "tag_selector", :id => @order.id},
:html => {:id => tag.id, :class => "tag"},
:with => "'tag=" + tag.id.to_s + "'"
puts x
x
%>
When your page renders (or when - ahem - your functional tests run), you should see your link_to_remote statement converted into an <a href> tag.
What will you do with it now?
.
- Follow-Ups:
- Re: HTML equivalent to my link_to_remote statement
- From: Taneal Bhandari
- Re: HTML equivalent to my link_to_remote statement
- References:
- HTML equivalent to my link_to_remote statement
- From: Taneal Bhandari
- HTML equivalent to my link_to_remote statement
- Prev by Date: Re: Hash questions
- Next by Date: Ruby Regex
- Previous by thread: HTML equivalent to my link_to_remote statement
- Next by thread: Re: HTML equivalent to my link_to_remote statement
- Index(es):
Relevant Pages
|