ok, I've been following: http://railscasts.com/episodes/196-nested-model-form-part-1
Here are the steps I've had to accomplish so far:
rails new survey <install the script stuff he includes> rails g nifty:layout rails g nifty:scaffold survey name:string rake db:migrate
I updated routes.rb to point to home#index (rather then the welcome#index that it was) and deleted public/index.html
When I try to run rails server and go to my local host, I get the following error. uninitialized constant HomeController
I'm lost and have no clue what this means.
Can someone point me in the right direction?
OK, So I fixed that problem, I guess where I'm confused is where should my routes point to to ge to see the survey that I just created using the above commands. right now I'm pointing to my home#index, where should that point to?
Edit #2: Contents of Surveys_controller.rb
class SurveysController < ApplicationController def index @surveys = Survey.all end def show @survey = Survey.find(params[:id]) end def new @survey = Survey.new end def create @survey = Survey.new(params[:survey]) if @survey.save flash[:notice] = "Successfully created survey." redirect_to @survey else render :action => 'new' end end def edit @survey = Survey.find(params[:id]) end def update @survey = Survey.find(params[:id]) if @survey.update_attributes(params[:survey]) flash[:notice] = "Successfully updated survey." redirect_to @survey else render :action => 'edit' end end def destroy @survey = Survey.find(params[:id]) @survey.destroy flash[:notice] = "Successfully destroyed survey." redirect_to surveys_url end end