10
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

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

Posted at

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

10
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?