On 4 nov, 12:11, Craig White <[email protected]> wrote:

> > Because as an example
> > I have
> > Evaluation 1
> > - Question 1
> > - Question 2
>
> > If I edit question 2 and change the number it will allow me to do that
> > and it will show this
> > Evaluation 1
> > - Question 1
> > - Question 1
>
> > And that's what I want to avoid
>
> > I tried  validates_uniqueness_of :qnumber, :scope
> > => :evaluation_id, :on => :create
> > and it works, but when I edit, I can do what I mention
>
> ----
> what is the field/column that is 'Question 1'?  Is it one of the fields that 
> you only validate on 'create'? You should probably remove ', :on => :create' 
> because that won't protect uniqueness on 'update'
>
I'm showing evaluation as it shows on my view

EVALUATION

Question               Content                Created by
Number

1                         (..........)
(..........)           Edit
2                         (..........)
(..........)           Edit
3                         (..........)
(..........)           Edit

In my form question

Question number  (_______________________________)
Content               (_______________________________)
Created by           (_______________________________)

                                              Save

And for example what If I edit "3" and I change it to "2", it
shouldn't let someone do that

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