SFEley / sinatra-flash

TODO: one-line summary of your gem
Other
154 stars 24 forks source link

sinatra-flash gem isn't working #9

Open trekr5 opened 9 years ago

trekr5 commented 9 years ago

Hello,

Attempted to use the sinatra-flash gem with my app and get the following error of "undefined local variable or method 'flash'" when I try to run my app.

Background

my_app

require 'sinatra/base' require 'sinatra/flash'

class GGInfraUserManager < Sinatra::Base enable :sessions register Sinatra::Flash

...(rest of app)

post '/' do

flash[:error] = "Password must be a minimum of 8 characters" unless new_password.match /.{8}/ log.info "#{Time.now} password meets policy requirements" end redirect '/' end

in my view file..(at the top).

× <%= flash.now[:error] %>

Can someone please tell me how to correct this error so that the flash functionality will work?

Many thanks

sixtyfive commented 7 years ago

I'm seeing the same thing. Has it simply stopped working because of some change in Sinatra?

staycreativedesign commented 5 years ago

Correct this doesnt work