Sha256: 22de6745f67ba30f93a8c3f2942e5a8d8116fe92e6bc6162834c2787bc0b751b

Contents?: true

Size: 594 Bytes

Versions: 39

Compression:

Stored size: 594 Bytes

Contents

# NOTE: This is a workaround to get Devise working with Turbo
class TurboDeviseController < ApplicationController
  class Responder < ActionController::Responder
    def to_turbo_stream
      controller.render(options.merge(formats: :html))
    rescue ActionView::MissingTemplate => error
      if get?
        raise error
      elsif has_errors? && default_action
        render rendering_options.merge(formats: :html, status: :unprocessable_entity)
      else
        redirect_to navigation_location
      end
    end
  end

  self.responder = Responder
  respond_to :html, :turbo_stream
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
bullet_train-1.2.10 app/controllers/turbo_devise_controller.rb
bullet_train-1.2.9 app/controllers/turbo_devise_controller.rb
bullet_train-1.2.8 app/controllers/turbo_devise_controller.rb
bullet_train-1.2.7 app/controllers/turbo_devise_controller.rb
bullet_train-1.2.6 app/controllers/turbo_devise_controller.rb
bullet_train-1.2.5 app/controllers/turbo_devise_controller.rb
bullet_train-1.2.4 app/controllers/turbo_devise_controller.rb
bullet_train-1.2.3 app/controllers/turbo_devise_controller.rb
bullet_train-1.2.2 app/controllers/turbo_devise_controller.rb
bullet_train-1.2.1 app/controllers/turbo_devise_controller.rb
bullet_train-1.2.0 app/controllers/turbo_devise_controller.rb
bullet_train-1.1.10 app/controllers/turbo_devise_controller.rb
bullet_train-1.1.9 app/controllers/turbo_devise_controller.rb
bullet_train-1.1.7 app/controllers/turbo_devise_controller.rb
bullet_train-1.1.6 app/controllers/turbo_devise_controller.rb
bullet_train-1.1.5 app/controllers/turbo_devise_controller.rb
bullet_train-1.1.4 app/controllers/turbo_devise_controller.rb
bullet_train-1.1.3 app/controllers/turbo_devise_controller.rb
bullet_train-1.1.2 app/controllers/turbo_devise_controller.rb
bullet_train-1.1.1 app/controllers/turbo_devise_controller.rb