Making the Rails Flash Intercooler Friendly

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

Video

Outline

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:

https://github.com/LeadDyno/intercooler-tutorial-app/commit/afba53a5d78b5d79ac352f83ddf62ee5585a7d5e