Ruby / Sinatra / HAML flash message problem -


I have the following small synthora applications (I've removed the extra redundant code):

  Helpers deaf Flash (Args = {} session [: Flash] = Args & DefFlash_on (Args = {}) @ Flash = Args and Fly @ Flash = Sessions [: Flash] || {} Session [: Flash] = Zero End Post '/ Post' Client = Twitter = Customer :: Client (NewJet: Login => 'xxxxxxx', password => 'xxxxxxx') User Name = Param [ User name] type = param [: type] tag = param [: tag] budget = consultation [: budget] if user name =! '' & Amp; Amp; type! = '' & Amp; Amp; Tags! = '' & Amp; Amp; Budget! = '' Message = username '' + tag + 'with skill' + type + 'is looking for budget =' + budget + '# ferilance # job' status = customer.states (: post, message) flash (: Notice = & gt; 'gig posting successfully sent!') And flash (: error = & gt; 'gig posting failed - please check the marked field!) End redirected' / 'end  

And then I have the following in the Ham base layout template file that is used by the application If: @phlash [: notices]% p.notice = @flash [

prefix = message: if @ Flash [: error]% p.error = @ flash [: error] : Notice]

So, in principle, when someone posts a message, called Flash () assistant and a session variable is set, the request is redirectioned, An example variable kicks in the filter when first it should set the session variable and accessible by the template.

However, for my life, I can not understand why it is not printing the message in the template.

Any thoughts?

I have decided to use it instead:


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -