10
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

Organization

[Rails] 各helperが全てのviewから読み込めてしまうのを禁止する

Rails 3.1以上

1行追加するだけ。

config/application.rb

module FooApp
  ~
  class Application < Rails::Application
    config.action_controller.include_all_helpers = false
  ~
  end
end

Rails 3.1未満

1行削除するだけ。

app/controllers/application_controller.rb
helper :all   # 削除する

参考

Why are all Rails helpers available to all views, all the time? Is there a way to disable this?
http://stackoverflow.com/questions/1179865/why-are-all-rails-helpers-available-to-all-views-all-the-time-is-there-a-way-t

Register as a new user and use Qiita more conveniently

  1. You can follow users and tags
  2. you can stock useful information
  3. You can make editorial suggestions for articles
What you can do with signing up
10
Help us understand the problem. What are the problem?