earnings_controller.rb 355 Bytes
Newer Older
1
2
3
4
5
6

class EarningsController < ApplicationController
  before_filter :set_earning, :only => [:cancel]

  # TODO user should be set
  def cancel
surma Lodur's avatar
surma Lodur committed
7
8
9
10
11
    if hacker_signed_in?
    @earning.cancel!(current_hacker)
    else
      @earning.cancel!
    end
12
13
14
15
16
17
18
19
20
21
    redirect_to :back
  end


  protected

  def set_earning
    @earning = Earning.find(params[:id])
  end
end