Greg Donald wrote:
> On Tue, Mar 24, 2009 at 5:17 AM, Heinz Strunk
> <[email protected]> wrote:
>>
>> Hey people,
>>
>> does anyone know if it's possible to access params inside the
>> before_validation function?
> 
> Aren't you doing something like Foo.new( params[:foo] ) already?
> 
> params is an array and responds to merge, so you can add stuff to
> params before passing it to the model.
> 
> 
> 
> --
> Greg Donald
> http://destiney.com/

I've got a similiar problem but need to remove two attributes I only 
need for validation.
I have my model plus two attributes (current, required) and I want to 
validate these two attributes before saving. I cannot create a new 
instance because it says "unknown attribute current"

I could do @errorcheck_current = params[:activity].delete('current') but 
then I cannot use it in the model for validation. Does anyone know how 
to solve that kind of problem?
-- 
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 this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to