Undefined method `include?'

Hi guys,
I was just working on this application (http://pastie.org/329613) when I
added this line “session[:user].include?(params[:id])” to an unless
statement and the app threw this error:

NoMethodError in SignupsController#show
undefined method include?' for 27:Fixnum Application Trace: app/controllers/signups_controller.rb:35:inauthorize’

Any ideas? Thanks in advance!

On Wed, Dec 3, 2008 at 10:02 AM, Patrick L.
[email protected] wrote:

Hi guys,
I was just working on this application (http://pastie.org/329613) when I
added this line “session[:user].include?(params[:id])” to an unless
statement and the app threw this error:

session is a Hash, and when you do session[:user], you’re getting back
the
value referenced by the key :user.

NoMethodError in SignupsController#show
undefined method `include?’ for 27:Fixnum

and it turns out that you stored 27 in there.

You may simply check the value against the params, if that’s what you
need
to do à la if session[:user] == params[:id]

Franz

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs