Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是这门语言的新手,如果这浪费了你的时间,请原谅我。用户完成提交查询后,下面的代码应显示“消息已成功发送” 。它没有按预期工作。谢谢
flash.now.notice= "Message was successfully sent."
flash是一个哈希,试试flash[:notice] = "mesage".
flash
flash[:notice] = "mesage"
然后:
# on whichever template you want to render the flash messages, # most likely on layouts/application.html.erb <% if flash[:notice] %> <div class="notice"><%= flash[:notice] %></div> <% end %>