Rails: helper methods not found

hi there

I'm trying to use helpers in my controller, but they're not turning up.

NoMethodError in Switcher#index

undefined method `create_menu' for SwitcherController:Class

app/controllers/switcher_controller.rb:7:in `index'
script/server:48

I'm doing this at the top of my class

class SwitcherController < ApplicationController

helper :switcher

....

end

and the helper switcher_helper.rb exists in the helper dir

module SwitcherHelper

  def create_menu(dir)
    $menu = {}
    menu_level(dir)
  end

....

end

thanks for showing me the error of my ways ... also it is loading
switcher_helper.rb, cos if I add an exit at the top of the file it lets
me know.

ritchie

I'm trying to use helpers in my controller, but they're not turning up.

NoMethodError in Switcher#index

Helpers are _view_ helpers. The controller doesn't have access to the methods defined in the helpers. Also, since you're following the default naming convention, you don't need to be explicit with "helper :switcher". That'll happen automatically.

···

--
David Heinemeier Hansson,
http://www.basecamphq.com/ -- Web-based Project Management
http://www.rubyonrails.org/ -- Web-application framework for Ruby
http://www.loudthinking.com/ -- Broadcasting Brain

ok, thanks david.