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
on 2009-07-22 01:57
on 2009-07-23 00:58
Mark Preston 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: <img border="0" src="/images/botline.gif" width="41" height="12"></td> 77: </tr> 78: </table> 79: <%= link_to 'New post', new_post_path %> 80: 81: </body> 82: Thanks in advance
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.