Generate labels for attribute automatically
I'm not sure why it isn't already done by foundation's form builder. It doesn't make any sense to change an ID of a form field without changing the `for` attribute of its label.
This commit is contained in:
@@ -19,8 +19,10 @@
|
||||
<% progress_options = { min: ProgressBar::RANGE.min, max: ProgressBar::RANGE.max, step: 1 } %>
|
||||
<div class="row">
|
||||
<div class="small-12 medium-6 large-2 column">
|
||||
<%= f.label :percentage %>
|
||||
<%= f.text_field :percentage, { type: :range,
|
||||
id: "percentage_range",
|
||||
label: false,
|
||||
class: "column" }.merge(progress_options) %>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user