Hi Jatin,

The flow is like this.

user_controller -> create new user view -> user updates the form -> then I
do the validates in the user model ->  there immediatly after validate  i do
"puts".

Here the puts has problem but when I have the puts in the before callback
(where I generate and store the salt of the password) it does not show any
error.

Thanks & Regards,

On Wed, Feb 23, 2011 at 10:11 PM, Jatin kumar <[email protected]>wrote:

> I am still unable to understand where is the current_user working and where
> not?
> It appears like you are using nifty:authentication for authentication,
>
> post the controller method, mention the scope where it is, where are you
> using the helper, etc etc. and then we could help you in a better way.
>
>
> On Wed, Feb 23, 2011 at 4:37 PM, Bhasker Harihara <
> [email protected]> wrote:
>
>> Yeah, I have tried both of them and even :name.  Unfortunately the ans is
>> no.
>>
>> How does validates work then ?
>>
>> Regards,
>>
>> On Wed, Feb 23, 2011 at 9:54 PM, Walter Lee Davis <[email protected]>wrote:
>>
>>>
>>> On Feb 23, 2011, at 11:03 AM, Bhasker Harihara wrote:
>>>
>>>  This is what I have and it gives the error.
>>>>
>>>>  validates :uname,  :presence => true,
>>>>                    :length   => { :maximum => 50 }
>>>>
>>>> puts "The name is set to #{user.uname}"
>>>>
>>>> But without the puts it updates the record into the databse.   I think
>>>> it is to do with scoping.  If have this puts after make salt then I have no
>>>> problem
>>>>
>>>
>>> If you're inside of user.rb, then user.uname won't have any context. Try
>>> self.uname or just uname, and see if that works.
>>>
>>> Walter
>>>
>>> --
>>> 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.
>>>
>>>
>>  --
>> 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.
>>
>
>  --
> 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.
>

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