Hope you can help. Getting the error message NoMethodError in ClassifiedController#create You have a nil object when you didn't expect it! You might have expected an instance of ActiveRecord::Base. The error occurred while evaluating nil.save Here's my controller code. I'm totally new to ruby on rails so help would be much appreciated class ClassifiedController < ApplicationController def list @classifieds=Classified.find(:all) end def show @classified=Classified.find(params[:id]) end def new @classified=Classified.new end def create @classifed=Classified.new(params[:classified]) if @classified.save redirect_to :action =>'list' else render :action =>'new' end end
on 2007-01-31 20:34
on 2007-01-31 21:01
Don't know if you copy pasted the code above, but I think you are getting this error because you have a typo at: @classifed=Classified.new(params[:classified]) @classifed should be @classified Kind regards, Nick Snels http://www.railshostinginfo.com Review and compare Rails hosting companies
on 2007-01-31 21:41
I don't believe it! Thanks mate.