Buffalo v0.11.0 issues with flash and application.html?

Started by tejaswiniul, July 18, 2018, 01:58:59 AM

Previous topic - Next topic

tejaswiniul

I am a beginner at using Golang and Buffalo. I am trying to create a password authentication service using the authrecipe from https://github.com/gobuffalo/authrecipe. However, upon trying to run this using buffalo dev, I am receiving the following error from the JSON dump:

ERRO[2018-05-10T14:20:48-04:00] application.html: line 14: _flash.html:

line 3: flash: unknown identifier content_type=text/html db="0s" duration="5.354757ms" human_size="0 B" method=GET params="{}" path=/ render="659.229µs" request_id="fa1ad5b329-b4e23f788b" size="0" status="0"

In line 14 application.html file, there is a reference to the flash folder, and in line 3 of my _flash.html file, there is a variable called flash. Has anyone else received this error? How did you fix it? I have tried to delete the flash command, but that did not resolve the problem and the same error kept appearing.

application.html code:

<!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta charset="utf-8">
    <title>Buffalo - Coke</title>
    <%= stylesheetTag("application.css") %>
    <meta name="csrf-param" content="authenticity_token" />
    <meta name="csrf-token" content="<%= authenticity_token %>" />
    <link rel="icon" href="<%= assetPath("images/favicon.ico") %>">
  </head>
  <body>

    <div class="container">
      <%= yield %>
    </div>

    <%= javascriptTag("application.js") %>
  </body>
</html>


_flash.html code:

<div class="row">
  <div class="col-md-12">
    <%= for (k, messages) in flash { %>
      <%= for (msg) in messages { %>
        <div class="alert alert-<%= k %>" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <%= msg %>
        </div>
      <% } %>
    <% } %>
  </div>
</div>

Browser ID: smf (is_webkit)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 5: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default), StopForumSpam.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 126 (show)
Files included: 35 - 1354KB. (show)
Memory used: 938KB.
Tokens: post-login.
Queries used: 20.

[Show Queries]