On Apr 21, 9:24 am, "Tony M."
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> I am trying to define my own new view, but having trouble with the
> syntax to submit a new record via html form.
Tony,
Try letting Rails generate the route. I''m not sure exactly what
you''re doing, but the view should probably look a little more like
this:
<% form_tag :action => ''create'' do %>
<%= hidden_field_tag "roster[id]", @roster.id %>
<%= submit_tag ''Create'' %>
<% end %>
Make sure your controller has a corresponding ''create'' action.
Dan Manges
http://www.dcmanges.com/blog
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---