Ruby on Rails Friday, September 2, 2011

Jim ruther Nill wrote in post #1019785:
> On Fri, Sep 2, 2011 at 7:26 PM, 7stud -- <lists@ruby-forum.com> wrote:
>
>> to the id in the url:
>>
>> params[:id]
>>
>>
> i'm assuming that get_user_from_session returns a User object.
>

Yes.

>>> get_user_from_session.id.to_s # User with ID = 1
>>> User.find('1-user-name') # User with ID = 1
>
> so comparing params[:id] with the User ID converted to string will not
> always be equal.
>

I understand what you are saying, I just don't see how it's relevant to
my 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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment