i have model question with text and token fields. Want to add data into this via scaffold.
This is my question_ controller
def create
# @question = Question.new(params[:question])
@question = Question.create(:text => params[:text], :security_token => Digest::SHA1.hexdigest(rand(1000000).to_s))
render :json => @question.to_ext_json(:success => @question.save)
end
When i press "ADD" button i get in console this:
Question Create (0.0ms) Mysql::Error: Column 'text' cannot be null: INSERT INTO `questions` (`created_at`, `updated_at`, `text`, `security_token`) VALUES('2011-04-05 09:07:37', '2011-04-05 09:07:37', NULL, 'bf44551f11ce202b88d521a1826ab6db4254ce55')
Why COlumn 'text' can't be null?