{"action":"created","issue":{"url":"https://api.github.com/repos/activeadmin/activeadmin/issues/3061","repository_url":"https://api.github.com/repos/activeadmin/activeadmin","labels_url":"https://api.github.com/repos/activeadmin/activeadmin/issues/3061/labels{/name}","comments_url":"https://api.github.com/repos/activeadmin/activeadmin/issues/3061/comments","events_url":"https://api.github.com/repos/activeadmin/activeadmin/issues/3061/events","html_url":"https://github.com/activeadmin/activeadmin/issues/3061","id":31164069,"number":3061,"title":"ViewsHelpers methods not available in ActiveAdmin with include_all_helpers = false","user":{"login":"aprescott","id":342081,"avatar_url":"https://avatars.githubusercontent.com/u/342081?v=3","gravatar_id":"","url":"https://api.github.com/users/aprescott","html_url":"https://github.com/aprescott","followers_url":"https://api.github.com/users/aprescott/followers","following_url":"https://api.github.com/users/aprescott/following{/other_user}","gists_url":"https://api.github.com/users/aprescott/gists{/gist_id}","starred_url":"https://api.github.com/users/aprescott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aprescott/subscriptions","organizations_url":"https://api.github.com/users/aprescott/orgs","repos_url":"https://api.github.com/users/aprescott/repos","events_url":"https://api.github.com/users/aprescott/events{/privacy}","received_events_url":"https://api.github.com/users/aprescott/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2014-04-09T14:53:45Z","updated_at":"2016-04-05T13:52:16Z","closed_at":"2014-11-02T04:50:42Z","body":"In a project with\r\n\r\n```ruby\r\nconfig.action_controller.include_all_helpers = false\r\n```\r\n\r\nset in `config/application.rb` (different from the default value of `true`), view helpers are not global across all views. This can be desired behaviour to keep things scoped.\r\n\r\nHowever, with this setting, ActiveAdmin can no longer see methods defined in `ActiveAdmin::ViewsHelper`.\r\n\r\n```ruby\r\n# dummy example\r\nmodule ActiveAdmin::ViewsHelper\r\n  def final_cost(item)\r\n    item.on_sale? ? 10 : 50\r\n  end\r\nend\r\n```\r\n\r\n```ruby\r\nActiveAdmin.register Item do\r\n  # ...\r\n\r\n  index do\r\n    # ...\r\n\r\n    column :cost do |item|\r\n      final_cost(item) # not available with include_all_helpers = false\r\n    end\r\n\r\n    # ...\r\n  end\r\nend\r\n```\r\n\r\nThis fails with\r\n\r\n```\r\nActionView::Template::Error (undefined method `final_cost' for #<ActiveAdmin::Views::IndexAsTable:0x00000008ab47c8>):\r\n```\r\n\r\nThis seems like a bug, since helpers that are defined for ActiveAdmin should be available to ActiveAdmin even if the config setting is set to `false`.\r\n\r\nThe only work-around I found was to define the helper \"inline\" with the `register` content:\r\n\r\n```ruby\r\nActiveAdmin.register Item do\r\n  # ...\r\n\r\n  controller do\r\n    def final_cost(item)\r\n      item.on_sale? ? 10 : 50\r\n    end\r\n    helper_method :final_cost\r\n  end\r\n\r\n  index do\r\n    # ...\r\n\r\n    column :cost do |item|\r\n      final_cost(item)\r\n    end\r\n\r\n    # ...\r\n  end\r\nend\r\n```\r\n\r\nObviously this isn't great for organising helper methods, and doesn't allow ActiveAdmin-global helpers."},"comment":{"url":"https://api.github.com/repos/activeadmin/activeadmin/issues/comments/205814785","html_url":"https://github.com/activeadmin/activeadmin/issues/3061#issuecomment-205814785","issue_url":"https://api.github.com/repos/activeadmin/activeadmin/issues/3061","id":205814785,"user":{"login":"reicheltd","id":491988,"avatar_url":"https://avatars.githubusercontent.com/u/491988?v=3","gravatar_id":"","url":"https://api.github.com/users/reicheltd","html_url":"https://github.com/reicheltd","followers_url":"https://api.github.com/users/reicheltd/followers","following_url":"https://api.github.com/users/reicheltd/following{/other_user}","gists_url":"https://api.github.com/users/reicheltd/gists{/gist_id}","starred_url":"https://api.github.com/users/reicheltd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reicheltd/subscriptions","organizations_url":"https://api.github.com/users/reicheltd/orgs","repos_url":"https://api.github.com/users/reicheltd/repos","events_url":"https://api.github.com/users/reicheltd/events{/privacy}","received_events_url":"https://api.github.com/users/reicheltd/received_events","type":"User","site_admin":false},"created_at":"2016-04-05T13:52:16Z","updated_at":"2016-04-05T13:52:16Z","body":"@jhenkens your approach works for me in 1.0.0.pre2. thx"}}