Class: Lentil::FlagsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/lentil/flags_controller.rb

Instance Method Summary collapse

Instance Method Details

#tallyObject



3
4
5
6
7
8
9
10
11
# File 'app/controllers/lentil/flags_controller.rb', line 3

def tally
  image = Image.find(params[:image_id])
  flag = Flag.new(:image => image)
  if flag.save
    session[:flagged_images] ||= []
    session[:flagged_images] << params[:image_id]
  end
  redirect_to :back
end