Class: Bbs::ProfilesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Bbs::ProfilesController
- Defined in:
- app/controllers/bbs/profiles_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/bbs/profiles_controller.rb', line 9 def create if current_user.create_profile(profile_params) redirect_to edit_profile_path, notice: t('.success') else flash.now[:alert] = current_user.profile.errors. render :edit end end |
#edit ⇒ Object
5 6 7 |
# File 'app/controllers/bbs/profiles_controller.rb', line 5 def edit current_user.build_profile unless current_user.profile end |
#update ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/bbs/profiles_controller.rb', line 19 def update if current_user.profile.update(profile_params) redirect_to edit_profile_path, notice: t('.success') else flash.now[:alert] = current_user.profile.errors. render :edit end end |