Skip to content

Commit

Permalink
Flash messages for gallery actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mhartl committed Oct 9, 2008
1 parent 52e13f8 commit 9eb0745
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/controllers/photos_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def set_primary
if @photo.update_attributes(:primary => true)
@old_primary.each { |p| p.update_attributes!(:primary => false) }
format.html { redirect_to(person_galleries_path(current_person)) }
flash[:success] = "Gallery thumbnail set"
else
format.html do
flash[:error] = "Invalid image!"
Expand All @@ -104,6 +105,7 @@ def set_avatar
respond_to do |format|
if @photo.update_attributes!(:avatar => true)
@old_primary.each { |p| p.update_attributes!(:avatar => false) }
flash[:success] = "Profile photo set"
format.html { redirect_to current_person }
else
format.html do
Expand Down

0 comments on commit 9eb0745

Please sign in to comment.