John Yerhot wrote:
> try this:
>
> <%= link_to "Preview Post", {:action => :preview, :id => @topic.id},
> {:onclick => "this.href +='?body='+encodeURIComponent($F
> ('id_of_the_form_element')); return true", :id => 'link', :target =>
> "_blank"} %>
Hi John,
I have a similar requirement.
I need to pass the value of a text field with link_to
What I'm doing is:
<%= link_to "Go", {:controller=>'main',:action=>'searchcontc'},:onclick
=> "this.href +='?uname='+encodeURIComponent($F('name')); return true"
%>
But this doesn't work properly.
The first time I click the link it redirects to:
http://localhost:3000/main/searchcontc
And on the second click it goes to:
http://localhost:3000/main/searchcontc?uname=<value_of_text_filed>
Can please help me..and let me know how do I correct this...
Thank you.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---