Class: My::ProfilesController
- Inherits:
-
BaseController
- Object
- BaseController
- My::ProfilesController
- Defined in:
- app/controllers/profiled/my/profiles_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'app/controllers/profiled/my/profiles_controller.rb', line 10 def create @profile = current_user.profiles.build(profile_params) if @profile.save render 'create' else prepare_form render :new end end |
#destroy ⇒ Object
38 39 |
# File 'app/controllers/profiled/my/profiles_controller.rb', line 38 def destroy end |
#edit ⇒ Object
24 25 26 |
# File 'app/controllers/profiled/my/profiles_controller.rb', line 24 def edit prepare_form end |
#new ⇒ Object
5 6 7 8 |
# File 'app/controllers/profiled/my/profiles_controller.rb', line 5 def new @profile = current_user.profiles.build prepare_form end |
#show ⇒ Object
21 22 |
# File 'app/controllers/profiled/my/profiles_controller.rb', line 21 def show end |
#update ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'app/controllers/profiled/my/profiles_controller.rb', line 28 def update @profile.assign_attributes profile_params if @profile.save render 'update' else render :edit, locals: { model: @profile }, status: :unprocessable_entity end end |