Rails: Where to define a helper method that will be available to several controllers?

It should be in app/controllers/application_controller.rb

The app/helpers/application_helper.rb is for shared view helpers.


You should include the application helper module in your application controller so that its methods will be available everywhere (all controllers and views) during a request.

class ApplicationController < ActionController::Base
  helper ApplicationHelper
  …
end

See the API docs for the helper method


Starting from Rails 3 you could also call view_context.my_method inside your controller