Class: Phcmemberspro::Member::ProfilesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Phcmemberspro::Member::ProfilesController
- Includes:
- Phccorehelpers::PhcpluginsproHelper
- Defined in:
- app/controllers/phcmemberspro/member/profiles_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
CREATE.
-
#destroy ⇒ Object
DELETE.
-
#edit ⇒ Object
EDIT.
-
#index ⇒ Object
INDEX.
-
#new ⇒ Object
NEW.
-
#show ⇒ Object
SHOW.
-
#update ⇒ Object
UPDATE.
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
CREATE
34 35 36 37 38 39 40 41 42 43 |
# File 'app/controllers/phcmemberspro/member/profiles_controller.rb', line 34 def create @member_profile = Member::Profile.new(member_profile_params) @member_profile.user_id = current_user.id @member_profile.org_id = current_user.org_id if @member_profile.save redirect_to member_profiles_url, :flash => { :success => 'Profile was successfully created.' } else render :new end end |
#destroy ⇒ Object
DELETE
55 56 57 58 |
# File 'app/controllers/phcmemberspro/member/profiles_controller.rb', line 55 def destroy @member_profile.destroy redirect_to member_profiles_url, :flash => { :error => 'Profile was successfully destroyed.' } end |
#edit ⇒ Object
EDIT
30 31 |
# File 'app/controllers/phcmemberspro/member/profiles_controller.rb', line 30 def edit end |
#index ⇒ Object
INDEX
14 15 16 |
# File 'app/controllers/phcmemberspro/member/profiles_controller.rb', line 14 def index @member_profiles = Member::Profile.where(org_id: current_user.org_id) end |
#new ⇒ Object
NEW
25 26 27 |
# File 'app/controllers/phcmemberspro/member/profiles_controller.rb', line 25 def new @member_profile = Member::Profile.new end |
#show ⇒ Object
SHOW
19 20 21 22 |
# File 'app/controllers/phcmemberspro/member/profiles_controller.rb', line 19 def show @member_profile = Member::Profile.find(params[:id]) @member_profile_versions = Phcmemberspro::ProfileVersions.where(item_id: @member_profile, item_type: 'Phcmemberspro::Member::Profile') end |
#update ⇒ Object
UPDATE
46 47 48 49 50 51 52 |
# File 'app/controllers/phcmemberspro/member/profiles_controller.rb', line 46 def update if @member_profile.update(member_profile_params) redirect_to member_profiles_url, :flash => { :success => 'Profile was successfully updated.' } else render :edit end end |