Method not known

Hi all,

I have a partial and call a method list_users in that partial (in
partial: users = list_users(showtree.id))

I get undefined method `list_users’ for #<#Class:0x5530124:
0x55300fc> error

I have defined a function in a controller admin_controller.rb and the
partial is called in the corresponding admin view. I find it strange
that the method is not known?

Someone knows what I’m doing wrong?

Thanks in advance
Stijn

On 2/3/07, Tarscher [email protected] wrote:

partial is called in the corresponding admin view. I find it strange
that the method is not known?

Someone knows what I’m doing wrong?

Thanks in advance
Stijn

If that list_users() function is defined in the controller you must
make it available to the view by explicitly using helper_method():

admin_controller.rb

def list_users

end
helper_method :list_users

Hope this helps.


Zack C.
http://depixelate.com

thanks, that solved it

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