Skip to content

Commit c6a463f

Browse files
committed
Remove redundant form_group helpers
By default, the .form-group class is appended surrounding each helper. You can override this by setting wrapper: false and passing your own classes if you want.
1 parent a36495d commit c6a463f

3 files changed

Lines changed: 108 additions & 108 deletions

File tree

app/views/railsui/themes/corgie/forms/_form_builder.html.erb

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@
3030
<%%= form_with model: @user, builder: Railsui::FormBuilder do |f| %>
3131
<%%= f.text_field :name, label: "Full Name", placeholder: "John Doe" %>
3232

33-
<%%= f.form_group do %>
33+
3434
<%%= f.email_field :email, label: "Email Address", placeholder: "john@example.com", help: "We'll never share your email with anyone else." %>
35-
<%% end %>
3635

37-
<%%= f.form_group do %>
36+
37+
3838
<%%= f.text_area :bio, label: "Biography", placeholder: "Tell us about yourself...", rows: 4 %>
39-
<%% end %>
39+
4040

4141
<%%= f.submit "Save Profile" %>
4242
<%% end %>
@@ -120,51 +120,51 @@
120120
<!-- Text inputs -->
121121
<%%= f.text_field :text, label: "Text Field" %>
122122

123-
<%%= f.form_group do %>
123+
124124
<%%= f.email_field :email, label: "Email Field", placeholder: "john.doe@example.com" %>
125-
<%% end %>
126125

127-
<%%= f.form_group do %>
126+
127+
128128
<%%= f.password_field :password, label: "Password Field" %>
129-
<%% end %>
130129

131-
<%%= f.form_group do %>
130+
131+
132132
<%%= f.number_field :number, label: "Number Field", min: 0, max: 100 %>
133-
<%% end %>
134133

135-
<%%= f.form_group do %>
134+
135+
136136
<%%= f.telephone_field :phone, label: "Phone Number" %>
137-
<%% end %>
138137

139-
<%%= f.form_group do %>
138+
139+
140140
<%%= f.url_field :website, label: "Website URL" %>
141-
<%% end %>
141+
142142

143143
<!-- Date/Time inputs -->
144-
<%%= f.form_group do %>
144+
145145
<%%= f.date_field :date, label: "Date" %>
146-
<%% end %>
147146

148-
<%%= f.form_group do %>
147+
148+
149149
<%%= f.time_field :time, label: "Time" %>
150-
<%% end %>
150+
151151

152152
<!-- Special inputs -->
153-
<%%= f.form_group do %>
153+
154154
<%%= f.color_field :color, label: "Color Picker" %>
155-
<%% end %>
156155

157-
<%%= f.form_group do %>
156+
157+
158158
<%%= f.search_field :search, label: "Search", placeholder: "Search..." %>
159-
<%% end %>
160159

161-
<%%= f.form_group do %>
160+
161+
162162
<%%= f.file_field :file, label: "File Upload" %>
163-
<%% end %>
164163

165-
<%%= f.form_group do %>
164+
165+
166166
<%%= f.range_field :volume, label: "Volume", min: 0, max: 100, value: 25 %>
167-
<%% end %>
167+
168168
<%% end %>
169169
<% end %>
170170
<%= render_snippet active_tab: :erb %>
@@ -205,13 +205,13 @@
205205
{ prompt: "Choose a country" },
206206
{ label: "Country" } %>
207207

208-
<%%= f.form_group do %>
208+
209209
<%%= f.text_area :message,
210210
label: "Message",
211211
placeholder: "Enter your message here...",
212212
rows: 5,
213213
help: "Maximum 500 characters" %>
214-
<%% end %>
214+
215215
<%% end %>
216216
<% end %>
217217
<%= render_snippet active_tab: :erb %>
@@ -347,9 +347,9 @@
347347
<!-- Switch toggles -->
348348
<%%= f.switch_field :dark_mode, label: "Enable dark mode" %>
349349

350-
<%%= f.form_group do %>
350+
351351
<%%= f.switch_field :auto_save, label: "Auto-save drafts" %>
352-
<%% end %>
352+
353353
<%% end %>
354354
<% end %>
355355
<%= render_snippet active_tab: :erb %>
@@ -386,9 +386,9 @@
386386
<%%= form_with model: @user, builder: Railsui::FormBuilder do |f| %>
387387
<%%= f.text_field :name, label: "Full Name" %>
388388

389-
<%%= f.form_group do %>
389+
390390
<%%= f.email_field :email, label: "Email Address" %>
391-
<%% end %>
391+
392392

393393
<%%= f.submit "Submit" %>
394394
<%% end %>
@@ -495,22 +495,22 @@
495495
wrapper: { class: "max-w-md" } %>
496496

497497
<!-- Skip label (i.e. don't display labels) -->
498-
<%%= f.form_group do %>
498+
499499
<%%= f.email_field :email,
500500
label: false,
501501
placeholder: "Enter your email",
502502
help: "Skip displaying label",
503503
skip_label: true %>
504-
<%% end %>
504+
505505

506506
<!-- Custom label options and input class -->
507-
<%%= f.form_group do %>
507+
508508
<%%= f.text_field :website,
509509
label: "Website",
510510
placeholder: "https://",
511511
label_options: { class: "form-label font-medium text-sm text-blue-600" },
512512
class: "form-input text-lg" %>
513-
<%% end %>
513+
514514
<%% end %>
515515
<% end %>
516516
<%= render_snippet active_tab: :erb %>

app/views/railsui/themes/hound/forms/_form_builder.html.erb

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@
3030
<%%= form_with model: @user, builder: Railsui::FormBuilder do |f| %>
3131
<%%= f.text_field :name, label: "Full Name", placeholder: "John Doe" %>
3232

33-
<%%= f.form_group do %>
33+
3434
<%%= f.email_field :email, label: "Email Address", placeholder: "john@example.com", help: "We'll never share your email with anyone else." %>
35-
<%% end %>
3635

37-
<%%= f.form_group do %>
36+
37+
3838
<%%= f.text_area :bio, label: "Biography", placeholder: "Tell us about yourself...", rows: 4 %>
39-
<%% end %>
39+
4040

4141
<%%= f.submit "Save Profile" %>
4242
<%% end %>
@@ -120,51 +120,51 @@
120120
<!-- Text inputs -->
121121
<%%= f.text_field :text, label: "Text Field" %>
122122

123-
<%%= f.form_group do %>
123+
124124
<%%= f.email_field :email, label: "Email Field", placeholder: "john.doe@example.com" %>
125-
<%% end %>
126125

127-
<%%= f.form_group do %>
126+
127+
128128
<%%= f.password_field :password, label: "Password Field" %>
129-
<%% end %>
130129

131-
<%%= f.form_group do %>
130+
131+
132132
<%%= f.number_field :number, label: "Number Field", min: 0, max: 100 %>
133-
<%% end %>
134133

135-
<%%= f.form_group do %>
134+
135+
136136
<%%= f.telephone_field :phone, label: "Phone Number" %>
137-
<%% end %>
138137

139-
<%%= f.form_group do %>
138+
139+
140140
<%%= f.url_field :website, label: "Website URL" %>
141-
<%% end %>
141+
142142

143143
<!-- Date/Time inputs -->
144-
<%%= f.form_group do %>
144+
145145
<%%= f.date_field :date, label: "Date" %>
146-
<%% end %>
147146

148-
<%%= f.form_group do %>
147+
148+
149149
<%%= f.time_field :time, label: "Time" %>
150-
<%% end %>
150+
151151

152152
<!-- Special inputs -->
153-
<%%= f.form_group do %>
153+
154154
<%%= f.color_field :color, label: "Color Picker" %>
155-
<%% end %>
156155

157-
<%%= f.form_group do %>
156+
157+
158158
<%%= f.search_field :search, label: "Search", placeholder: "Search..." %>
159-
<%% end %>
160159

161-
<%%= f.form_group do %>
160+
161+
162162
<%%= f.file_field :file, label: "File Upload" %>
163-
<%% end %>
164163

165-
<%%= f.form_group do %>
164+
165+
166166
<%%= f.range_field :volume, label: "Volume", min: 0, max: 100, value: 25 %>
167-
<%% end %>
167+
168168
<%% end %>
169169
<% end %>
170170
<%= render_snippet active_tab: :erb %>
@@ -205,13 +205,13 @@
205205
{ prompt: "Choose a country" },
206206
{ label: "Country" } %>
207207

208-
<%%= f.form_group do %>
208+
209209
<%%= f.text_area :message,
210210
label: "Message",
211211
placeholder: "Enter your message here...",
212212
rows: 5,
213213
help: "Maximum 500 characters" %>
214-
<%% end %>
214+
215215
<%% end %>
216216
<% end %>
217217
<%= render_snippet active_tab: :erb %>
@@ -347,9 +347,9 @@
347347
<!-- Switch toggles -->
348348
<%%= f.switch_field :dark_mode, label: "Enable dark mode" %>
349349

350-
<%%= f.form_group do %>
350+
351351
<%%= f.switch_field :auto_save, label: "Auto-save drafts" %>
352-
<%% end %>
352+
353353
<%% end %>
354354
<% end %>
355355
<%= render_snippet active_tab: :erb %>
@@ -386,9 +386,9 @@
386386
<%%= form_with model: @user, builder: Railsui::FormBuilder do |f| %>
387387
<%%= f.text_field :name, label: "Full Name" %>
388388

389-
<%%= f.form_group do %>
389+
390390
<%%= f.email_field :email, label: "Email Address" %>
391-
<%% end %>
391+
392392

393393
<%%= f.submit "Submit" %>
394394
<%% end %>
@@ -495,22 +495,22 @@
495495
wrapper: { class: "max-w-md" } %>
496496

497497
<!-- Skip label (i.e. don't display labels) -->
498-
<%%= f.form_group do %>
498+
499499
<%%= f.email_field :email,
500500
label: false,
501501
placeholder: "Enter your email",
502502
help: "Skip displaying label",
503503
skip_label: true %>
504-
<%% end %>
504+
505505

506506
<!-- Custom label options and input class -->
507-
<%%= f.form_group do %>
507+
508508
<%%= f.text_field :website,
509509
label: "Website",
510510
placeholder: "https://",
511511
label_options: { class: "form-label font-medium text-sm text-blue-600" },
512512
class: "form-input text-lg" %>
513-
<%% end %>
513+
514514
<%% end %>
515515
<% end %>
516516
<%= render_snippet active_tab: :erb %>

0 commit comments

Comments
 (0)