# Undefined method \`include?'

**URL:** <https://www.ruby-forum.com/t/undefined-method-include/154724>\
**Category:** Rails\
**Created:** [December 3, 2008, 10:02am UTC](https://www.ruby-forum.com/t/undefined-method-include/154724 "2008-12-03T10:02:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lynchnco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/c77e96/32.png) [@lynchnco](https://www.ruby-forum.com/u/lynchnco)\
**Post date:** [December 3, 2008, 10:02am UTC](https://www.ruby-forum.com/t/undefined-method-include/154724/1 "2008-12-03T10:02:06Z")

</div>

Hi guys,  
I was just working on this application ([http://pastie.org/329613](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:in `authorize’

Any ideas? Thanks in advance!

---

<div class="post-metadata">

**Author:** ![lynchnco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/c77e96/32.png) [@lynchnco](https://www.ruby-forum.com/u/lynchnco)\
**Post date:** [December 3, 2008, 10:14am UTC](https://www.ruby-forum.com/t/undefined-method-include/154724/2 "2008-12-03T10:14:50Z")

</div>

On Wed, Dec 3, 2008 at 10:02 AM, Patrick L.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi guys,  
> I was just working on this application ([http://pastie.org/329613](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
