What he wants to say is that you should log or print the error-array of
your model and look what exactly doesn't fit into your validations.
Am 12.11.2012 11:13 schrieb "Soichi Ishida" <[email protected]>:

> > On your controller, use `create!` to see what is preventing the save.
>
> Sorry, I don't quite understand what you mean.
>
> my plans_controller.rb has
>
>   def create
>     @plan = Plan.new(params[:plan])
>
>     respond_to do |format|
>       if @plan.save
>         format.html { redirect_to @plan, notice: 'Plan was successfully
> created.' }
>         format.json { render json: @plan, status: :created, location:
> @plan }
>       else
>         format.html { render action: "new" }
>         format.json { render json: @plan.errors, status:
> :unprocessable_entity }
>       end
>     end
>   end
>
> which scaffold generated by default.
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> 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 https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 https://groups.google.com/groups/opt_out.


Reply via email to