Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sinatra-flash gem isn't working #9

Open
trekr5 opened this issue Jan 14, 2015 · 2 comments
Open

sinatra-flash gem isn't working #9

trekr5 opened this issue Jan 14, 2015 · 2 comments

Comments

@trekr5
Copy link

trekr5 commented Jan 14, 2015

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
Copy link

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

@staycreativedesign
Copy link

Correct this doesnt work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants