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.5.15 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.4.36 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.5.14 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.4.35 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.5.13 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.4.34 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.5.12 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.4.33 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.5.11 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.5.10 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.4.32 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.5.9 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.4.31 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.5.8 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.4.30 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.5.7 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.4.29 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.5.6 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.4.28 app/controllers/workarea/admin/navigation_redirects_controller.rb
workarea-admin-3.5.5 app/controllers/workarea/admin/navigation_redirects_controller.rb