tramway 0.4.6 → 0.4.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +21 -1
- data/lib/tramway/base_form.rb +4 -0
- data/lib/tramway/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69d16412bfd7e8fcb33e3ddc27a8be714350cd7fe97a56451a47dced641546c7
|
4
|
+
data.tar.gz: 60d32317870e16a0e4aadc618a8a2170939fda2e7d06d7202935a40d1ee945f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a31a8b31885e7bf84aed5896850e7e98930fcf7bdf5dcc74eaf006172b7d6f305458f79c659618ac8da82d2050d18b818a891ac93ef1ff4bf01a5fe20cf8dabc
|
7
|
+
data.tar.gz: f21ecdb0d87afb50afae3c3b5a01d953f3736778fad9f0e47e2b16e8a1d35b33002ef4bf96b1624af20e2aaa619d90c7195b1ed225bad68279e211dbf795f6f7
|
data/README.md
CHANGED
@@ -18,6 +18,12 @@ gem "tramway"
|
|
18
18
|
gem "view_component"
|
19
19
|
```
|
20
20
|
|
21
|
+
OR
|
22
|
+
|
23
|
+
```shell
|
24
|
+
bundle add tramway view_component
|
25
|
+
```
|
26
|
+
|
21
27
|
## Usage
|
22
28
|
|
23
29
|
### Tramway Entities
|
@@ -322,7 +328,21 @@ class UserForm < Tramway::BaseForm
|
|
322
328
|
end
|
323
329
|
```
|
324
330
|
|
325
|
-
|
331
|
+
### Assign values
|
332
|
+
|
333
|
+
Tramway Form provides `assign` method that allows to assign values without saving
|
334
|
+
|
335
|
+
```ruby
|
336
|
+
class UsersController < ApplicationController
|
337
|
+
def update
|
338
|
+
@user = tramway_form User.new
|
339
|
+
@user.assign params[:user] # assigns values to the form object
|
340
|
+
@user.reload # restores previous values
|
341
|
+
end
|
342
|
+
end
|
343
|
+
```
|
344
|
+
|
345
|
+
### Update and Destroy
|
326
346
|
|
327
347
|
Read [behave_as_ar](https://github.com/Purple-Magic/tramway#behave_as_ar) section
|
328
348
|
|
data/lib/tramway/base_form.rb
CHANGED
data/lib/tramway/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tramway
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kalashnikovisme
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-07-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: dry-struct
|