sinatra/sinatra-book

Rack-flash unreliable. Incompatible with Rack > 1.3.6

thehack opened this issue · 3 comments

The book recommends gem 'rack-flash' for session-based notifications, but rack-flash doesn't work with up-do-date versions of rack. The sinatra-authentication gem also requires rack-flash.

solutions:

  1. Downgrade to a version of Rack pre 1.3.6
    Problem: It sets you up for more dependency problems.
  2. Use 'sinatra/flash'
    The author says the downside is that it does not work across different kinds of rack apps.
  3. Sinatra could include this functionality itself?
  4. tl;dr Maybe the best short-term solution for the book is just to post a warning about rack-flash, or recommend 'sinatra/flash' instead.

alternate for that is rack-flash3, check this out nakajima/rack-flash#8

Yeah, I had tried that and ran into something undesirable - I don't remember what. I ended up using sinatra/flash on recommendation of one of the core team. I guess that is what the book should be recommending.

zzak commented

For the time being, you can use rack-flash3 or sinatra-flash gems.