phcmemberspro 1.6.3 → 1.6.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8dd4b493934476044eba3fbc00321edcdaebcda
|
4
|
+
data.tar.gz: b94743cef2b4c486fc36f1c3d0d037923221798d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 670017c6adbdbeb763bde04578033a4406e1a5cd4c41d13eb8cd6ef0ebcbe32c9af3b8fa4fb0526668fa7792110ea98ce0e5b3f2252344c80b1ba0d2c44b3498
|
7
|
+
data.tar.gz: 674a8b204544e9bf4c6508f2c2ea3b3d8e6a72d6b189678ed7372557aff88429b1dd21f2211a205734f1dfa9e047d2e870b161e546d52c91aebf5e7b5e3d81e5
|
@@ -1,87 +1,67 @@
|
|
1
1
|
require_dependency "phcmemberspro/application_controller"
|
2
2
|
|
3
3
|
module Phcmemberspro
|
4
|
-
class Members::
|
5
|
-
|
4
|
+
class Members::MainsController < ApplicationController
|
5
|
+
|
6
6
|
# Security & Action Filters
|
7
7
|
before_filter :authenticate_user!
|
8
8
|
layout 'layouts/phcmemberspro/members/members_all.html.erb'
|
9
|
-
before_action :
|
10
|
-
|
11
|
-
# Add Member Contact Information
|
12
|
-
before_action :phc_member_mains_info
|
9
|
+
before_action :set_members_main, only: [:show, :edit, :update, :destroy]
|
13
10
|
|
14
|
-
|
15
|
-
@main = Members::Main.find(params[:main_id])
|
16
|
-
end
|
17
|
-
|
18
|
-
# Member Contact Index
|
11
|
+
# Member Profile List
|
19
12
|
def index
|
20
|
-
|
21
|
-
@members_contacts = main.contacts.scoped_to(current_account).order('mccontactname ASC')
|
13
|
+
@members_mains = Members::Main.scoped_to(current_account)
|
22
14
|
end
|
23
15
|
|
24
|
-
# Detailed Member
|
16
|
+
# Detailed Member Profile
|
25
17
|
def show
|
26
|
-
main = Members::Main.find(params[:main_id])
|
27
|
-
@members_contact = main.contacts.scoped_to(current_account).find(params[:id])
|
28
18
|
end
|
29
19
|
|
30
|
-
# New
|
20
|
+
# New Member Profile
|
31
21
|
def new
|
32
|
-
|
33
|
-
@members_contact = main.contacts.scoped_to(current_account).build
|
34
|
-
respond_to do |format|
|
35
|
-
format.html # new.html.erb
|
36
|
-
format.xml { render :xml => @members_contact }
|
37
|
-
end
|
22
|
+
@members_main = Members::Main.scoped_to(current_account).new
|
38
23
|
end
|
39
24
|
|
40
|
-
# Edit
|
25
|
+
# Edit Member Profile
|
41
26
|
def edit
|
42
|
-
main = Members::Main.find(params[:main_id])
|
43
|
-
@members_contact = main.contacts.scoped_to(current_account).find(params[:id])
|
44
27
|
end
|
45
28
|
|
46
|
-
# Create Action
|
29
|
+
# Create Member Profile Action
|
47
30
|
def create
|
48
|
-
@
|
49
|
-
|
50
|
-
|
51
|
-
redirect_to members_main_contacts_path, notice: 'Member contact information was successfully created.'
|
31
|
+
@members_main = Members::Main.scoped_to(current_account).new(members_main_params)
|
32
|
+
if @members_main.save
|
33
|
+
redirect_to members_mains_path, notice: 'Member profile was successfully created.'
|
52
34
|
else
|
53
35
|
render :new
|
54
36
|
end
|
55
37
|
end
|
56
38
|
|
57
|
-
# Update Action
|
39
|
+
# Update Member Profile Action
|
58
40
|
def update
|
59
|
-
if @
|
60
|
-
redirect_to
|
41
|
+
if @members_main.scoped_to(current_account).update(members_main_params)
|
42
|
+
redirect_to members_mains_path, notice: 'Member profile was successfully updated.'
|
61
43
|
else
|
62
44
|
render :edit
|
63
45
|
end
|
64
46
|
end
|
65
47
|
|
66
|
-
# Delete Action
|
48
|
+
# Delete Member Profile Action
|
67
49
|
def destroy
|
68
|
-
@
|
69
|
-
|
70
|
-
@members_contact.destroy
|
71
|
-
redirect_to members_main_contacts_path, notice: 'Member contact information was successfully destroyed.'
|
50
|
+
@members_main.scoped_to(current_account).destroy
|
51
|
+
redirect_to members_mains_path, notice: 'Member profile was successfully destroyed.'
|
72
52
|
end
|
73
53
|
|
74
54
|
private
|
75
55
|
|
76
56
|
# Common Callbacks
|
77
|
-
def
|
78
|
-
@
|
57
|
+
def set_members_main
|
58
|
+
@members_main = Members::Main.scoped_to(current_account).find(params[:id])
|
79
59
|
end
|
80
60
|
|
81
61
|
# White List
|
82
|
-
def
|
83
|
-
params.require(:
|
62
|
+
def members_main_params
|
63
|
+
params.require(:members_main).permit(:mfirstname, :mlastname, :mtitle, :memail, :mphone, :mnotes, :account_id)
|
84
64
|
end
|
85
65
|
|
86
66
|
end
|
87
|
-
end
|
67
|
+
end
|