On 5 January 2011 17:22, Finne Jager <[email protected]> wrote:
> I have this validation in my model:
>
> validates :name, :rate, :presence => true, :numericality => true
>
> In my Controller#create method I have:
>
> if @timesheet.create_command_officer(params[:command_officer])
>        format.html { redirect_to(edit_incident_timesheet_path, :notice
> => 'Command officer was successfully created.') }
>      else
>        format.html { redirect_to(edit_incident_timesheet_path, :notice
> => 'Could not save Command Officer.') }
>
>
> Now when I enter 'aaa' in the Rate field and submit, the record DOES NOT
> get saved to the database, but the controller redirects with 'Command
> officer was successfully created.' instead of giving me reasons why the
> record could not be saved.

Do your tests that check that the validations on CommandOfficer work
correctly pass ok?

Colin

-- 
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