Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add custom flash types article

  • Loading branch information...
commit 6c8ac68225f776cb46e84b582560afc9516708de 1 parent fa5fd25
@oscardelben authored
Showing with 19 additions and 0 deletions.
  1. +17 −0 2012/07/rails-edge-custom-flash-types.md
  2. +2 −0  README.md
View
17 2012/07/rails-edge-custom-flash-types.md
@@ -0,0 +1,17 @@
+# Rails Edge: Custom Flash Types
+
+Rails just got some syntactic sugar for dealing with flash messages in
+your controllers and views.
+
+You can now declare the following in your controllers:
+
+```ruby
+class ApplicationController
+ add_flash_types :error, :warning
+end
+```
+
+And then you'll be able to use `<%= error %>` in your views and
+`redirect_to .., error: "message"` in your controllers.
+
+Commit message: [Added support add_flash_types](https://github.com/rails/rails/commit/238a4253bf229377b686bfcecc63dda2b59cff8f)
View
2  README.md
@@ -16,6 +16,8 @@ I'm writing a rails internals series, here are all the posts so far:
Keep up with the latest changes in Rails edge:
+* [Rails Edge: Custom flash
+* types](https://github.com/oscardelben/words-about-code/blob/master/2012/07/rails-edge-custom-flash-types.md)
* [Rails Edge: Humans.txt](https://github.com/oscardelben/words-about-code/blob/master/2012/05/rails-edge-humans-txt.md)
* [Rails Edge: Multiple Route Files](https://github.com/oscardelben/words-about-code/blob/master/2012/04/rails-edge-multiple-route-files.md)
* [Rails Edge: Queue](https://github.com/oscardelben/words-about-code/blob/master/2012/04/rails-edge-queue.md)
Please sign in to comment.
Something went wrong with that request. Please try again.