Forum: Rails deployment simple post action help needed

86d81537f032adc37d13a0ae52c4e67a?d=identicon&s=25 Mark Preston (markp)
on 2009-07-22 01:57
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
86d81537f032adc37d13a0ae52c4e67a?d=identicon&s=25 Mark Preston (markp)
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
This topic is locked and can not be replied to.