Skip to content

Commit

Permalink
Ignore loading helper in API-based controller (#347)
Browse files Browse the repository at this point in the history
Co-authored-by: Mitsuru Hayasaka <[email protected]>
  • Loading branch information
mitsuru and Mitsuru Hayasaka authored Oct 4, 2023
1 parent 488eece commit 93f2d2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/devise-i18n/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Engine < ::Rails::Engine
isolate_namespace DeviseI18n
initializer 'devise_i18n.action_controller' do
ActiveSupport.on_load :action_controller do
helper DeviseI18n::ViewHelpers
helper DeviseI18n::ViewHelpers if respond_to?(:helper)
end
end
end
Expand Down
3 changes: 3 additions & 0 deletions spec/support/devise_i18n_views_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,6 @@ def index
render DeviseI18nViewsApp.view_to_render
end
end

class TestApiController < ActionController::API
end

0 comments on commit 93f2d2c

Please sign in to comment.