On Nov 15, 5:12 am, Hemant Bhargava <li...@ruby-forum.com> wrote:
> Hello,
>
> I am saving/updating same object on different pages with some
> validations. On first page, I save my object and on 2nd, 3rd, 4th pages
> i update the same object. So at first page i am using
> validates_inclusion_of :in => [] etc, and in second page(updating), i am
> using validates_presence_of :abc, :on => [:update]. But while i update
> on 3rd page also, i need some validations but i can not find out which
> function should i use.
> If i use validates_presence_of .. then this validations is reflecting on
> save page, And if i use validates_presence_of :on => [:update] then that
> is reflecting on update page. so i am in a bit of dilemma that what
> should i use.
The :if options to the various validations allows you to specify your
own logic as to which validations should run given the state of the
object.
Fred
>
> Thanks in advance.
>
> --
> Posted viahttp://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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment