如何修改Rails表单助手生成的HTML

时间:2014-05-19 10:31:37

标签: ruby-on-rails simple-form simple-form-for

我想要这个结构:

<label for="form-field-1" class="col-sm-3 control-label no-padding-right">Text Field</label>
<div class="col-sm-9">
  <div class="input string optional url_command_model_name"><input type="text" name="url_command[model_name]" id="url_command_model_name" class="string optional"></div>
</div>

但是当我使用= f.input :model_name时,我会得到这个HTML:

<div class="input string optional url_command_model_name">
  <label for="url_command_model_name" class="string optional control-label">Model name</label>
  <input type="text" name="url_command[model_name]" id="url_command_model_name" class="string optional">
</div>

0 个答案:

没有答案