Sha256: 115fc8e12368cc05ebd3eace269925f5edc8f635c0a8895969616e29625ed0aa
Contents?: true
Size: 712 Bytes
Versions: 2
Compression:
Stored size: 712 Bytes
Contents
class Comfy::Admin::Cms::CategoriesController < Comfy::Admin::Cms::BaseController before_action :load_category, :only => [:edit, :update, :destroy] before_action :authorize def edit render end def create @category = @site.categories.create!(category_params) rescue ActiveRecord::RecordInvalid head :ok end def update @category.update_attributes!(category_params) rescue ActiveRecord::RecordInvalid head :ok end def destroy @category.destroy end protected def load_category @category = @site.categories.find(params[:id]) rescue ActiveRecord::RecordNotFound head :ok end def category_params params.fetch(:category, {}).permit! end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
comfortable_mexican_sofa-1.12.11 | app/controllers/comfy/admin/cms/categories_controller.rb |
comfortable_mexican_sofa-1.12.10 | app/controllers/comfy/admin/cms/categories_controller.rb |