1

I want to get this structure:

<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>

But when I use = f.input :model_name, I get this 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>
Kostas Rousis
  • 5,918
  • 1
  • 33
  • 38
newBike
  • 14,385
  • 29
  • 109
  • 192
  • I'd suggest not to fight with form helpers and using a good old input_tag – apneadiving May 19 '14 at 10:48
  • If you're going to want to re-use this structure for forms a lot then you could make your own form helpers. See http://stackoverflow.com/questions/2623250/custom-form-helpers – Max Williams May 19 '14 at 11:01
  • Alternatively, make a partial, or do as @apneadiving suggests and just have the raw html in your template, plugging in the dynamic data as necessary. – Max Williams May 19 '14 at 11:02

0 Answers0