Sha256: 43bf3a107046ba081c097478059e5c0bc7b756dfe9109e07087469e3fc7149b2

Contents?: true

Size: 634 Bytes

Versions: 14

Compression:

Stored size: 634 Bytes

Contents

module Brightcontent
  module BaseControllerExt
    module DefaultActions
      def show
        if request.format == :html
          redirect_to action: :edit
        else
          show!
        end
      end

      def create
        create! { resource_redirect_path }
      end

      def update
        update! { resource_redirect_path }
      end

      def destroy
        destroy! { resource_index_path }
      end

      private

      def resource_redirect_path
        if params["commit_and_continue"].present?
          resource_item_path
        else
          resource_index_path
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
brightcontent-core-2.3.4 lib/brightcontent/base_controller_ext/default_actions.rb
brightcontent-core-2.3.3 lib/brightcontent/base_controller_ext/default_actions.rb
brightcontent-core-2.3.2 lib/brightcontent/base_controller_ext/default_actions.rb
brightcontent-core-2.3.1 lib/brightcontent/base_controller_ext/default_actions.rb
brightcontent-core-2.3.0 lib/brightcontent/base_controller_ext/default_actions.rb
brightcontent-core-2.2.2 lib/brightcontent/base_controller_ext/default_actions.rb
brightcontent-core-2.2.1 lib/brightcontent/base_controller_ext/default_actions.rb
brightcontent-core-2.2.0 lib/brightcontent/base_controller_ext/default_actions.rb
brightcontent-core-2.1.5 lib/brightcontent/base_controller_ext/default_actions.rb
brightcontent-core-2.1.4 lib/brightcontent/base_controller_ext/default_actions.rb
brightcontent-core-2.1.3 lib/brightcontent/base_controller_ext/default_actions.rb
brightcontent-core-2.1.2 lib/brightcontent/base_controller_ext/default_actions.rb
brightcontent-core-2.1.1 lib/brightcontent/base_controller_ext/default_actions.rb
brightcontent-core-2.1.0 lib/brightcontent/base_controller_ext/default_actions.rb