Skip to content

Commit 061a354

Browse files
authored
Merge pull request #418 from Earlopain/checkbox-proper
Handle both rails 7.2 and rails 8.0 field types for checkbox/textarea
2 parents 24d272b + 68d819a commit 061a354

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/generators/tailwindcss/scaffold/templates/_form.html.erb.tt

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
<%%= 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" %>
2727
<% else -%>
2828
<%%= form.label :<%= attribute.column_name %> %>
29-
<% if attribute.field_type == :text_area -%>
29+
<% if attribute.field_type == :textarea || attribute.field_type == :text_area -%>
3030
<%%= 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" %>
31-
<% elsif attribute.field_type == :checkbox -%>
31+
<% elsif attribute.field_type == :checkbox || attribute.field_type == :check_box -%>
3232
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: "block mt-2 h-5 w-5" %>
3333
<% else -%>
3434
<%%= 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" %>

0 commit comments

Comments
 (0)