On 16 February 2012 00:37, Michael Pavling <[email protected]> wrote:
> On 16 February 2012 00:32, Soichi Ishida <[email protected]> wrote:
>> It says 'NoMethodError', but in the controller,
>>
>>  def create
>>    @script = Script.new(params[:script])
>>    respond_to do |format|
>>      if @script.save                             #<=44: HERE!!!!!
>
> What does the Script model look like?

Don't worry... I found it in your other thread.

I think your problem may be the validation in the Script:

class Script < ActiveRecord::Base
 belongs_to :video
 has_many :users

 validates :startp,
 :presence => true,
 :uniqueness => true,   #HERE!!!!
 :numericality => { :only_integer => true, :less_than => 1000}

 validates :script,
 :presence => true
end

The "validates :script, :presence => true" should be "validates
:video" shouldn't it? You don't have another "script" associated with
the script - hence the "undefined method `script' for #<Script>"
message

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to