Skip to content

Commit

Permalink
Wrap unsupported form field notes in proper divs (thoughtbot#515)
Browse files Browse the repository at this point in the history
* Wrap unsupported form field notes in proper divs

Problem:

Forms for `has_one` and `polymorphic` relationships
aren't currently supported,
and they show up on form pages as a note to the user.

This note is misaligned with the other form fields,
because it is not wrapped in the same div
that applies to the other fields.

Solution:

Add the apropriate `field-unit__field` div
to the unsupported field types.

* Fix syntax error in ERB
  • Loading branch information
Graysonwright authored and iarie committed Jun 17, 2017
1 parent fd703c4 commit fdf7be9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/views/fields/has_one/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ so this partial renders a message to that effect.
<%= f.label field.attribute %>
</div>

<%= t("administrate.fields.has_one.not_supported") %>
<div class="field-unit__field">
<%= t("administrate.fields.has_one.not_supported") %>
</div>
4 changes: 3 additions & 1 deletion app/views/fields/polymorphic/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ so this partial renders a message to that effect.
<%= f.label field.name %>
</div>

<%= t("administrate.fields.polymorphic.not_supported") %>
<div class="field-unit__field">
<%= t("administrate.fields.polymorphic.not_supported") %>
</div>

0 comments on commit fdf7be9

Please sign in to comment.