application_controller.rb revision b273295144399944a00c71d72f3d5d0d7695942c
f79d43bbe70a01454049b77d6f15f6369744959eStéphane Graberclass ApplicationController < ActionController::Base
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano # CanCan Authorization
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano # A foreign key constraint exception from the database
10fba81b9d0221b8e47aa1e0b43236413b7d28dfMichel Normand # shorten the message
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano flash: {error: "Whatever you tried to do - the server is unable to process your request because of a foreign key constraint. (#{message})" }
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano # anything else
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano flash[:error] = 'you need admin privileges for this action'