tailwindcss-rails 4.0.0 → 4.2.0
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.
- checksums.yaml +4 -4
- data/README.md +47 -10
- data/lib/generators/tailwindcss/authentication/templates/app/views/passwords/edit.html.erb +3 -3
- data/lib/generators/tailwindcss/authentication/templates/app/views/passwords/new.html.erb +2 -2
- data/lib/generators/tailwindcss/authentication/templates/app/views/sessions/new.html.erb +1 -1
- data/lib/generators/tailwindcss/scaffold/templates/_form.html.erb.tt +8 -8
- data/lib/generators/tailwindcss/scaffold/templates/edit.html.erb.tt +2 -2
- data/lib/generators/tailwindcss/scaffold/templates/index.html.erb.tt +11 -5
- data/lib/generators/tailwindcss/scaffold/templates/new.html.erb.tt +1 -1
- data/lib/generators/tailwindcss/scaffold/templates/partial.html.erb.tt +7 -5
- data/lib/generators/tailwindcss/scaffold/templates/show.html.erb.tt +4 -4
- data/lib/tailwindcss/commands.rb +1 -0
- data/lib/tailwindcss/version.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7aa2cf1b89bf6e2c36561fc1837d68c909ec546c59389269f8ebb2b02636dd58
|
4
|
+
data.tar.gz: 9e31269f4da5d5b6af95c83ed8548f61a634d8f8e54aa821472196d4b10fe5ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 294d50739faaece4341840862dfb30d10b6f554f274430ac2f826556c8254e88a22872a4ca8bbcfb7dde7ccdc41b82980f4e3ff8431873ffa47994f36643e6a4
|
7
|
+
data.tar.gz: a8eed8a46d161699a7d3b70c5d9682df9605c0ea9cbc0ff98e82756847528f3e4c294c335c7b382c7c155ca9e3eaab7a1638eee3b6a59c424f463fe828fd16b8
|
data/README.md
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
- [Upgrading your application from Tailwind v3 to v4](#upgrading-your-application-from-tailwind-v3-to-v4)
|
13
13
|
* [You don't _have_ to upgrade](#you-dont-_have_-to-upgrade)
|
14
14
|
* [Upgrade steps](#upgrade-steps)
|
15
|
-
* [Troubleshooting](#troubleshooting)
|
15
|
+
* [Troubleshooting a v4 upgrade](#troubleshooting-a-v4-upgrade)
|
16
16
|
* [Updating CSS class names for v4](#updating-css-class-names-for-v4)
|
17
17
|
- [Developing with Tailwindcss](#developing-with-tailwindcss)
|
18
18
|
* [Configuration and commands](#configuration-and-commands)
|
@@ -20,9 +20,10 @@
|
|
20
20
|
* [Building for testing](#building-for-testing)
|
21
21
|
* [Building unminified assets](#building-unminified-assets)
|
22
22
|
* [Live rebuild](#live-rebuild)
|
23
|
+
* [Using Tailwind plugins](#using-tailwind-plugins)
|
23
24
|
* [Using with PostCSS](#using-with-postcss)
|
24
25
|
* [Custom inputs or outputs](#custom-inputs-or-outputs)
|
25
|
-
- [Troubleshooting](#troubleshooting
|
26
|
+
- [Troubleshooting](#troubleshooting)
|
26
27
|
* [Lost keystrokes or hanging when using terminal-based debugging tools (e.g. IRB, Pry, `ruby/debug`...etc.) with the Puma plugin](#lost-keystrokes-or-hanging-when-using-terminal-based-debugging-tools-eg-irb-pry-rubydebugetc-with-the-puma-plugin)
|
27
28
|
* [Running in a docker container exits prematurely](#running-in-a-docker-container-exits-prematurely)
|
28
29
|
* [Conflict with sassc-rails](#conflict-with-sassc-rails)
|
@@ -104,6 +105,13 @@ First, update to `tailwindcss-rails` v4.0.0 or higher. This will also ensure you
|
|
104
105
|
gem "tailwindcss-rails", "~> 4.0" # which transitively pins tailwindcss-ruby to v4
|
105
106
|
```
|
106
107
|
|
108
|
+
**Update** path references to any existing css files imported in `app/assets/stylesheets/application.tailwind.css` so that they will resolve when the file is moved to `app/assets/tailwind/application.css`.
|
109
|
+
|
110
|
+
```diff
|
111
|
+
-@import "pagy.css";
|
112
|
+
+@import "../stylesheets/pagy.css";
|
113
|
+
```
|
114
|
+
|
107
115
|
If you want to migrate CSS class names for v4 (this is an optional step!), jump to [Updating CSS class names for v4](#updating-css-class-names-for-v4) before continuing.
|
108
116
|
|
109
117
|
Then, run `bin/rails tailwindcss:upgrade`. Among other things, this will try to run the official Tailwind upgrade utility. It requires `npx` in order to run, but it's a one-time operation and is *highly recommended* for a successful upgrade.
|
@@ -164,7 +172,7 @@ Done in 56ms
|
|
164
172
|
If this doesn't succeed, it's likely that you've customized your Tailwind configuration and you'll need to do some work to make sure your application upgrades. Please read the [official upgrade guide](https://tailwindcss.com/docs/upgrade-guide) and try following the additional steps in [Updating CSS class names for v4](#updating-css-class-names-for-v4).
|
165
173
|
|
166
174
|
|
167
|
-
### Troubleshooting
|
175
|
+
### Troubleshooting a v4 upgrade
|
168
176
|
|
169
177
|
You may want to check out [TailwindCSS v4 - upgrade experience report · rails/tailwindcss-rails · Discussion #450](https://github.com/rails/tailwindcss-rails/discussions/450) if you're having trouble upgrading.
|
170
178
|
|
@@ -188,7 +196,7 @@ With some additional manual work the upstream upgrade tool will update your appl
|
|
188
196
|
/node_modules
|
189
197
|
```
|
190
198
|
|
191
|
-
**Create** a `package.json` in the root of the project:
|
199
|
+
**Create** or **update** a `package.json` in the root of the project:
|
192
200
|
|
193
201
|
```jsonc
|
194
202
|
{
|
@@ -225,14 +233,15 @@ With some additional manual work the upstream upgrade tool will update your appl
|
|
225
233
|
|
226
234
|
Then, once you've run that successfully, clean up:
|
227
235
|
|
228
|
-
- **
|
236
|
+
- **Review** `package.json` to remove unnecessary modules.
|
237
|
+
- This includes modules added for the period of upgrade.
|
238
|
+
- If you don't need any modules besides `tailwindcss` itself, **delete** `package.json`, `node_modules/` and `package-lock.json` (or `yarn.lock`), plus remove `/node_modules` from `.gitignore`.
|
229
239
|
- **Go** to your CSS file and remove the following line (if present):
|
230
240
|
```css
|
231
241
|
@plugin '@tailwindcss/container-queries';
|
232
242
|
```
|
233
243
|
- **Revert** the changes to `config/tailwind.config.js` so that paths are once again relative to the application root.
|
234
244
|
|
235
|
-
|
236
245
|
## Developing with Tailwindcss
|
237
246
|
|
238
247
|
### Configuration and commands
|
@@ -267,7 +276,6 @@ This gem also makes available a Puma plugin to manage a live rebuild process whe
|
|
267
276
|
|
268
277
|
This gem also generates a `Procfile.dev` file which will run both the rails server and a live rebuild process (see "Live Rebuild" section below).
|
269
278
|
|
270
|
-
|
271
279
|
### Building for production
|
272
280
|
|
273
281
|
The `tailwindcss:build` is automatically attached to `assets:precompile`, so before the asset pipeline digests the files, the Tailwind output will be generated.
|
@@ -280,8 +288,12 @@ The `tailwindcss:build` task is automatically attached to the `test:prepare` Rak
|
|
280
288
|
|
281
289
|
### Building unminified assets
|
282
290
|
|
283
|
-
If you want unminified assets, you can
|
291
|
+
If you want unminified assets, you can:
|
284
292
|
|
293
|
+
- pass a `debug` argument to the rake task, i.e. `rails tailwindcss:build[debug]` or `rails tailwindcss:watch[debug]`.
|
294
|
+
- set an environment variable named `TAILWINDCSS_DEBUG` with a non-blank value
|
295
|
+
|
296
|
+
If both values are set, the environment variable will take precedence over the rake task argument.
|
285
297
|
|
286
298
|
### Live rebuild
|
287
299
|
|
@@ -325,6 +337,32 @@ If you are running `rails tailwindcss:watch` in a docker container without a tty
|
|
325
337
|
Running `bin/dev` invokes Foreman to start both the Tailwind watch process and the rails server in development mode based on your `Procfile.dev` file.
|
326
338
|
|
327
339
|
|
340
|
+
### Using Tailwind plugins
|
341
|
+
|
342
|
+
If you want to use Tailwind plugins, they can be installed using `package.json`.
|
343
|
+
|
344
|
+
Using Yarn:
|
345
|
+
|
346
|
+
``` sh
|
347
|
+
[ ! -f package.json ] && yarn init
|
348
|
+
yarn add daisyui # example
|
349
|
+
```
|
350
|
+
|
351
|
+
Using npm:
|
352
|
+
|
353
|
+
``` sh
|
354
|
+
npm init
|
355
|
+
npm add daisyui # example
|
356
|
+
```
|
357
|
+
|
358
|
+
Than use `@plugin` annotation in `app/assets/tailwind/application.css`:
|
359
|
+
|
360
|
+
``` css
|
361
|
+
@import "tailwindcss";
|
362
|
+
@plugin "daisyui";
|
363
|
+
```
|
364
|
+
|
365
|
+
|
328
366
|
### Using with PostCSS
|
329
367
|
|
330
368
|
If you want to use PostCSS as a preprocessor, create a custom `postcss.config.js` in your project root directory, and that file will be loaded by Tailwind automatically.
|
@@ -391,7 +429,7 @@ See https://github.com/flavorjones/tailwindcss-ruby for help.
|
|
391
429
|
|
392
430
|
### Using asset-pipeline assets
|
393
431
|
|
394
|
-
In Rails, you want to use [assets from the asset pipeline to get fingerprinting](https://guides.rubyonrails.org/asset_pipeline.html#
|
432
|
+
In Rails, you want to use [assets from the asset pipeline to get fingerprinting](https://guides.rubyonrails.org/asset_pipeline.html#fingerprinting-versioning-with-digest-based-urls). However, Tailwind isn't aware of those assets.
|
395
433
|
|
396
434
|
To use assets from the pipeline, use `url(image.svg)`. [Since Sprockets v3.3.0](https://github.com/rails/sprockets-rails/pull/476) `url(image.svg)` is rewritten to `/path/to/assets/image-7801e7538c6f1cc57aa75a5876ab0cac.svg` so output CSS will have the correct path to those assets.
|
397
435
|
|
@@ -416,4 +454,3 @@ The inline version also works:
|
|
416
454
|
## License
|
417
455
|
|
418
456
|
Tailwind for Rails is released under the [MIT License](https://opensource.org/licenses/MIT).
|
419
|
-
The Inter font is released under the [SIL Open Font License, Version 1.1](https://github.com/rsms/inter/blob/master/LICENSE.txt).
|
@@ -7,15 +7,15 @@
|
|
7
7
|
|
8
8
|
<%%= form_with url: password_path(params[:token]), method: :put, class: "contents" do |form| %>
|
9
9
|
<div class="my-5">
|
10
|
-
<%%= form.password_field :password, required: true, autocomplete: "new-password", placeholder: "Enter new password", maxlength: 72, class: "block shadow-sm rounded-md border border-gray-400 outline-
|
10
|
+
<%%= form.password_field :password, required: true, autocomplete: "new-password", placeholder: "Enter new password", maxlength: 72, class: "block shadow-sm rounded-md border border-gray-400 focus:outline-solid focus:outline-blue-600 px-3 py-2 mt-2 w-full" %>
|
11
11
|
</div>
|
12
12
|
|
13
13
|
<div class="my-5">
|
14
|
-
<%%= form.password_field :password_confirmation, required: true, autocomplete: "new-password", placeholder: "Repeat new password", maxlength: 72, class: "block shadow-sm rounded-md border border-gray-400 outline-
|
14
|
+
<%%= form.password_field :password_confirmation, required: true, autocomplete: "new-password", placeholder: "Repeat new password", maxlength: 72, class: "block shadow-sm rounded-md border border-gray-400 focus:outline-solid focus:outline-blue-600 px-3 py-2 mt-2 w-full" %>
|
15
15
|
</div>
|
16
16
|
|
17
17
|
<div class="inline">
|
18
|
-
<%%= form.submit "Save", class: "rounded-md px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white inline-block font-medium cursor-pointer" %>
|
18
|
+
<%%= form.submit "Save", class: "w-full sm:w-auto text-center rounded-md px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white inline-block font-medium cursor-pointer" %>
|
19
19
|
</div>
|
20
20
|
<%% end %>
|
21
21
|
</div>
|
@@ -7,11 +7,11 @@
|
|
7
7
|
|
8
8
|
<%%= form_with url: passwords_path, class: "contents" do |form| %>
|
9
9
|
<div class="my-5">
|
10
|
-
<%%= form.email_field :email_address, required: true, autofocus: true, autocomplete: "username", placeholder: "Enter your email address", value: params[:email_address], class: "block shadow-sm rounded-md border border-gray-400 outline-
|
10
|
+
<%%= form.email_field :email_address, required: true, autofocus: true, autocomplete: "username", placeholder: "Enter your email address", value: params[:email_address], class: "block shadow-sm rounded-md border border-gray-400 focus:outline-solid focus:outline-blue-600 px-3 py-2 mt-2 w-full" %>
|
11
11
|
</div>
|
12
12
|
|
13
13
|
<div class="inline">
|
14
|
-
<%%= form.submit "Email reset instructions", class: "rounded-lg px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white inline-block font-medium cursor-pointer" %>
|
14
|
+
<%%= form.submit "Email reset instructions", class: "w-full sm:w-auto text-center rounded-lg px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white inline-block font-medium cursor-pointer" %>
|
15
15
|
</div>
|
16
16
|
<%% end %>
|
17
17
|
</div>
|
@@ -20,7 +20,7 @@
|
|
20
20
|
|
21
21
|
<div class="col-span-6 sm:flex sm:items-center sm:gap-4">
|
22
22
|
<div class="inline">
|
23
|
-
<%%= form.submit "Sign in", class: "rounded-md px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white inline-block font-medium cursor-pointer" %>
|
23
|
+
<%%= form.submit "Sign in", class: "w-full sm:w-auto text-center rounded-md px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white inline-block font-medium cursor-pointer" %>
|
24
24
|
</div>
|
25
25
|
|
26
26
|
<div class="mt-4 text-sm text-gray-500 sm:mt-0">
|
@@ -12,32 +12,32 @@
|
|
12
12
|
<%% end %>
|
13
13
|
|
14
14
|
<% attributes.each do |attribute| -%>
|
15
|
-
<div class="my-5">
|
15
|
+
<div class="my-5<%= " flex items-center gap-2" if attribute.field_type == :checkbox || attribute.field_type == :check_box %>">
|
16
16
|
<% if attribute.password_digest? -%>
|
17
17
|
<%%= form.label :password %>
|
18
|
-
<%%= form.password_field :password, class: ["block shadow-sm rounded-md border
|
18
|
+
<%%= form.password_field :password, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": <%= model_resource_name %>.errors[:password].none?, "border-red-400 focus:outline-red-600": <%= model_resource_name %>.errors[:password].any?}] %>
|
19
19
|
</div>
|
20
20
|
|
21
21
|
<div class="my-5">
|
22
22
|
<%%= form.label :password_confirmation %>
|
23
|
-
<%%= form.password_field :password_confirmation, class: ["block shadow-sm rounded-md border
|
23
|
+
<%%= form.password_field :password_confirmation, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": <%= model_resource_name %>.errors[:password_confirmation].none?, "border-red-400 focus:outline-red-600": <%= model_resource_name %>.errors[:password_confirmation].any?}] %>
|
24
24
|
<% elsif attribute.attachments? -%>
|
25
25
|
<%%= form.label :<%= attribute.column_name %> %>
|
26
|
-
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, multiple: true, class: ["block shadow-sm rounded-md border
|
26
|
+
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, multiple: true, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": <%= model_resource_name %>.errors[:password].none?, "border-red-400 focus:outline-red-600": <%= model_resource_name %>.errors[:password].any?}] %>
|
27
27
|
<% else -%>
|
28
28
|
<%%= form.label :<%= attribute.column_name %> %>
|
29
29
|
<% if attribute.field_type == :textarea || attribute.field_type == :text_area -%>
|
30
|
-
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, rows: 4, class: ["block shadow-sm rounded-md border
|
30
|
+
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, rows: 4, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": <%= model_resource_name %>.errors[:<%= attribute.column_name %>].none?, "border-red-400 focus:outline-red-600": <%= model_resource_name %>.errors[:<%= attribute.column_name %>].any?}] %>
|
31
31
|
<% elsif attribute.field_type == :checkbox || attribute.field_type == :check_box -%>
|
32
|
-
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: ["block shadow-sm rounded-md border
|
32
|
+
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: ["block shadow-sm rounded-md border order-first h-5 w-5", {"border-gray-400 focus:outline-blue-600": <%= model_resource_name %>.errors[:<%= attribute.column_name %>].none?, "border-red-400 focus:outline-red-600": <%= model_resource_name %>.errors[:<%= attribute.column_name %>].any?}] %>
|
33
33
|
<% else -%>
|
34
|
-
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: ["block shadow-sm rounded-md border
|
34
|
+
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": <%= model_resource_name %>.errors[:<%= attribute.column_name %>].none?, "border-red-400 focus:outline-red-600": <%= model_resource_name %>.errors[:<%= attribute.column_name %>].any?}] %>
|
35
35
|
<% end -%>
|
36
36
|
<% end -%>
|
37
37
|
</div>
|
38
38
|
|
39
39
|
<% end -%>
|
40
40
|
<div class="inline">
|
41
|
-
<%%= form.submit class: "rounded-md px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white inline-block font-medium cursor-pointer" %>
|
41
|
+
<%%= form.submit class: "w-full sm:w-auto rounded-md px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white inline-block font-medium cursor-pointer" %>
|
42
42
|
</div>
|
43
43
|
<%% end %>
|
@@ -5,6 +5,6 @@
|
|
5
5
|
|
6
6
|
<%%= render "form", <%= singular_table_name %>: @<%= singular_table_name %> %>
|
7
7
|
|
8
|
-
<%%= link_to "Show this <%= human_name.downcase %>", <%= model_resource_name(prefix: "@") %>, class: "ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
|
9
|
-
<%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper(type: :path) %>, class: "ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
|
8
|
+
<%%= link_to "Show this <%= human_name.downcase %>", <%= model_resource_name(prefix: "@") %>, class: "w-full sm:w-auto text-center mt-2 sm:mt-0 sm:ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
|
9
|
+
<%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper(type: :path) %>, class: "w-full sm:w-auto text-center mt-2 sm:mt-0 sm:ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
|
10
10
|
</div>
|
@@ -10,13 +10,19 @@
|
|
10
10
|
<%%= link_to "New <%= human_name.downcase %>", new_<%= singular_route_name %>_path, class: "rounded-md px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white block font-medium" %>
|
11
11
|
</div>
|
12
12
|
|
13
|
-
<div id="<%= plural_table_name %>" class="min-w-full">
|
13
|
+
<div id="<%= plural_table_name %>" class="min-w-full divide-y divide-gray-200 space-y-5">
|
14
14
|
<%% if @<%= plural_table_name %>.any? %>
|
15
15
|
<%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %>
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
<div class="flex flex-col sm:flex-row justify-between items-center pb-5 sm:pb-0">
|
17
|
+
<%%= render <%= singular_table_name %> %>
|
18
|
+
<div class="w-full sm:w-auto flex flex-col sm:flex-row space-x-2 space-y-2">
|
19
|
+
<%%= link_to "Show", <%= model_resource_name(singular_table_name) %>, class: "w-full sm:w-auto text-center rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
|
20
|
+
<%%= link_to "Edit", <%= edit_helper(singular_table_name, type: :path) %>, class: "w-full sm:w-auto text-center rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
|
21
|
+
<div class="sm:inline-block">
|
22
|
+
<%%= button_to "Destroy", <%= model_resource_name %>, method: :delete, class: "w-full sm:w-auto rounded-md px-3.5 py-2.5 text-white bg-red-600 hover:bg-red-500 font-medium cursor-pointer", data: { turbo_confirm: "Are you sure?" } %>
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
</div>
|
20
26
|
<%% end %>
|
21
27
|
<%% else %>
|
22
28
|
<p class="text-center my-10">No <%= human_name.downcase.pluralize %> found.</p>
|
@@ -5,5 +5,5 @@
|
|
5
5
|
|
6
6
|
<%%= render "form", <%= singular_table_name %>: @<%= singular_table_name %> %>
|
7
7
|
|
8
|
-
<%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper(type: :path) %>, class: "ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
|
8
|
+
<%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper(type: :path) %>, class: "w-full sm:w-auto text-center mt-2 sm:mt-0 sm:ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
|
9
9
|
</div>
|
@@ -1,16 +1,18 @@
|
|
1
|
-
<div id="<%%= dom_id <%= singular_name %> %>">
|
1
|
+
<div id="<%%= dom_id <%= singular_name %> %>" class="w-full sm:w-auto my-5 space-y-5">
|
2
2
|
<% attributes.reject(&:password_digest?).each do |attribute| -%>
|
3
|
-
<
|
3
|
+
<div>
|
4
4
|
<strong class="block font-medium mb-1"><%= attribute.human_name %>:</strong>
|
5
5
|
<% if attribute.attachment? -%>
|
6
|
-
<%%= link_to <%= singular_name %>.<%= attribute.column_name %>.filename, <%= singular_name %>.<%= attribute.column_name
|
6
|
+
<%%= link_to <%= singular_name %>.<%= attribute.column_name %>.filename, <%= singular_name %>.<%= attribute.column_name %>, class: "text-gray-700 underline hover:no-underline" if <%= singular_name %>.<%= attribute.column_name %>.attached? %>
|
7
7
|
<% elsif attribute.attachments? -%>
|
8
8
|
<%% <%= singular_name %>.<%= attribute.column_name %>.each do |<%= attribute.singular_name %>| %>
|
9
|
-
<div><%%= link_to <%= attribute.singular_name %>.filename, <%= attribute.singular_name
|
9
|
+
<div><%%= link_to <%= attribute.singular_name %>.filename, <%= attribute.singular_name %>, class: "text-gray-700 underline hover:no-underline" %></div>
|
10
10
|
<%% end %>
|
11
|
+
<% elsif attribute.type == :boolean -%>
|
12
|
+
<%%= <%= singular_name %>.<%= attribute.column_name %>? ? "Yes" : "No" %>
|
11
13
|
<% else -%>
|
12
14
|
<%%= <%= singular_name %>.<%= attribute.column_name %> %>
|
13
15
|
<% end -%>
|
14
|
-
</
|
16
|
+
</div>
|
15
17
|
<% end -%>
|
16
18
|
</div>
|
@@ -9,9 +9,9 @@
|
|
9
9
|
|
10
10
|
<%%= render @<%= singular_table_name %> %>
|
11
11
|
|
12
|
-
<%%= link_to "Edit this <%= human_name.downcase %>", <%= edit_helper(type: :path) %>, class: "
|
13
|
-
<%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper %>_path, class: "ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
|
14
|
-
<div class="inline-block ml-2">
|
15
|
-
<%%= button_to "Destroy this <%= human_name.downcase %>", <%= model_resource_name(prefix: "@") %>, method: :delete, class: "
|
12
|
+
<%%= link_to "Edit this <%= human_name.downcase %>", <%= edit_helper(type: :path) %>, class: "w-full sm:w-auto text-center rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
|
13
|
+
<%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper %>_path, class: "w-full sm:w-auto text-center mt-2 sm:mt-0 sm:ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
|
14
|
+
<div class="sm:inline-block mt-2 sm:mt-0 sm:ml-2">
|
15
|
+
<%%= button_to "Destroy this <%= human_name.downcase %>", <%= model_resource_name(prefix: "@") %>, method: :delete, class: "w-full rounded-md px-3.5 py-2.5 text-white bg-red-600 hover:bg-red-500 font-medium cursor-pointer", data: { turbo_confirm: "Are you sure?" } %>
|
16
16
|
</div>
|
17
17
|
</div>
|
data/lib/tailwindcss/commands.rb
CHANGED
data/lib/tailwindcss/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tailwindcss-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date: 2025-02
|
10
|
+
date: 2025-03-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: railties
|
@@ -38,7 +37,6 @@ dependencies:
|
|
38
37
|
- - "~>"
|
39
38
|
- !ruby/object:Gem::Version
|
40
39
|
version: '4.0'
|
41
|
-
description:
|
42
40
|
email: david@loudthinking.com
|
43
41
|
executables: []
|
44
42
|
extensions: []
|
@@ -111,8 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
109
|
- !ruby/object:Gem::Version
|
112
110
|
version: 3.2.0
|
113
111
|
requirements: []
|
114
|
-
rubygems_version: 3.
|
115
|
-
signing_key:
|
112
|
+
rubygems_version: 3.6.2
|
116
113
|
specification_version: 4
|
117
114
|
summary: Integrate Tailwind CSS with the asset pipeline in Rails.
|
118
115
|
test_files: []
|