Hi Luke,

Thanks very much for the reply.
You pointed me in exactly the right direction to solve my problem!!

> Another approach might be to pass this value from the new action to the 
> create action through the form using a hidden field.

I tried this already. This had the disadvantage that the hidden field 
was never up-to-date as it was set during validation and thus always 
contained the value of the previous submission.

> blah = Blah.new(params[:blah])
> 
> #now you have a instance of Blah.
> 
> if blah.save
>   #now you have access to the non represented field
>   blah.non_represented_field
> end

This on the other hand, sorted me right out.
I changed it slightly to:

applicant = Applicant.new(params[:applicant])
if applicant.valid?
  #now I have access to the field I need
  do_stuff_with_non_represented_field
  applicant.save
end

What I was actually using this field for was to create a hash of all 
submitted values, compare it to the hash of the previous record and thus 
prevent double data submission. And it works wonderfully.

Thanks very much for your help.
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to