Skip to content

Commit

Permalink
Explicitly include Turbolinks in base controller
Browse files Browse the repository at this point in the history
 * allows an application to opt out of Turbolinks in
   non-Alchemy controllers
  • Loading branch information
Daniel Sjöblom committed Apr 14, 2022
1 parent f7e995f commit f4591cc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/controllers/alchemy/base_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ class BaseController < ApplicationController
include Alchemy::ControllerActions
include Alchemy::Modules

# Include Turbolinks explicitly in case Alchemy is embedded into a
# larger application that doesn't work with Turbolinks. The app
# can then set config.turbolinks.auto_include = false so that
# Turbolinks is not included in the app controllers.
include Turbolinks::Controller
::ActionDispatch::Assertions.include ::Turbolinks::Assertions

protect_from_forgery

before_action :mailer_set_url_options
Expand Down

1 comment on commit f4591cc

@tvdeyen
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dssjoblom please send this as PR

Please sign in to comment.