【发布时间】:2016-03-25 16:55:28
【问题描述】:
我当前的简单移动表单如下所示
<%= f.input :c_regular, :label => "Regular"%>
<%= f.input :c_medium, :label => "Medium"%>
<%= f.input :c_premium, :label => "Premium"%>
<%= f.input :c_diesel, :label => "Diesel"%>
<%= f.input :c_delivery, :label => "Delivery Charges"%>
我希望表单前面有一个 $,就像上图中的 @ 一样。
提前致谢。\
<div class="row">
<%= simple_form_for @contact, url: supplier_contacts_path do |f| %>
<%= f.input :first_name, label: "First Name" %>
<%= f.input :last_name, label: "Last Name"%>
<%= f.input :business_name, label: "Business Name" %>
<%= f.input :phone_number, label: "Phone Number" %>
<%= f.input :cell_number, label: "Mobile Number" %>
<%= f.input :carrier, :label => "Mobile Carrier", :collection => mobile_carrier, :selected => "Tmobile"%>
<%= f.input :street_address, label: "Street Address" %>
<%= f.input :apt_suite, label: "Apt/Suite" %>
<%= f.input :city, label: "City" %>
<%= f.input :state, :label => "State", :collection => us_states, :selected => "New Jersey"%>
<%= f.input :zip_code, :label => "Zip Code"%>
<div class="input-group">
<span class="input-group-addon">$</span>
<%= f.input :c_regular, :label => "Regular", class: "form-control" %>
</div>
<%= f.input :c_medium, :label => "Medium"%>
<%= f.input :c_premium, :label => "Premium"%>
<%= f.input :c_diesel, :label => "Diesel"%>
<%= f.input :c_delivery, :label => "Delivery Charges"%>
<%= f.button :submit, "Add Retailer", class: "btn btn-primary block full-width m-b"%>
<%end%>
</div>
【问题讨论】:
-
你能用你在第一个响应中所做的更改来更新你上面的代码示例吗?我猜是嵌套错误,但需要查看您的代码示例才能给您修复
-
在上面添加。谢谢
标签: ruby-on-rails ruby ruby-on-rails-4 simple-form