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.1.0 app/controllers/turbo_devise_controller.rb
bullet_train-1.0.99 app/controllers/turbo_devise_controller.rb
bullet_train-1.0.98 app/controllers/turbo_devise_controller.rb
bullet_train-1.0.97 app/controllers/turbo_devise_controller.rb
bullet_train-1.0.96 app/controllers/turbo_devise_controller.rb
bullet_train-1.0.95 app/controllers/turbo_devise_controller.rb
bullet_train-1.0.93 app/controllers/turbo_devise_controller.rb
bullet_train-1.0.92 app/controllers/turbo_devise_controller.rb
bullet_train-1.0.90 app/controllers/turbo_devise_controller.rb
bullet_train-1.0.89 app/controllers/turbo_devise_controller.rb
bullet_train-1.0.88 app/controllers/turbo_devise_controller.rb
bullet_train-1.0.87 app/controllers/turbo_devise_controller.rb
bullet_train-1.0.86 app/controllers/turbo_devise_controller.rb
bullet_train-1.0.85 app/controllers/turbo_devise_controller.rb
bullet_train-1.0.83 app/controllers/turbo_devise_controller.rb
bullet_train-1.0.81 app/controllers/turbo_devise_controller.rb
bullet_train-1.0.79 app/controllers/turbo_devise_controller.rb
bullet_train-1.0.76 app/controllers/turbo_devise_controller.rb
bullet_train-1.0.75 app/controllers/turbo_devise_controller.rb