Sha256: a4a7ad641c09b02b91912b0df7b3460783ba7f1a8009d9d5e627a35955341d38

Contents?: true

Size: 1.17 KB

Versions: 62

Compression:

Stored size: 1.17 KB

Contents

module Workarea
  class Admin::NavigationRedirectsController < Admin::ApplicationController
    required_permissions :settings

    def index
      @redirect = Navigation::Redirect.new
      @redirects = Navigation::Redirect.search(params[:q])
        .page(params[:page])
        .order_by(find_sort(Navigation::Redirect))
    end

    def show
      @redirect = Navigation::Redirect.find(params[:id])
      redirect_to navigation_redirects_path(q: @redirect.path)
    end

    def create
      @redirect = Navigation::Redirect.new(params[:redirect])

      if @redirect.save
        flash[:success] = t('workarea.admin.navigation_redirects.flash_messages.created')
        redirect_to navigation_redirects_path
      else
        flash[:error] = @redirect.errors.full_messages.join(', ')
        redirect_to navigation_redirects_path, status: :unprocessable_entity
      end
    end

    def edit
      redirect_to navigation_redirects_path
    end

    def destroy
      @redirect = Navigation::Redirect.find(params[:id])
      @redirect.destroy

      flash[:success] = t('workarea.admin.navigation_redirects.flash_messages.removed')
      redirect_to navigation_redirects_path
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-admin-3.4.27 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.5.4 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.4.26 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.5.3 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.4.25 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.5.2 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.4.24 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.5.1 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.4.23 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.4.22 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.5.0 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.4.21 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.5.0.beta.1 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.4.20 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.4.19 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.4.18 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.4.17 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.4.16 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.4.15 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.4.14 app/controllers/workarea/admin/navigation_redirects_controller.rb