Sha256: 0d7bd0e738d01b8195f20415231036e46b30ff5d622e7a4b3ac78358a36437e1

Contents?: true

Size: 912 Bytes

Versions: 82

Compression:

Stored size: 912 Bytes

Contents

class Admin::FestivityCategoryTypesController  < Admin::ResourceController

  def index

  end

  def show

  end

  def create
    site = Site.find(params[:site_id])
    new_category_type = site.festivity_category_types.new(name: params[:name], page_class: params[:page_class])
    if new_category_type.save
      render partial: 'admin/sites/partials/new_category_type', :locals => { :new_category_type => new_category_type, :category_types => site.festivity_active_category_types}
    else
      render status: :conflict, text: "Category Type name must be unique."
    end

  end

  def destroy
    category_type = FestivityCategoryType.find(params[:id])
    site = Site.find(category_type.site_id)
    category_type.inactive = true
    if category_type.save!
      render partial: 'admin/sites/partials/category_types', :locals => { :category_types => site.festivity_active_category_types}
    end
  end

end

Version data entries

82 entries across 82 versions & 1 rubygems

Version Path
trusty-festivity-extension-2.6.3 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.6.2 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.6.1 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.6 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.5.19 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.5.18 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.5.17 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.5.16 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.5.15 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.5.14 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.5.13 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.5.12 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.5.11 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.5.10 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.5.9 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.5.8 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.5.7 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.5.6 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.5.5 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.5.4 app/controllers/admin/festivity_category_types_controller.rb