Sha256: 4c42dc4076f7c37b192957fe1d9ddbc2fb9164fc24c615d9bf192c881c5c0607

Contents?: true

Size: 852 Bytes

Versions: 162

Compression:

Stored size: 852 Bytes

Contents

# frozen_string_literal: true

module Alchemy
  class Admin::LegacyPageUrlsController < Alchemy::Admin::ResourcesController
    before_action :load_page

    def new
      @legacy_page_url = @page.legacy_urls.build
    end

    def create
      @legacy_page_url = @page.legacy_urls.build(legacy_page_url_params)
      @legacy_page_url.save
    end

    def update
      @legacy_page_url = LegacyPageUrl.find(params[:id])
      if @legacy_page_url.update(legacy_page_url_params)
        render :update
      else
        render :edit
      end
    end

    def destroy
      @legacy_page_url = LegacyPageUrl.find(params[:id])
      @legacy_page_url.destroy
    end

    private

    def load_page
      @page = Page.find(params[:page_id])
    end

    def legacy_page_url_params
      params.require(:legacy_page_url).permit(:urlname)
    end
  end
end

Version data entries

162 entries across 162 versions & 1 rubygems

Version Path
alchemy_cms-7.1.12 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-7.0.15 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-6.1.10 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-7.1.11 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-7.1.10 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-7.1.9 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-7.0.14 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-7.0.13 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-7.1.8 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-7.1.7 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-7.0.12 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-7.0.11 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-7.1.6 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-7.1.5 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-7.0.10 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-7.1.4 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-7.0.9 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-7.1.3 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-7.1.2 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-7.1.1 app/controllers/alchemy/admin/legacy_page_urls_controller.rb