README.md in tramway-0.4.3 vs README.md in tramway-0.4.4
- old
+ new
@@ -6,11 +6,11 @@
* [Tramway Entities](https://github.com/Purple-Magic/tramway#tramway-entities)
* [Tramway Decorators](https://github.com/Purple-Magic/tramway#tramway-decorators)
* [Tramway Form](https://github.com/Purple-Magic/tramway#tramway-form)
* [Tramway Navbar](https://github.com/Purple-Magic/tramway#tramway-navbar)
* [Tailwind-styled forms](https://github.com/Purple-Magic/tramway#tailwind-styled-forms)
- * [Tailwind-styled pagination](https://github.com/Purple-Magic/tramway#tailwind-styled-pagination)
+ * [Tailwind-styled pagination](https://github.com/Purple-Magic/tramway?tab=readme-ov-file#tailwind-styled-pagination-for-kaminari)
## Installation
Add this line to your application's Gemfile:
```ruby
@@ -123,10 +123,14 @@
```ruby
user = nil
UserDecorator.decorate user # => nil
```
+#### Update and Destroy
+
+Read [behave_as_ar](https://github.com/Purple-Magic/tramway#behave_as_ar) section
+
### Tramway Form
Tramway provides **convenient** form objects for Rails applications. List properties you want to change and the rules in Form classes. No controllers overloading.
*app/forms/user_form.rb
@@ -301,10 +305,14 @@
object.last_name = value.split(' ').last
end
end
```
+#### Update and Destroy
+
+Read [behave_as_ar](https://github.com/Purple-Magic/tramway#behave_as_ar) section
+
### Tramway Navbar
Tramway provides DSL for rendering Tailwind Navgiation bar.
```ruby
@@ -418,9 +426,13 @@
```haml
= paginate @users # it will render tailwind-styled pagination buttons by default
```
Pagination buttons looks like [this](https://play.tailwindcss.com/mqgDS5l9oY)
+
+### `behave_as_ar`
+
+**Tramway Decorator** and **Tramway Form** support `behave_as_ar` method. It allows to use `update` and `destroy` methods with decorated and form objects.
## Contributing
Install [lefthook](https://github.com/evilmartians/lefthook)