Buffalo Forums
General => Lounge - Everything non-product related => : tejaswiniul July 18, 2018, 01:58:59 AM
-
I am a beginner at using Golang (https://mindmajix.com/go-training) 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">×</span></button>
<%= msg %>
</div>
<% } %>
<% } %>
</div>
</div>