Making the Rails Flash Intercooler Friendly

This tutorial will show you how to make the Rails flash and IntercoolerJS play well together.



Here are the basic steps

  • Extract your flash message content to a ERB partial, with a div around the partial include.
  • Create a route to the partial that is rendered using the render :partial technique in rails.
  • Make the surrounding div add new flash messages from the new route using the ic-append-from and ic-deps attributes.

Git Diff

Here is a diff of the changes: