railsui 3.3.4 → 3.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -4
  3. data/app/views/railsui/systems/helpers/railsui_head.html.erb +1 -1
  4. data/app/views/railsui/themes/corgie/forms/_form_builder.html.erb +36 -36
  5. data/app/views/railsui/themes/hound/forms/_form_builder.html.erb +36 -36
  6. data/app/views/railsui/themes/shepherd/content/typography/_fonts.html.erb +1 -1
  7. data/app/views/railsui/themes/shepherd/forms/_form_builder.html.erb +36 -36
  8. data/lib/generators/railsui/install/templates/themes/corgie/views/layouts/rui/railsui.html.erb +0 -8
  9. data/lib/generators/railsui/install/templates/themes/corgie/views/layouts/rui/railsui_admin.html.erb +0 -8
  10. data/lib/generators/railsui/install/templates/themes/corgie/views/layouts/rui/railsui_auth.html.erb +0 -8
  11. data/lib/generators/railsui/install/templates/themes/corgie/views/rui/shared/_meta.html.erb +32 -76
  12. data/lib/generators/railsui/install/templates/themes/hound/views/layouts/rui/railsui.html.erb +0 -7
  13. data/lib/generators/railsui/install/templates/themes/hound/views/layouts/rui/railsui_admin.html.erb +0 -7
  14. data/lib/generators/railsui/install/templates/themes/hound/views/rui/shared/_meta.html.erb +32 -76
  15. data/lib/generators/railsui/install/templates/themes/shepherd/views/layouts/rui/railsui.html.erb +0 -7
  16. data/lib/generators/railsui/install/templates/themes/shepherd/views/layouts/rui/railsui_admin.html.erb +0 -7
  17. data/lib/generators/railsui/install/templates/themes/shepherd/views/rui/shared/_meta.html.erb +32 -76
  18. data/lib/railsui/engine.rb +1 -0
  19. data/lib/railsui/meta_tags_helper.rb +47 -0
  20. data/lib/railsui/version.rb +1 -1
  21. data/lib/railsui.rb +1 -1
  22. metadata +3 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dadbd162b710fe37b5f3a8c1d12538e23290b1652c2f90652d35669b718941f2
4
- data.tar.gz: '09ddaced31a1058061739cfc164b6c29f2ffde9c1ef6d91cc96c2ba474d8a28a'
3
+ metadata.gz: bdf00da977780c593f58ec180d35c73f1b1a73932fc044981a59ac9655853db7
4
+ data.tar.gz: 5b94966fef66bd29254ddd19632d1a76c4043b6fea3bdbc0da1b529e9da29cca
5
5
  SHA512:
6
- metadata.gz: f88b5bd9420d7c99f3f8cc176dc8d1ad4d4c9b48677d9ce67dc14f6ad9cd9bb513053c36c2128226a5be5650e8c918db0eb9510692f66eaffdbd07f5ad2e0ad7
7
- data.tar.gz: ab700bc730c0df7de0d8e27dbcd0999e38b3c07eb9d4a7ad7329343970480723b44fbe6fb333c6c40573938cf33ef3315387069138c9244a5e18efcfc1a32f65
6
+ metadata.gz: 4d05cab8f6eb2fed5a5b263c4e4b0a90275c9d4992f6bb7a0fb8944aac9bd378858c2ef61c5a6ab094a0a7d1f00f94062a734bf4901f9c7dc8cc967d146b5345
7
+ data.tar.gz: a6fc75702f896fb64f59a4c025cf09f8bf78fbc5fa16e49fec3457c2925982bebeb080a47f3cd6c3bc860a392d8888dfb0ed4713d3e8521270b54789f4977411
data/Gemfile.lock CHANGED
@@ -1,8 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- railsui (3.3.4)
5
- meta-tags
4
+ railsui (3.4.1)
6
5
  psych
7
6
  rails (>= 7.0)
8
7
  railsui_icon
@@ -114,8 +113,6 @@ GEM
114
113
  net-pop
115
114
  net-smtp
116
115
  marcel (1.0.4)
117
- meta-tags (2.22.0)
118
- actionpack (>= 6.0.0, < 8.1)
119
116
  mini_mime (1.1.5)
120
117
  minitest (5.25.1)
121
118
  net-imap (0.4.16)
@@ -26,7 +26,7 @@
26
26
  <% content_for :erb, flush: true do %>
27
27
  <!-- app/views/code/layouts/rui/railsui.html.erb -->
28
28
 
29
- <!-- Meta tags via meta-tags gem. Customize yours at app/views/rui/shared/_meta.html.erb -->
29
+ <!-- Meta tags via railsui_meta_tags helper. Customize yours at app/views/rui/shared/_meta.html.erb -->
30
30
  <%%= render "rui/shared/meta" %>
31
31
 
32
32
  <!-- Custom fonts for each theme -->
@@ -30,13 +30,13 @@
30
30
  <%%= form_with model: @user, builder: Railsui::FormBuilder do |f| %>
31
31
  <%%= f.text_field :name, label: "Full Name", placeholder: "John Doe" %>
32
32
 
33
- <%%= f.form_group do %>
33
+
34
34
  <%%= f.email_field :email, label: "Email Address", placeholder: "john@example.com", help: "We'll never share your email with anyone else." %>
35
- <%% end %>
36
35
 
37
- <%%= f.form_group do %>
36
+
37
+
38
38
  <%%= f.text_area :bio, label: "Biography", placeholder: "Tell us about yourself...", rows: 4 %>
39
- <%% end %>
39
+
40
40
 
41
41
  <%%= f.submit "Save Profile" %>
42
42
  <%% end %>
@@ -120,51 +120,51 @@
120
120
  <!-- Text inputs -->
121
121
  <%%= f.text_field :text, label: "Text Field" %>
122
122
 
123
- <%%= f.form_group do %>
123
+
124
124
  <%%= f.email_field :email, label: "Email Field", placeholder: "john.doe@example.com" %>
125
- <%% end %>
126
125
 
127
- <%%= f.form_group do %>
126
+
127
+
128
128
  <%%= f.password_field :password, label: "Password Field" %>
129
- <%% end %>
130
129
 
131
- <%%= f.form_group do %>
130
+
131
+
132
132
  <%%= f.number_field :number, label: "Number Field", min: 0, max: 100 %>
133
- <%% end %>
134
133
 
135
- <%%= f.form_group do %>
134
+
135
+
136
136
  <%%= f.telephone_field :phone, label: "Phone Number" %>
137
- <%% end %>
138
137
 
139
- <%%= f.form_group do %>
138
+
139
+
140
140
  <%%= f.url_field :website, label: "Website URL" %>
141
- <%% end %>
141
+
142
142
 
143
143
  <!-- Date/Time inputs -->
144
- <%%= f.form_group do %>
144
+
145
145
  <%%= f.date_field :date, label: "Date" %>
146
- <%% end %>
147
146
 
148
- <%%= f.form_group do %>
147
+
148
+
149
149
  <%%= f.time_field :time, label: "Time" %>
150
- <%% end %>
150
+
151
151
 
152
152
  <!-- Special inputs -->
153
- <%%= f.form_group do %>
153
+
154
154
  <%%= f.color_field :color, label: "Color Picker" %>
155
- <%% end %>
156
155
 
157
- <%%= f.form_group do %>
156
+
157
+
158
158
  <%%= f.search_field :search, label: "Search", placeholder: "Search..." %>
159
- <%% end %>
160
159
 
161
- <%%= f.form_group do %>
160
+
161
+
162
162
  <%%= f.file_field :file, label: "File Upload" %>
163
- <%% end %>
164
163
 
165
- <%%= f.form_group do %>
164
+
165
+
166
166
  <%%= f.range_field :volume, label: "Volume", min: 0, max: 100, value: 25 %>
167
- <%% end %>
167
+
168
168
  <%% end %>
169
169
  <% end %>
170
170
  <%= render_snippet active_tab: :erb %>
@@ -205,13 +205,13 @@
205
205
  { prompt: "Choose a country" },
206
206
  { label: "Country" } %>
207
207
 
208
- <%%= f.form_group do %>
208
+
209
209
  <%%= f.text_area :message,
210
210
  label: "Message",
211
211
  placeholder: "Enter your message here...",
212
212
  rows: 5,
213
213
  help: "Maximum 500 characters" %>
214
- <%% end %>
214
+
215
215
  <%% end %>
216
216
  <% end %>
217
217
  <%= render_snippet active_tab: :erb %>
@@ -347,9 +347,9 @@
347
347
  <!-- Switch toggles -->
348
348
  <%%= f.switch_field :dark_mode, label: "Enable dark mode" %>
349
349
 
350
- <%%= f.form_group do %>
350
+
351
351
  <%%= f.switch_field :auto_save, label: "Auto-save drafts" %>
352
- <%% end %>
352
+
353
353
  <%% end %>
354
354
  <% end %>
355
355
  <%= render_snippet active_tab: :erb %>
@@ -386,9 +386,9 @@
386
386
  <%%= form_with model: @user, builder: Railsui::FormBuilder do |f| %>
387
387
  <%%= f.text_field :name, label: "Full Name" %>
388
388
 
389
- <%%= f.form_group do %>
389
+
390
390
  <%%= f.email_field :email, label: "Email Address" %>
391
- <%% end %>
391
+
392
392
 
393
393
  <%%= f.submit "Submit" %>
394
394
  <%% end %>
@@ -495,22 +495,22 @@
495
495
  wrapper: { class: "max-w-md" } %>
496
496
 
497
497
  <!-- Skip label (i.e. don't display labels) -->
498
- <%%= f.form_group do %>
498
+
499
499
  <%%= f.email_field :email,
500
500
  label: false,
501
501
  placeholder: "Enter your email",
502
502
  help: "Skip displaying label",
503
503
  skip_label: true %>
504
- <%% end %>
504
+
505
505
 
506
506
  <!-- Custom label options and input class -->
507
- <%%= f.form_group do %>
507
+
508
508
  <%%= f.text_field :website,
509
509
  label: "Website",
510
510
  placeholder: "https://",
511
511
  label_options: { class: "form-label font-medium text-sm text-blue-600" },
512
512
  class: "form-input text-lg" %>
513
- <%% end %>
513
+
514
514
  <%% end %>
515
515
  <% end %>
516
516
  <%= render_snippet active_tab: :erb %>
@@ -30,13 +30,13 @@
30
30
  <%%= form_with model: @user, builder: Railsui::FormBuilder do |f| %>
31
31
  <%%= f.text_field :name, label: "Full Name", placeholder: "John Doe" %>
32
32
 
33
- <%%= f.form_group do %>
33
+
34
34
  <%%= f.email_field :email, label: "Email Address", placeholder: "john@example.com", help: "We'll never share your email with anyone else." %>
35
- <%% end %>
36
35
 
37
- <%%= f.form_group do %>
36
+
37
+
38
38
  <%%= f.text_area :bio, label: "Biography", placeholder: "Tell us about yourself...", rows: 4 %>
39
- <%% end %>
39
+
40
40
 
41
41
  <%%= f.submit "Save Profile" %>
42
42
  <%% end %>
@@ -120,51 +120,51 @@
120
120
  <!-- Text inputs -->
121
121
  <%%= f.text_field :text, label: "Text Field" %>
122
122
 
123
- <%%= f.form_group do %>
123
+
124
124
  <%%= f.email_field :email, label: "Email Field", placeholder: "john.doe@example.com" %>
125
- <%% end %>
126
125
 
127
- <%%= f.form_group do %>
126
+
127
+
128
128
  <%%= f.password_field :password, label: "Password Field" %>
129
- <%% end %>
130
129
 
131
- <%%= f.form_group do %>
130
+
131
+
132
132
  <%%= f.number_field :number, label: "Number Field", min: 0, max: 100 %>
133
- <%% end %>
134
133
 
135
- <%%= f.form_group do %>
134
+
135
+
136
136
  <%%= f.telephone_field :phone, label: "Phone Number" %>
137
- <%% end %>
138
137
 
139
- <%%= f.form_group do %>
138
+
139
+
140
140
  <%%= f.url_field :website, label: "Website URL" %>
141
- <%% end %>
141
+
142
142
 
143
143
  <!-- Date/Time inputs -->
144
- <%%= f.form_group do %>
144
+
145
145
  <%%= f.date_field :date, label: "Date" %>
146
- <%% end %>
147
146
 
148
- <%%= f.form_group do %>
147
+
148
+
149
149
  <%%= f.time_field :time, label: "Time" %>
150
- <%% end %>
150
+
151
151
 
152
152
  <!-- Special inputs -->
153
- <%%= f.form_group do %>
153
+
154
154
  <%%= f.color_field :color, label: "Color Picker" %>
155
- <%% end %>
156
155
 
157
- <%%= f.form_group do %>
156
+
157
+
158
158
  <%%= f.search_field :search, label: "Search", placeholder: "Search..." %>
159
- <%% end %>
160
159
 
161
- <%%= f.form_group do %>
160
+
161
+
162
162
  <%%= f.file_field :file, label: "File Upload" %>
163
- <%% end %>
164
163
 
165
- <%%= f.form_group do %>
164
+
165
+
166
166
  <%%= f.range_field :volume, label: "Volume", min: 0, max: 100, value: 25 %>
167
- <%% end %>
167
+
168
168
  <%% end %>
169
169
  <% end %>
170
170
  <%= render_snippet active_tab: :erb %>
@@ -205,13 +205,13 @@
205
205
  { prompt: "Choose a country" },
206
206
  { label: "Country" } %>
207
207
 
208
- <%%= f.form_group do %>
208
+
209
209
  <%%= f.text_area :message,
210
210
  label: "Message",
211
211
  placeholder: "Enter your message here...",
212
212
  rows: 5,
213
213
  help: "Maximum 500 characters" %>
214
- <%% end %>
214
+
215
215
  <%% end %>
216
216
  <% end %>
217
217
  <%= render_snippet active_tab: :erb %>
@@ -347,9 +347,9 @@
347
347
  <!-- Switch toggles -->
348
348
  <%%= f.switch_field :dark_mode, label: "Enable dark mode" %>
349
349
 
350
- <%%= f.form_group do %>
350
+
351
351
  <%%= f.switch_field :auto_save, label: "Auto-save drafts" %>
352
- <%% end %>
352
+
353
353
  <%% end %>
354
354
  <% end %>
355
355
  <%= render_snippet active_tab: :erb %>
@@ -386,9 +386,9 @@
386
386
  <%%= form_with model: @user, builder: Railsui::FormBuilder do |f| %>
387
387
  <%%= f.text_field :name, label: "Full Name" %>
388
388
 
389
- <%%= f.form_group do %>
389
+
390
390
  <%%= f.email_field :email, label: "Email Address" %>
391
- <%% end %>
391
+
392
392
 
393
393
  <%%= f.submit "Submit" %>
394
394
  <%% end %>
@@ -495,22 +495,22 @@
495
495
  wrapper: { class: "max-w-md" } %>
496
496
 
497
497
  <!-- Skip label (i.e. don't display labels) -->
498
- <%%= f.form_group do %>
498
+
499
499
  <%%= f.email_field :email,
500
500
  label: false,
501
501
  placeholder: "Enter your email",
502
502
  help: "Skip displaying label",
503
503
  skip_label: true %>
504
- <%% end %>
504
+
505
505
 
506
506
  <!-- Custom label options and input class -->
507
- <%%= f.form_group do %>
507
+
508
508
  <%%= f.text_field :website,
509
509
  label: "Website",
510
510
  placeholder: "https://",
511
511
  label_options: { class: "form-label font-medium text-sm text-blue-600" },
512
512
  class: "form-input text-lg" %>
513
- <%% end %>
513
+
514
514
  <%% end %>
515
515
  <% end %>
516
516
  <%= render_snippet active_tab: :erb %>
@@ -24,6 +24,6 @@
24
24
  </div>
25
25
 
26
26
  <div class="prose-sm prose-neutral dark:prose-invert">
27
- <p><strong>Tip</strong>: To change fonts, you'll need to reference new them in both <code>app/views/rui/shared/_fonts.html.erb</code> and <code>app/assets/stylesheets/railsui/theme.css</code>.</p>
27
+ <p><strong>Tip</strong>: To change fonts, you'll need to reference them in both <code>app/views/rui/shared/_fonts.html.erb</code> and <code>app/assets/stylesheets/railsui/theme.css</code>.</p>
28
28
  </div>
29
29
  </div>
@@ -30,13 +30,13 @@
30
30
  <%%= form_with model: @user, builder: Railsui::FormBuilder do |f| %>
31
31
  <%%= f.text_field :name, label: "Full Name", placeholder: "John Doe" %>
32
32
 
33
- <%%= f.form_group do %>
33
+
34
34
  <%%= f.email_field :email, label: "Email Address", placeholder: "john@example.com", help: "We'll never share your email with anyone else." %>
35
- <%% end %>
36
35
 
37
- <%%= f.form_group do %>
36
+
37
+
38
38
  <%%= f.text_area :bio, label: "Biography", placeholder: "Tell us about yourself...", rows: 4 %>
39
- <%% end %>
39
+
40
40
 
41
41
  <%%= f.submit "Save Profile" %>
42
42
  <%% end %>
@@ -120,51 +120,51 @@
120
120
  <!-- Text inputs -->
121
121
  <%%= f.text_field :text, label: "Text Field" %>
122
122
 
123
- <%%= f.form_group do %>
123
+
124
124
  <%%= f.email_field :email, label: "Email Field", placeholder: "john.doe@example.com" %>
125
- <%% end %>
126
125
 
127
- <%%= f.form_group do %>
126
+
127
+
128
128
  <%%= f.password_field :password, label: "Password Field" %>
129
- <%% end %>
130
129
 
131
- <%%= f.form_group do %>
130
+
131
+
132
132
  <%%= f.number_field :number, label: "Number Field", min: 0, max: 100 %>
133
- <%% end %>
134
133
 
135
- <%%= f.form_group do %>
134
+
135
+
136
136
  <%%= f.telephone_field :phone, label: "Phone Number" %>
137
- <%% end %>
138
137
 
139
- <%%= f.form_group do %>
138
+
139
+
140
140
  <%%= f.url_field :website, label: "Website URL" %>
141
- <%% end %>
141
+
142
142
 
143
143
  <!-- Date/Time inputs -->
144
- <%%= f.form_group do %>
144
+
145
145
  <%%= f.date_field :date, label: "Date" %>
146
- <%% end %>
147
146
 
148
- <%%= f.form_group do %>
147
+
148
+
149
149
  <%%= f.time_field :time, label: "Time" %>
150
- <%% end %>
150
+
151
151
 
152
152
  <!-- Special inputs -->
153
- <%%= f.form_group do %>
153
+
154
154
  <%%= f.color_field :color, label: "Color Picker" %>
155
- <%% end %>
156
155
 
157
- <%%= f.form_group do %>
156
+
157
+
158
158
  <%%= f.search_field :search, label: "Search", placeholder: "Search..." %>
159
- <%% end %>
160
159
 
161
- <%%= f.form_group do %>
160
+
161
+
162
162
  <%%= f.file_field :file, label: "File Upload" %>
163
- <%% end %>
164
163
 
165
- <%%= f.form_group do %>
164
+
165
+
166
166
  <%%= f.range_field :volume, label: "Volume", min: 0, max: 100, value: 25 %>
167
- <%% end %>
167
+
168
168
  <%% end %>
169
169
  <% end %>
170
170
  <%= render_snippet active_tab: :erb %>
@@ -205,13 +205,13 @@
205
205
  { prompt: "Choose a country" },
206
206
  { label: "Country" } %>
207
207
 
208
- <%%= f.form_group do %>
208
+
209
209
  <%%= f.text_area :message,
210
210
  label: "Message",
211
211
  placeholder: "Enter your message here...",
212
212
  rows: 5,
213
213
  help: "Maximum 500 characters" %>
214
- <%% end %>
214
+
215
215
  <%% end %>
216
216
  <% end %>
217
217
  <%= render_snippet active_tab: :erb %>
@@ -347,9 +347,9 @@
347
347
  <!-- Switch toggles -->
348
348
  <%%= f.switch_field :dark_mode, label: "Enable dark mode" %>
349
349
 
350
- <%%= f.form_group do %>
350
+
351
351
  <%%= f.switch_field :auto_save, label: "Auto-save drafts" %>
352
- <%% end %>
352
+
353
353
  <%% end %>
354
354
  <% end %>
355
355
  <%= render_snippet active_tab: :erb %>
@@ -386,9 +386,9 @@
386
386
  <%%= form_with model: @user, builder: Railsui::FormBuilder do |f| %>
387
387
  <%%= f.text_field :name, label: "Full Name" %>
388
388
 
389
- <%%= f.form_group do %>
389
+
390
390
  <%%= f.email_field :email, label: "Email Address" %>
391
- <%% end %>
391
+
392
392
 
393
393
  <%%= f.submit "Submit" %>
394
394
  <%% end %>
@@ -495,22 +495,22 @@
495
495
  wrapper: { class: "max-w-md" } %>
496
496
 
497
497
  <!-- Skip label (i.e. don't display labels) -->
498
- <%%= f.form_group do %>
498
+
499
499
  <%%= f.email_field :email,
500
500
  label: false,
501
501
  placeholder: "Enter your email",
502
502
  help: "Skip displaying label",
503
503
  skip_label: true %>
504
- <%% end %>
504
+
505
505
 
506
506
  <!-- Custom label options and input class -->
507
- <%%= f.form_group do %>
507
+
508
508
  <%%= f.text_field :website,
509
509
  label: "Website",
510
510
  placeholder: "https://",
511
511
  label_options: { class: "form-label font-medium text-sm text-blue-600" },
512
512
  class: "form-input text-lg" %>
513
- <%% end %>
513
+
514
514
  <%% end %>
515
515
  <% end %>
516
516
  <%= render_snippet active_tab: :erb %>
@@ -1,14 +1,6 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
3
  <head>
4
- <title>
5
- <%= Railsui.config.application_name || "Rails UI" %>
6
- </title>
7
- <meta charset="UTF-8" />
8
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
9
- <meta name="apple-mobile-web-app-capable" content="yes">
10
- <meta name="mobile-web-app-capable" content="yes">
11
-
12
4
  <%= csrf_meta_tags %>
13
5
  <%= csp_meta_tag %>
14
6
 
@@ -1,14 +1,6 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
3
  <head>
4
- <title>
5
- <%= Railsui.config.application_name || "Rails UI" %>
6
- </title>
7
- <meta charset="UTF-8" />
8
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
9
- <meta name="apple-mobile-web-app-capable" content="yes">
10
- <meta name="mobile-web-app-capable" content="yes">
11
-
12
4
  <%= csrf_meta_tags %>
13
5
  <%= csp_meta_tag %>
14
6
 
@@ -1,14 +1,6 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
3
  <head>
4
- <title>
5
- <%= Railsui.config.application_name || "Rails UI" %>
6
- </title>
7
- <meta charset="UTF-8" />
8
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
9
- <meta name="apple-mobile-web-app-capable" content="yes">
10
- <meta name="mobile-web-app-capable" content="yes">
11
-
12
4
  <%= csrf_meta_tags %>
13
5
  <%= csp_meta_tag %>
14
6
 
@@ -1,90 +1,46 @@
1
1
  <%#
2
+ Meta tags for SEO and social sharing.
2
3
 
3
- Put a favicon.ico or favicon.svg (preferred) in your public/ folder and add favicon_link_tag "favicon.svg" to your layout inside the <head></head> tags.
4
+ This uses Rails UI's built-in railsui_meta_tags helper which outputs:
5
+ - Title tag
6
+ - Viewport meta tag
7
+ - Description meta tag
8
+ - Canonical URL
9
+ - Open Graph tags (title, type, url, image, description, site_name)
10
+ - Social card tags (card, title, description, image)
11
+ - Favicon links
4
12
 
5
- You may optionally reach for the meta_tags gem as I did below and do this all dynamically.
13
+ Basic Usage:
6
14
 
7
- Below are the recommended tags to include for best discoverability between apps and services. You don't need everything listed to see success but many apps now query open graph tags to find assets and content for link previews so it goes a long way (i.e., Slack, Twitter, Facebook).
15
+ railsui_meta_tags
8
16
 
9
- Generate icons:
10
- https://redketchup.io/favicon-generator (generate from an image)
17
+ Customizing per-page:
11
18
 
12
- Tip: Before generating icons, I typically start with a icon that is at least 512x512 in size. It can have a transparent background (.png, .svg). Keep it as simple as possible.
19
+ railsui_meta_tags(
20
+ title: "About Us",
21
+ description: "Learn more about our company."
22
+ )
13
23
 
14
- Free editor/vector tool:
15
- https://figma.com
24
+ All available options:
16
25
 
17
- Previewing:
18
- https://www.opengraph.xyz/
26
+ railsui_meta_tags(
27
+ site: "My App",
28
+ title: "Page Title",
29
+ description: "Page description",
30
+ image: "meta/opengraph.jpg",
31
+ card_image: "meta/card.jpg",
32
+ og_type: "website",
33
+ card_type: "summary"
34
+ )
19
35
 
20
-
21
- # Usage:
22
-
23
- Title:
24
- Change the title and description tags below to match your own site. The title displays alongside your site name in a given browser tab next to the favicon.
25
-
26
- Description:
27
- The description is a good place for one to two sentences describing a page OR what the site is all about. You can tweak this on a per-page basis inside your views or controllers. See the metatags gem documentation on tips for doing so: https://github.com/kpumuk/meta-tags#mirrored-values
36
+ Previewing: https://www.opengraph.xyz/
37
+ Generate icons: https://redketchup.io/favicon-generator
28
38
 
29
39
  Images:
30
- Swap your own images for placeholder ones inside the "assets/images/railsui/meta" folder Rails UI copied to your app (jpg, png).
40
+ Swap your own images for placeholder ones inside the "assets/images/railsui/meta" folder.
31
41
  %>
32
42
 
33
- <%= display_meta_tags(
34
- site: "#{Railsui.config.application_name.parameterize}.com", # <!-- change -->,
35
- reverse: true,
36
- viewport: "width=device-width, initial-scale=1",
43
+ <%= railsui_meta_tags(
37
44
  title: "CHANGE ME",
38
- canonical: request.original_url,
39
- og: {
40
- title: Railsui.config.application_name,
41
- type: "website",
42
- url: request.original_url,
43
- image: [{
44
- _: image_url("railsui/meta/opengraph.jpg"),
45
- width: 1200,
46
- height: 630
47
- }],
48
- site_name: "#{Railsui.config.application_name.parameterize}.com", # <!-- change -->
49
- description: "CHANGE ME",
50
- },
51
- twitter: {
52
- title: :title,
53
- description: :description,
54
- card: "summary",
55
- image: {
56
- _: image_url("railsui/meta/opengraph-mark.jpg"),
57
- width: 400,
58
- height: 400,
59
- }
60
- },
61
- author: Railsui.config.application_name,
62
- description: "CHANGE ME",
63
- icon: [
64
- {
65
- href: image_url("railsui/meta/favicon.svg"),
66
- sizes: 'any',
67
- type: "image/svg+xml"
68
- },
69
- {
70
- href: image_url("railsui/meta/favicon-16x16.png"),
71
- sizes: "16x16",
72
- type: "images/png"
73
- },
74
- {
75
- href: image_url("railsui/meta/android-chrome-192x192.png"),
76
- sizes: '192x192',
77
- type: "image/png"
78
- },
79
- {
80
- href: image_url("railsui/meta/android-chrome-512x512.png"),
81
- sizes: '512x512',
82
- type: "image/png"
83
- },
84
- {
85
- href: image_url("railsui/meta/apple-touch-icon.png"),
86
- sizes: '180x180',
87
- type: "image/png"
88
- }
89
- ])
90
- %>
45
+ description: "CHANGE ME"
46
+ ) %>
@@ -1,13 +1,6 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
3
  <head>
4
- <title>
5
- <%= Railsui.config.application_name || "Rails UI" %>
6
- </title>
7
- <meta charset="UTF-8" />
8
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
9
- <meta name="apple-mobile-web-app-capable" content="yes">
10
- <meta name="mobile-web-app-capable" content="yes">
11
4
  <%= csrf_meta_tags %>
12
5
  <%= csp_meta_tag %>
13
6
 
@@ -1,13 +1,6 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
3
  <head>
4
- <title>
5
- <%= Railsui.config.application_name || "Rails UI" %>
6
- </title>
7
- <meta charset="UTF-8" />
8
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
9
- <meta name="apple-mobile-web-app-capable" content="yes">
10
- <meta name="mobile-web-app-capable" content="yes">
11
4
  <%= csrf_meta_tags %>
12
5
  <%= csp_meta_tag %>
13
6
 
@@ -1,90 +1,46 @@
1
1
  <%#
2
+ Meta tags for SEO and social sharing.
2
3
 
3
- Put a favicon.ico or favicon.svg (preferred) in your public/ folder and add favicon_link_tag "favicon.svg" to your layout inside the <head></head> tags.
4
+ This uses Rails UI's built-in railsui_meta_tags helper which outputs:
5
+ - Title tag
6
+ - Viewport meta tag
7
+ - Description meta tag
8
+ - Canonical URL
9
+ - Open Graph tags (title, type, url, image, description, site_name)
10
+ - Social card tags (card, title, description, image)
11
+ - Favicon links
4
12
 
5
- You may optionally reach for the meta_tags gem as I did below and do this all dynamically.
13
+ Basic Usage:
6
14
 
7
- Below are the recommended tags to include for best discoverability between apps and services. You don't need everything listed to see success but many apps now query open graph tags to find assets and content for link previews so it goes a long way (i.e., Slack, Twitter, Facebook).
15
+ railsui_meta_tags
8
16
 
9
- Generate icons:
10
- https://redketchup.io/favicon-generator (generate from an image)
17
+ Customizing per-page:
11
18
 
12
- Tip: Before generating icons, I typically start with a icon that is at least 512x512 in size. It can have a transparent background (.png, .svg). Keep it as simple as possible.
19
+ railsui_meta_tags(
20
+ title: "About Us",
21
+ description: "Learn more about our company."
22
+ )
13
23
 
14
- Free editor/vector tool:
15
- https://figma.com
24
+ All available options:
16
25
 
17
- Previewing:
18
- https://www.opengraph.xyz/
26
+ railsui_meta_tags(
27
+ site: "My App",
28
+ title: "Page Title",
29
+ description: "Page description",
30
+ image: "meta/opengraph.jpg",
31
+ card_image: "meta/card.jpg",
32
+ og_type: "website",
33
+ card_type: "summary"
34
+ )
19
35
 
20
-
21
- # Usage:
22
-
23
- Title:
24
- Change the title and description tags below to match your own site. The title displays alongside your site name in a given browser tab next to the favicon.
25
-
26
- Description:
27
- The description is a good place for one to two sentences describing a page OR what the site is all about. You can tweak this on a per-page basis inside your views or controllers. See the metatags gem documentation on tips for doing so: https://github.com/kpumuk/meta-tags#mirrored-values
36
+ Previewing: https://www.opengraph.xyz/
37
+ Generate icons: https://redketchup.io/favicon-generator
28
38
 
29
39
  Images:
30
- Swap your own images for placeholder ones inside the "assets/images/railsui/meta" folder Rails UI copied to your app (jpg, png).
40
+ Swap your own images for placeholder ones inside the "assets/images/railsui/meta" folder.
31
41
  %>
32
42
 
33
- <%= display_meta_tags(
34
- site: "#{Railsui.config.application_name.parameterize}.com", # <!-- change -->,
35
- reverse: true,
36
- viewport: "width=device-width, initial-scale=1",
43
+ <%= railsui_meta_tags(
37
44
  title: "CHANGE ME",
38
- canonical: request.original_url,
39
- og: {
40
- title: Railsui.config.application_name,
41
- type: "website",
42
- url: request.original_url,
43
- image: [{
44
- _: image_url("railsui/meta/opengraph.jpg"),
45
- width: 1200,
46
- height: 630
47
- }],
48
- site_name: "#{Railsui.config.application_name.parameterize}.com", # <!-- change -->
49
- description: "CHANGE ME",
50
- },
51
- twitter: {
52
- title: :title,
53
- description: :description,
54
- card: "summary",
55
- image: {
56
- _: image_url("railsui/meta/opengraph-mark.jpg"),
57
- width: 400,
58
- height: 400,
59
- }
60
- },
61
- author: Railsui.config.application_name,
62
- description: "CHANGE ME",
63
- icon: [
64
- {
65
- href: image_url("railsui/meta/favicon.svg"),
66
- sizes: 'any',
67
- type: "image/svg+xml"
68
- },
69
- {
70
- href: image_url("railsui/meta/favicon-16x16.png"),
71
- sizes: "16x16",
72
- type: "images/png"
73
- },
74
- {
75
- href: image_url("railsui/meta/android-chrome-192x192.png"),
76
- sizes: '192x192',
77
- type: "image/png"
78
- },
79
- {
80
- href: image_url("railsui/meta/android-chrome-512x512.png"),
81
- sizes: '512x512',
82
- type: "image/png"
83
- },
84
- {
85
- href: image_url("railsui/meta/apple-touch-icon.png"),
86
- sizes: '180x180',
87
- type: "image/png"
88
- }
89
- ])
90
- %>
45
+ description: "CHANGE ME"
46
+ ) %>
@@ -1,13 +1,6 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
3
  <head>
4
- <title>
5
- <%= Railsui.config.application_name || "Rails UI" %>
6
- </title>
7
- <meta charset="UTF-8" />
8
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
9
- <meta name="apple-mobile-web-app-capable" content="yes">
10
- <meta name="mobile-web-app-capable" content="yes">
11
4
  <%= csrf_meta_tags %>
12
5
  <%= csp_meta_tag %>
13
6
 
@@ -1,13 +1,6 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
3
  <head>
4
- <title>
5
- <%= Railsui.config.application_name || "Rails UI" %>
6
- </title>
7
- <meta charset="UTF-8" />
8
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
9
- <meta name="apple-mobile-web-app-capable" content="yes">
10
- <meta name="mobile-web-app-capable" content="yes">
11
4
  <%= csrf_meta_tags %>
12
5
  <%= csp_meta_tag %>
13
6
 
@@ -1,90 +1,46 @@
1
1
  <%#
2
+ Meta tags for SEO and social sharing.
2
3
 
3
- Put a favicon.ico or favicon.svg (preferred) in your public/ folder and add favicon_link_tag "favicon.svg" to your layout inside the <head></head> tags.
4
+ This uses Rails UI's built-in railsui_meta_tags helper which outputs:
5
+ - Title tag
6
+ - Viewport meta tag
7
+ - Description meta tag
8
+ - Canonical URL
9
+ - Open Graph tags (title, type, url, image, description, site_name)
10
+ - Social card tags (card, title, description, image)
11
+ - Favicon links
4
12
 
5
- You may optionally reach for the meta_tags gem as I did below and do this all dynamically.
13
+ Basic Usage:
6
14
 
7
- Below are the recommended tags to include for best discoverability between apps and services. You don't need everything listed to see success but many apps now query open graph tags to find assets and content for link previews so it goes a long way (i.e., Slack, Twitter, Facebook).
15
+ railsui_meta_tags
8
16
 
9
- Generate icons:
10
- https://redketchup.io/favicon-generator (generate from an image)
17
+ Customizing per-page:
11
18
 
12
- Tip: Before generating icons, I typically start with a icon that is atleast 512x512 in size. It can have a transparent background (.png, .svg). Keep it as simple as possible.
19
+ railsui_meta_tags(
20
+ title: "About Us",
21
+ description: "Learn more about our company."
22
+ )
13
23
 
14
- Free editor/vector tool:
15
- https://figma.com
24
+ All available options:
16
25
 
17
- Previewing:
18
- https://www.opengraph.xyz/
26
+ railsui_meta_tags(
27
+ site: "My App",
28
+ title: "Page Title",
29
+ description: "Page description",
30
+ image: "meta/opengraph.jpg",
31
+ card_image: "meta/card.jpg",
32
+ og_type: "website",
33
+ card_type: "summary"
34
+ )
19
35
 
20
-
21
- # Usage:
22
-
23
- Title:
24
- Change the title and description tags below to match your own site. The title displays alongside your site name in a given browser tab next to the favicon.
25
-
26
- Description:
27
- The description is a good place for one to two sentences describing a page OR what the site is all about. You can tweak this on a per-page basis inside your views or controllers. See the metatags gem documentation on tips for doing so: https://github.com/kpumuk/meta-tags#mirrored-values
36
+ Previewing: https://www.opengraph.xyz/
37
+ Generate icons: https://redketchup.io/favicon-generator
28
38
 
29
39
  Images:
30
- Swap your own images for placeholder ones inside the "assets/images/meta" folder Rails UI copied to your app (jpg, png).
40
+ Swap your own images for placeholder ones inside the "assets/images/railsui/meta" folder.
31
41
  %>
32
42
 
33
- <%= display_meta_tags(
34
- site: "#{Railsui.config.application_name.parameterize}.com", # <!-- change -->,
35
- reverse: true,
36
- viewport: "width=device-width, initial-scale=1",
43
+ <%= railsui_meta_tags(
37
44
  title: "CHANGE ME",
38
- canonical: request.original_url,
39
- og: {
40
- title: Railsui.config.application_name,
41
- type: "website",
42
- url: request.original_url,
43
- image: [{
44
- _: image_url("railsui/meta/opengraph.jpg"),
45
- width: 1200,
46
- height: 630
47
- }],
48
- site_name: "#{Railsui.config.application_name.parameterize}.com", # <!-- change -->
49
- description: "CHANGE ME",
50
- },
51
- twitter: {
52
- title: :title,
53
- description: :description,
54
- card: "summary",
55
- image: {
56
- _: image_url("railsui/meta/opengraph-mark.jpg"),
57
- width: 400,
58
- height: 400,
59
- }
60
- },
61
- author: Railsui.config.application_name,
62
- description: "CHANGE ME",
63
- icon: [
64
- {
65
- href: image_url("railsui/meta/favicon.svg"),
66
- sizes: 'any',
67
- type: "image/svg+xml"
68
- },
69
- {
70
- href: image_url("railsui/meta/favicon-16x16.png"),
71
- sizes: "16x16",
72
- type: "images/png"
73
- },
74
- {
75
- href: image_url("railsui/meta/android-chrome-192x192.png"),
76
- sizes: '192x192',
77
- type: "image/png"
78
- },
79
- {
80
- href: image_url("railsui/meta/android-chrome-512x512.png"),
81
- sizes: '512x512',
82
- type: "image/png"
83
- },
84
- {
85
- href: image_url("railsui/meta/apple-touch-icon.png"),
86
- sizes: '180x180',
87
- type: "image/png"
88
- }
89
- ])
90
- %>
45
+ description: "CHANGE ME"
46
+ ) %>
@@ -11,6 +11,7 @@ module Railsui
11
11
  initializer "railsui.theme_helper" do
12
12
  ActiveSupport.on_load :action_controller do
13
13
  helper Railsui::ThemeHelper
14
+ helper Railsui::MetaTagsHelper
14
15
  end
15
16
  end
16
17
 
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Railsui
4
+ module MetaTagsHelper
5
+ def railsui_meta_tags(options = {})
6
+ defaults = {
7
+ site: Railsui.config.application_name,
8
+ title: nil,
9
+ description: nil,
10
+ image: "railsui/meta/opengraph.jpg",
11
+ card_image: "railsui/meta/opengraph-mark.jpg",
12
+ og_type: "website",
13
+ card_type: "summary"
14
+ }
15
+ opts = defaults.merge(options)
16
+
17
+ full_title = [opts[:title], opts[:site]].compact.join(" | ")
18
+ og_image_url = opts[:image]&.start_with?("http") ? opts[:image] : image_url(opts[:image])
19
+ card_image_url = opts[:card_image]&.start_with?("http") ? opts[:card_image] : image_url(opts[:card_image])
20
+
21
+ safe_join([
22
+ tag.meta(charset: "UTF-8"),
23
+ tag.title(full_title),
24
+ tag.meta(name: "viewport", content: "width=device-width, initial-scale=1"),
25
+ tag.meta(name: "apple-mobile-web-app-capable", content: "yes"),
26
+ tag.meta(name: "mobile-web-app-capable", content: "yes"),
27
+ tag.meta(name: "description", content: opts[:description]),
28
+ tag.link(rel: "canonical", href: request.original_url),
29
+ # Open Graph
30
+ tag.meta(property: "og:title", content: full_title),
31
+ tag.meta(property: "og:type", content: opts[:og_type]),
32
+ tag.meta(property: "og:url", content: request.original_url),
33
+ tag.meta(property: "og:image", content: og_image_url),
34
+ tag.meta(property: "og:description", content: opts[:description]),
35
+ tag.meta(property: "og:site_name", content: opts[:site]),
36
+ # Social Card (X/Twitter)
37
+ tag.meta(name: "twitter:card", content: opts[:card_type]),
38
+ tag.meta(name: "twitter:title", content: full_title),
39
+ tag.meta(name: "twitter:description", content: opts[:description]),
40
+ tag.meta(name: "twitter:image", content: card_image_url),
41
+ # Favicons
42
+ tag.link(rel: "icon", href: image_url("railsui/meta/favicon.svg"), type: "image/svg+xml"),
43
+ tag.link(rel: "apple-touch-icon", href: image_url("railsui/meta/apple-touch-icon.png"))
44
+ ].compact, "\n")
45
+ end
46
+ end
47
+ end
@@ -1,3 +1,3 @@
1
1
  module Railsui
2
- VERSION = "3.3.4"
2
+ VERSION = "3.4.1"
3
3
  end
data/lib/railsui.rb CHANGED
@@ -3,7 +3,6 @@
3
3
  require "railsui/version"
4
4
  require "railsui/engine"
5
5
  require "railsui_icon"
6
- require "meta-tags"
7
6
  require "tailwindcss-rails"
8
7
 
9
8
  module Railsui
@@ -11,6 +10,7 @@ module Railsui
11
10
  autoload :Pages, "railsui/pages"
12
11
  autoload :Themes, "railsui/themes"
13
12
  autoload :ThemeHelper, "railsui/theme_helper"
13
+ autoload :MetaTagsHelper, "railsui/meta_tags_helper"
14
14
  autoload :ThemeSetup, "railsui/theme_setup"
15
15
  autoload :FormBuilder, "railsui/form_builder"
16
16
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railsui
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.4
4
+ version: 3.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Leverenz
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-01-19 00:00:00.000000000 Z
10
+ date: 2026-02-13 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rails
@@ -37,20 +37,6 @@ dependencies:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
39
  version: '0'
40
- - !ruby/object:Gem::Dependency
41
- name: meta-tags
42
- requirement: !ruby/object:Gem::Requirement
43
- requirements:
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- version: '0'
47
- type: :runtime
48
- prerelease: false
49
- version_requirements: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - ">="
52
- - !ruby/object:Gem::Version
53
- version: '0'
54
40
  - !ruby/object:Gem::Dependency
55
41
  name: railsui_icon
56
42
  requirement: !ruby/object:Gem::Requirement
@@ -1783,6 +1769,7 @@ files:
1783
1769
  - lib/railsui/configuration.rb
1784
1770
  - lib/railsui/engine.rb
1785
1771
  - lib/railsui/form_builder.rb
1772
+ - lib/railsui/meta_tags_helper.rb
1786
1773
  - lib/railsui/pages.rb
1787
1774
  - lib/railsui/theme_helper.rb
1788
1775
  - lib/railsui/theme_setup.rb