# Question about undefined method

**URL:** <https://www.ruby-forum.com/t/question-about-undefined-method/75622>\
**Category:** Rails\
**Created:** [November 11, 2006, 5:01pm UTC](https://www.ruby-forum.com/t/question-about-undefined-method/75622 "2006-11-11T17:01:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nephish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8e7dd6/32.png) [@nephish](https://www.ruby-forum.com/u/nephish)\
**Post date:** [November 11, 2006, 5:01pm UTC](https://www.ruby-forum.com/t/question-about-undefined-method/75622/1 "2006-11-11T17:01:38Z")

</div>

I was wondering if someone could help me with an error i am getting

undefined local variable or method `first’ for KeyWord:Class

i thought i had the method declared  
in my key\_word.rb model i have this:

def self.get\_in\_wet\_list(status)  
wet\_list = @message.find(first, :conditions =\> "name =  
‘wet\_list’ ")  
wet\_list.split(’,’).include?(status)  
end

the code in the view that calls it is this:

\<%= site.name %\> 9: 10: \<%= site.sensor.page\_value %\> 11: ![]()12: 13:

don’t know what i am missing or declaring wrong here.

thanks

---

<div class="post-metadata">

**Author:** ![nephish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8e7dd6/32.png) [@nephish](https://www.ruby-forum.com/u/nephish)\
**Post date:** [November 11, 2006, 7:02pm UTC](https://www.ruby-forum.com/t/question-about-undefined-method/75622/2 "2006-11-11T19:02:12Z")

</div>

ok, that got me further, apparently that was not the only thing wrong.  
i got this:

You have a nil object when you didn’t expect it!  
You might have expected an instance of Array.  
The error occured while evaluating nil.find

the table `key_words` looks like this  
`id` int(11) , `name` varchar(20) , `message` varchar(30)  
what i am trying to do in the key\_word.rb model is get the value of  
`message` when the `name` = ‘wet\_list’ . There should only be one ( why  
i tried first )

i think i am confused about how to set this as a value.

thanks

---

<div class="post-metadata">

**Author:** ![nephish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8e7dd6/32.png) [@nephish](https://www.ruby-forum.com/u/nephish)\
**Post date:** [November 11, 2006, 6:29pm UTC](https://www.ruby-forum.com/t/question-about-undefined-method/75622/3 "2006-11-11T18:29:35Z")

</div>

> ```
> wet_list = @message.find(first, :conditions => "name =
> 
> ```

That should be :first not first

Fred
