Sha256: ce3a9388d663b53df99d8ace40ba2affa44de2b07b417e0bed6b9496576f9521

Contents?: true

Size: 1.47 KB

Versions: 7

Compression:

Stored size: 1.47 KB

Contents

require_dependency "phcmembers/application_controller"

module Phcmembers
	class Members::MainsController < ApplicationController
	
		# Security & Action Filters
		# before_filter :authenticate_user!
		layout 'layouts/phcmembers/members/members_all.html.erb'
		before_action :set_members_main, only: [:show, :edit, :update, :destroy]

		# Member Profile List
		def index
			@members_mains = Members::Main.all
		end

		# Detailed Member Profile
		def show
		end

		# New Member Profile
		def new
			@members_main = Members::Main.new
		end

		# Edit Member Profile
		def edit
		end

		# Create Member Profile Action
		def create
			@members_main = Members::Main.new(members_main_params)
			if @members_main.save
				redirect_to members_mains_path, notice: 'Member profile was successfully created.'
				else
					render :new
			end
		end

		# Update Member Profile Action
		def update
			if @members_main.update(members_main_params)
				redirect_to members_mains_path, notice: 'Member profile was successfully updated.'
				else
					render :edit
			end
		end

		# Delete Member Profile Action
		def destroy
			@members_main.destroy
			redirect_to members_mains_path, notice: 'Member profile was successfully destroyed.'
		end

		private

		# Common Callbacks
		def set_members_main
			@members_main = Members::Main.find(params[:id])
		end

		# White List
		def members_main_params
			params.require(:members_main).permit(:mfirstname, :mlastname, :mtitle, :memail, :mphone, :mnotes, :account_id)
		end

	end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
phcmembers-0.9.6 app/controllers/phcmembers/members/mains_controller.rb
phcmembers-0.8.0 app/controllers/phcmembers/members/mains_controller.rb
phcmembers-0.6.2 app/controllers/phcmembers/members/mains_controller.rb
phcmembers-0.6.1 app/controllers/phcmembers/members/mains_controller.rb
phcmembers-0.6.0 app/controllers/phcmembers/members/mains_controller.rb
phcmembers-0.5.9 app/controllers/phcmembers/members/mains_controller.rb
phcmembers-0.5.8 app/controllers/phcmembers/members/mains_controller.rb