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.3.1 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.3.0 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.2.9 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.2.8 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.2.7 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.2.6 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.2.5 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.2.4 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.2.3 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.2.2 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.2.1 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.2.0 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.1.1 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.1.0 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.0.7 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.0.6 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.0.5 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.0.4 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.0.3 app/controllers/admin/festivity_category_types_controller.rb
trusty-festivity-extension-2.0.2 app/controllers/admin/festivity_category_types_controller.rb