John Yerhot wrote: >> <%= link_to "Preview Post", {:action => :preview, :id => @topic.id, >> :body => @body}, {:id => 'link', :target => "_blank"} %> > > 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"} %>
Muchas gracias, that is close to perfect. The only problem is if I hit "Preview Post" multiple times, it keeps adding onto body, but I can fix that problem. It's times like these that I realize I need to learn more javascript. -- 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 rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---