Sha256: c6195547fe6eb455ea9a5411ae01762391f2a0dbc9c5ac17af3fef0a790a68b8

Contents?: true

Size: 822 Bytes

Versions: 26

Compression:

Stored size: 822 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

26 entries across 26 versions & 2 rubygems

Version Path
alchemy_cms-3.2.1 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.1.3 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
lc_alchemy_cms-3.2.1 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
lc_alchemy_cms-3.2.0 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.2.0 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.2.0.rc1 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.2.0.beta app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.1.1 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.0.4 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.1.0 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.1.0.rc3 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.1.0.rc2 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.1.0.rc1 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.1.0.beta6 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.1.0.beta5 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.1.0.beta4 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.0.3 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.1.0.beta3 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.1.0.beta2 app/controllers/alchemy/admin/legacy_page_urls_controller.rb
alchemy_cms-3.1.0.beta1 app/controllers/alchemy/admin/legacy_page_urls_controller.rb