# Need syntax to submit a new form entry

**URL:** <https://www.ruby-forum.com/t/need-syntax-to-submit-a-new-form-entry/92610>\
**Category:** Rails\
**Created:** [April 21, 2007, 3:24pm UTC](https://www.ruby-forum.com/t/need-syntax-to-submit-a-new-form-entry/92610 "2007-04-21T15:24:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![merc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f07891/32.png) [@merc](https://www.ruby-forum.com/u/merc)\
**Post date:** [April 21, 2007, 3:24pm UTC](https://www.ruby-forum.com/t/need-syntax-to-submit-a-new-form-entry/92610/1 "2007-04-21T15:24:24Z")

</div>

I am trying to define my own new view, but having trouble with the  
syntax to submit a new record via html form.

This is what I’m doing (and its wrong):

This results in:  
Routing Error

no route found to match “/create/” with {:method=\>:post}

Any help? I know I must just have the syntax wrong.

---

<div class="post-metadata">

**Author:** ![merc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f07891/32.png) [@merc](https://www.ruby-forum.com/u/merc)\
**Post date:** [April 22, 2007, 6:14am UTC](https://www.ruby-forum.com/t/need-syntax-to-submit-a-new-form-entry/92610/2 "2007-04-22T06:14:22Z")

</div>

On Apr 21, 9:24 am, “Tony M.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
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 M.  
[http://www.dcmanges.com/blog](http://www.dcmanges.com/blog)
