Rails - Why is HAML showing the full hash?

lol12345

New Member
View:\[code\]!!!%html %head %title= full_title(yield(:title)) =stylesheet_link_tag "application", media: "all" =javascript_include_tag "application" =csrf_meta_tags =render 'layouts/shim' %body =render 'layouts/header' .container =flash.each do |key, value| %div{class: "alert alert-#{key}"} #{value}\[/code\]Controller\[code\] def create @user = User.new(params[:user]) if @user.save flash[:success] = "This is Correct" redirect_to @user else flash[:wrong] = "no" render 'new' end end\[/code\]Regardless of the flash (:success or :wrong or otherwise) it always compiles the entire hash as html (below)Output:\[code\] <!DOCTYPE html> .... <div class='container'> <div class='alert alert-wrong'>no</div> {:wrong=>"no"} </div> </body> </html>\[/code\]I have no idea why \[code\]{:wrong=>"no"}\[/code\] is being displayed. I've been staring at this terminal for hours. What's interesting is that the hash is being outputted with the \[code\]container\[/code\] id, but not in the \[code\]alert\[/code\] class. It feels like an indentation problem, but I went through several permutations with no success.
 
Back
Top