Skip to content

Commit

Permalink
units on form
Browse files Browse the repository at this point in the history
  • Loading branch information
pikesley committed Feb 28, 2016
1 parent e92aa77 commit b1014e3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/views/shared/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
<% @decorated_metric.form_fields.each_pair do |label, data| %>
<div class='col-xs-12'>
<%= f.label label, @decorated_metric.title_for_form(label) %>
<% title = @decorated_metric.title_for_form(label) %>
<% title << " (#{@decorated_metric.units[:short]})" if @decorated_metric.thing == label %>
<%= f.label label, title %>
<% attributes = {
class: "form-control #{data[:css_class]}"
}.merge data[:input_attributes].to_h %>
Expand Down

0 comments on commit b1014e3

Please sign in to comment.