Skip to content

Commit 2e6483f

Browse files
committed
docs: Adds information about supported Ruby and Rails version [skip ci]
Also, small text tweaks here and there.
1 parent f1b948c commit 2e6483f

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,29 @@ This gem is essentially a clone if the [clsx](https://github.com/lukeed/clsx) np
66
It provides a simple way to conditionally apply classes to HTML elements in Rails views.
77
It is especially useful when you have a lot of conditional classes and you want to keep your views clean and readable.
88

9+
## Supported Ruby and Rails versions
10+
11+
Ruby 3.1+ and Rails 7.0+ are supported.
12+
913
## Installation
1014

1115
Install the gem and add to the application's Gemfile by executing:
1216

13-
$ bundle add clsx-rails
17+
```bash
18+
bundle add clsx-rails
19+
```
1420

15-
If bundler is not being used to manage dependencies, install the gem by executing:
21+
Or add it manually to the Gemfile:
1622

17-
$ gem install clsx-rails
23+
```ruby
24+
gem 'clsx-rails', '~> 1.0'
25+
```
1826

1927
## Usage
2028

21-
The `clsx` method can be used in views to conditionally apply classes to HTML elements.
29+
The `clsx` helper method can be used in views to conditionally apply classes to HTML elements.
2230
You can also use a slightly more conise `cn` alias.
23-
It accepts a variety of arguments and returns a string of classes.
31+
It accepts a variety of arguments and returns a string of unique classes.
2432

2533
```ruby
2634
# Strings (variadic)

0 commit comments

Comments
 (0)