Skip to content

Commit

Permalink
Handle both rails 7.2 and rails 8.0 field types
Browse files Browse the repository at this point in the history
They got renamed in:
* rails/rails#52432
* rails/rails#52467

This ensures the correct classes are generated for both old and new versions

(cherry picked from commit 68d819a)
  • Loading branch information
Earlopain authored and flavorjones committed Oct 10, 2024
1 parent 2a13fdd commit 0c6b495
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, multiple: true, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
<% else -%>
<%%= form.label :<%= attribute.column_name %> %>
<% if attribute.field_type == :text_area -%>
<% if attribute.field_type == :textarea || attribute.field_type == :text_area -%>
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, rows: 4, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
<% elsif attribute.field_type == :checkbox -%>
<% elsif attribute.field_type == :checkbox || attribute.field_type == :check_box -%>
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: "block mt-2 h-5 w-5" %>
<% else -%>
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
Expand Down

0 comments on commit 0c6b495

Please sign in to comment.