-1
我有一个占位符文本的窗体。我希望能够使其中的一部分变得动态。这似乎很简单,但我无法弄清楚。我错过了什么?是否可以将ERB放入simple_form占位符字符串中?
这里的形式:
<%= simple_form_for([@reviewable, @review]) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<%= f.input :review, :input_html => { :class => "span4", :rows => 10 },
label: false,
placeholder: 'Help others by sharing what you\'ve learned as a major.' %>
</div>
<div class="modal-footer">
<button class="btn cancel-modal-review" data-dismiss="modal" aria-hidden="true">Cancel</button>
<%= f.submit 'Share My Review', :class => "submit-feedback" %>
</div>
<% end %>
我想占位符文本阅读这些方针的东西:
placeholder: 'Help others by sharing what you\'ve learned as a <%= @major.name %> major.'
但是,当我这样做,它通过分享你所读文字“帮助他人”我学到了<%= @ major.name%> major。“
谢谢!我也试过#{@major.name},但是我忽略了双引号。非常感谢! – lflores 2013-03-20 22:04:47