You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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).
Can someone please tell me how to correct this error so that the flash functionality will work?
Many thanks
The text was updated successfully, but these errors were encountered: