3

I'm trying to ask a type to a multiple flash message in Connect-Flash - Express and gives me multiple string messages but not "type"

In Route:

  app.get '/multiple-flash', (req, res) ->
    req.flash "info", ["Welcome", "Benvenuto"]
    res.redirect '/'

In client:

doctype 5
html
  head
    title= 'Login'

  body
    p layout

      if message 
        p= message

    -console.log(message)

GET /multiple-flash at localhost, but the output in the console does not show "type".

GET /multiple-flash 302 1ms - 90
[ [ 'Welcome', 'Benvenuto', ] ]

How can I fix? thanks

1 Answer 1

1

I hope it will be helpful to those who have had the same problem. In route '/' will be:

  app.get '/', (req, res) -> 
    res.render '', 
      message: req.flash() 

instead previously was wrong with:

message: req.flash ('info')

that returns only the flash of info.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.