Files
growstuff/app/controllers/application_controller.rb
Skud 2ecbd8315d bugfix: don't say 'not yet set' in planting form
PT: https://www.pivotaltracker.com/story/show/51457917

Maco found this. The problem was that if you had a blank planting date,
and then re-edited the planting, it would say "not yet set" in the form
field, then die when it later tried to convert that to a date.

I replaced Miles's planted_at_string stuff in the model with a simpler
parse_date method in the application helper.
2013-06-11 16:08:02 +10:00

19 lines
522 B
Ruby

class ApplicationController < ActionController::Base
protect_from_forgery
include ApplicationHelper
# tweak CanCan defaults because we don't have a "current_user" method
# this means that we use current_user in specs but current_member everywhere
# else in the code.
def current_ability
@current_ability ||= Ability.new(current_member)
end
# CanCan error handling
rescue_from CanCan::AccessDenied do |exception|
redirect_to request.referer || root_url, :alert => exception.message
end
end