On 11 August 2011 20:21, Leonel *.* <[email protected]> wrote:
> I have a typical rails form with form_for(@user...blah blah)
>
> There is a field to enter the email address: email. But that same email
> address has to be entered into the invitation_last_sent_to. So the same
> value, in two different columns.
>
> There is no problem when saving in the column 'email' but I want to save
> that same email value into invitation_last_sent_to column in the
> controller.
>
> I have tried the following in users_controller.rb and when I get the
> rails console, the value in invitation_last_sent_to is always nil.
>
> @user.invitation_last_sent_to = @user.email
> @user.invitation_last_sent_to = params[:user][:email]
> @user.invitation_last_sent_to = params[:email]

Use ruby-debug to break into your code here and inspect the data and
see what is going on.  See the Rails Guide on debugging for how to do
this.

I presume, though, that you are doing the above in the create action
before the save, or in the update action before update_attributes.

Colin

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