[Rails] How do you define a method

Victor Al bluestar007 at gmail.com
Tue Aug 8 19:03:19 GMT 2006


Hi all,
I was wondering if anybody could help me figure why a view cannot find a 
method that I defined in another class. I do this in the view: (let's 
say index.rhtml)

<%= check_box("item_search_page", "method_name")

Here, item_search_page is a variable in the view's controller, which 
creates a new ItemSearchPage object. And I defined "method_name" in the 
class:

class ItemSearchPage
  def method_name
  end
end


So, although I defined the method and it's public, the view says 
"undefined method 'method_name'.

Thanks for your help..

-- 
Posted via http://www.ruby-forum.com/.


More information about the Rails mailing list