Sha256: 42b5fd64f4706b2db27f2fd12a06641357ed2a3930016cfe947be0ecb80ff2d2

Contents?: true

Size: 1.42 KB

Versions: 10

Compression:

Stored size: 1.42 KB

Contents

require_dependency "phcpresspro/application_controller"

module Phcpresspro
	class Modules::CategoriesController < ApplicationController

		# Security and Filters
		before_action :set_modules_category, only: [:show, :edit, :update, :destroy]

		# Categories Index
		def index
			@modules_categories = Modules::Category.all
		end

		# Detail News/Blog Category
		def show
		end

		# New News/Blog Category
		def new
			@modules_category = Modules::Category.new
		end

		# Edit News/Blog Category
		def edit
		end

		# Create News/Blog Category
		def create
			@modules_category = Modules::Category.new(modules_category_params)
			if @modules_category.save
				redirect_to modules_categories_url, notice: 'Category was successfully created.'
				else
					render :new
			end
		end

		# Update News/Blog Category
		def update
			if @modules_category.update(modules_category_params)
				redirect_to modules_categories_url, notice: 'Category was successfully updated.'
				else
					render :edit
			end
		end

		# Delete News/Blog Category
		def destroy
			@modules_category.destroy
			redirect_to modules_categories_url, notice: 'Category was successfully destroyed.'
		end

		private

		# Common Callbacks
		def set_modules_category
			@modules_category = Modules::Category.find(params[:id])
		end

		# Whitelist
		def modules_category_params
			params.require(:modules_category).permit(:catname, :user_id, :membership_id, :oganization_id)
		end

	end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
phcpresspro-4.1.8 app/controllers/phcpresspro/modules/categories_controller.rb
phcpresspro-4.1.6 app/controllers/phcpresspro/modules/categories_controller.rb
phcpresspro-4.1.5 app/controllers/phcpresspro/modules/categories_controller.rb
phcpresspro-4.1.2 app/controllers/phcpresspro/modules/categories_controller.rb
phcpresspro-4.1.1 app/controllers/phcpresspro/modules/categories_controller.rb
phcpresspro-4.1.0 app/controllers/phcpresspro/modules/categories_controller.rb
phcpresspro-4.0.6 app/controllers/phcpresspro/modules/categories_controller.rb
phcpresspro-4.0.5 app/controllers/phcpresspro/modules/categories_controller.rb
phcpresspro-4.0.4 app/controllers/phcpresspro/modules/categories_controller.rb
phcpresspro-4.0.3 app/controllers/phcpresspro/modules/categories_controller.rb