# Simple post action help needed

**URL:** <https://www.ruby-forum.com/t/simple-post-action-help-needed/172472>\
**Category:** Deployment\
**Created:** [July 22, 2009, 1:57am UTC](https://www.ruby-forum.com/t/simple-post-action-help-needed/172472 "2009-07-22T01:57:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpaxton](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8c91f0/32.png) [@mpaxton](https://www.ruby-forum.com/u/mpaxton)\
**Post date:** [July 22, 2009, 1:57am UTC](https://www.ruby-forum.com/t/simple-post-action-help-needed/172472/1 "2009-07-22T01:57:30Z")

</div>

I have a controller called mystuff\_controller.rb, a db called mpstuff  
and a table inside that db called data and a column called m1. I was  
hoping that some could give a quick step by step on how to create a post  
action so that I can write input from my index.html.erb form to that  
column.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![mpaxton](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8c91f0/32.png) [@mpaxton](https://www.ruby-forum.com/u/mpaxton)\
**Post date:** [July 23, 2009, 12:58am UTC](https://www.ruby-forum.com/t/simple-post-action-help-needed/172472/2 "2009-07-23T00:58:53Z")

</div>

Mark P. wrote:

> I have a controller called mystuff\_controller.rb, a db called mpstuff  
> and a table inside that db called data and a column called m1. I was  
> hoping that some could give a quick step by step on how to create a post  
> action so that I can write input from my index.html.erb form to that  
> column.
> 
> Thanks in advance

# mystuff (controller)

class MystuffController \< ApplicationController

```
def index

  @my = Mystuff.find(:all)

end

 def new
@post = Mystuff.new

  respond_to do |format|
    format.html #new.html.erb
    format.xml { render :xml => @post }
  end
end

```

# index.html.erb (view)

includes this line

\<%= link\_to ‘New post’, new\_post\_path %\>

# I get this error

undefined local variable or method `new\_post\_path’ for  
#ActionView::Base:0x384e54c

Extracted source (around line #79):

76: ![](https://www.ruby-forum.com/images/botline.gif)  
77:   
78:   
79: \<%= link\_to ‘New post’, new\_post\_path %\>  
80:  
81:   
82:

Thanks in advance
