Created
March 16, 2009 16:23
-
-
Save josevalim/79951 to your computer and use it in GitHub Desktop.
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
class ProjectsController < InheritedResources | |
def set_flash_message!(status, default_message) | |
message = if action_name == 'create' && status == :error | |
'This is a new message. Your project could not be created.' | |
else | |
default_message | |
end | |
flash[status] = message unless message.blank? | |
end | |
end | |
# If you want to change in all methods, do at the end of your application_controller. | |
require 'inherited_resources' | |
module InheritedResources #:nodoc: | |
module BaseHelpers #:nodoc: | |
def set_flash_message!(status, message) | |
flash[status] = message unless message.blank? | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment