The scaffolded controller uses flash messages in both create and update actions. These messages are quite similar across different controllers. Wouldn’t it be nice if we could set these flash messages by default inside responders but still provide a nice API to change them?
Let’s implement this feature using the internationalization framework (I18n) so we can easily look up flash messages from YAML files, configure default values, and make it possible to translate such messages in the future. Let’s use rails plugin to create a new project called responders:
$ rails plugin new responders
Let’s start by writing some tests that access create, update, and destroy actions and ensure a flash message is being exhibited to ...