Class: Peoplefinder::PersonImageController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Peoplefinder::PersonImageController
- Defined in:
- app/controllers/peoplefinder/person_image_controller.rb
Instance Method Summary collapse
Instance Method Details
#edit ⇒ Object
5 6 7 8 9 10 11 |
# File 'app/controllers/peoplefinder/person_image_controller.rb', line 5 def edit @image = @person.image unless @image.present? notice :no_image_uploaded, person: @person redirect_to edit_person_path(@person) end end |
#update ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/controllers/peoplefinder/person_image_controller.rb', line 13 def update @person.assign_attributes(person_params) if @person.image.recreate_versions! notice :image_cropped, person: @person redirect_to person_path(@person, cache_bust: Time.now.to_i) else error :update_error render action: 'edit' end end |