This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//FightCode can only understand your robot | |
//if its class is called Robot | |
var Robot = function(robot) { | |
}; | |
var rotateDir = 'right'; | |
var cloned = 0; | |
Robot.prototype.onIdle = function(ev) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ send_for_approval: "sent for approval", | |
deactivate: "deactivated", | |
reactivate: "reactivated", | |
}.each do |status, desc| | |
define_method status do | |
if @offer.send(status) | |
redirect_to @offer, :notice => "Offer was #{desc}." | |
else | |
render :action => "edit" | |
end |