Sha256: e22272a25741a48d244a54b62743fbc720e7320fcec24c2dfbb53e63053ff5b5

Contents?: true

Size: 1.56 KB

Versions: 66

Compression:

Stored size: 1.56 KB

Contents

require_dependency "phcmemberspro/application_controller"

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

		# Member Profile List
		def index
			@members_mains = Members::Main.scoped_to(current_account) 
		end

		# Detailed Member Profile
		def show
		end

		# New Member Profile
		def new
			@members_main = Members::Main.scoped_to(current_account).new
		end

		# Edit Member Profile
		def edit
		end

		# Create Member Profile Action
		def create
			@members_main = Members::Main.scoped_to(current_account).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

66 entries across 66 versions & 1 rubygems

Version Path
phcmemberspro-4.9.4 app/controllers/phcmemberspro/members/mains_controller.rb
phcmemberspro-4.9.3 app/controllers/phcmemberspro/members/mains_controller.rb
phcmemberspro-4.9.1 app/controllers/phcmemberspro/members/mains_controller.rb
phcmemberspro-4.9.0 app/controllers/phcmemberspro/members/mains_controller.rb
phcmemberspro-4.8.9 app/controllers/phcmemberspro/members/mains_controller.rb
phcmemberspro-4.8.8 app/controllers/phcmemberspro/members/mains_controller.rb
phcmemberspro-4.8.7 app/controllers/phcmemberspro/members/mains_controller.rb
phcmemberspro-4.8.6 app/controllers/phcmemberspro/members/mains_controller.rb
phcmemberspro-4.8.5 app/controllers/phcmemberspro/members/mains_controller.rb
phcmemberspro-4.8.4 app/controllers/phcmemberspro/members/mains_controller.rb
phcmemberspro-4.8.0 app/controllers/phcmemberspro/members/mains_controller.rb
phcmemberspro-4.7.9 app/controllers/phcmemberspro/members/mains_controller.rb
phcmemberspro-4.7.0 app/controllers/phcmemberspro/members/mains_controller.rb
phcmemberspro-4.6.9 app/controllers/phcmemberspro/members/mains_controller.rb
phcmemberspro-4.6.8 app/controllers/phcmemberspro/members/mains_controller.rb
phcmemberspro-4.6.7 app/controllers/phcmemberspro/members/mains_controller.rb
phcmemberspro-4.6.6 app/controllers/phcmemberspro/members/mains_controller.rb
phcmemberspro-4.6.5 app/controllers/phcmemberspro/members/mains_controller.rb
phcmemberspro-4.6.0 app/controllers/phcmemberspro/members/mains_controller.rb
phcmemberspro-4.5.0 app/controllers/phcmemberspro/members/mains_controller.rb