Rails 5.0.0.1
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
我正在使用Rails 5,当我尝试设置文本区域的占位符时,它会输出哈希值而不是设置占位符的值。
<%= form_tag(new_project_note_path, method: 'POST') do %>
<%= text_area_tag :content, placeholder: "Your note..." %>
<% end %>
答案 0 :(得分:2)
来自docs text_area_tag(name, content = nil, options = {})
第二个选项是内容。如果您不想传递任何内容,请将其设为零。
试试这样。
<%= text_area_tag :content, :nil, placeholder: "Your note..." %>
希望这有帮助。
答案 1 :(得分:1)
<%= text_area_tag :post, :"", placeholder: "Your note..."%>
啤酒花有助于......