Sha256: 6c381c04e272e963780b2f30255e098d76b2effdf0beefcd3d989fc46612b9ff

Contents?: true

Size: 821 Bytes

Versions: 22

Compression:

Stored size: 821 Bytes

Contents

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

22 entries across 22 versions & 1 rubygems

Version Path
alchemy_cms-3.6.7 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.6.6 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.6.5 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.6.4 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.6.3 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.6.2 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.6.1 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-4.0.0.beta app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.6.0 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.5.0 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.4.2 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.5.0.rc2 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.5.0.rc1 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.4.1 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.3.3 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.3.2 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.4.0 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.4.0.rc1 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.3.1 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.3.0 app/controllers/alchemy/admin/legacy_page_urls_controller.rb