Hi All,
I am attempting to use a link_to helper to perform a form post using the
following construct:
<%= link_to ''Save'', {:action
=>''create''}, :post => true %>
What I find is the parameters passed to the webserver are empty. My
model validation stuff triggers indicating the fields in question are
empty too. This is to create a new DB entry so no ID is being passed,
although there are a few required parameters obviously.
This works fine if I use:
<%= submit_tag "Create" %>
So do I need to specify the parameters as part of the link_to?
ROR 1.2.2
Any help is appreciated,
Rick
--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
> I am attempting to use a link_to helper to perform a form post using the > following construct: > > <%= link_to ''Save'', {:action =>''create''}, :post => true %> > > What I find is the parameters passed to the webserver are empty. My > model validation stuff triggers indicating the fields in question are > empty too. This is to create a new DB entry so no ID is being passed, > although there are a few required parameters obviously. > > This works fine if I use: > > <%= submit_tag "Create" %>View the source of your page. Using link_to with :post => true will turn that link into a mini-form that knows nothing at all about your other form on the site. If you don''t want an actual submit button, then you''ll need to use link_to_function and set the function to do document.myform.submit() or some such. -philip --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---