我有一个包含占位符文本的表单。我希望能够使其成为动态的一部分。这似乎很简单,但我无法弄清楚。我错过了什么?
这是表格:
<%= 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 %> 专业所学的知识来帮助他人”。