Michael Satterwhite wrote:> In my model, I have the following declaration:
>
> validates_numericality_of :sortorder
>
> If I try to input a non-numeric value (1x3 or whatever) during record
> creation, I properly get an error and the record is not saved.
>
> If I then go and use the update helper to input the same non-numeric
> value, I don''t get any error message. Obviously, it can''t
store an
> non-numeric value into an integer field - but it simply ignores the new
> value. If I change the sortorder using a numeric value, it (properly)
> saves the new value to the database.
>
> Obviously, I''m missing something. Why is my validates clause being
> utilized on record creation, but not on record update?
>
> As always, thanks in advance.
> ---Michael
post the code for the update and create actions in your controller,
perhaps the problem lies there.
--
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---