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:
<td><%= site.name %></td>
9: <td>
10: <%= site.sensor.page_value %>
11: <img src="<%=
fetch_circle_for(site.sensor.page_value)%>"
%>
12: </td>
13:
don''t know what i am missing or declaring wrong here.
thanks
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
> wet_list = @message.find(first, :conditions => "nameThat should be :first not first Fred -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---