render_turbo_stream 1.3.1 → 1.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6e7cebbb4a51d0abb9d5f658b860c08c700ecea7faa041c7615adb867aa48983
4
- data.tar.gz: 25dcad69063801eed435438e5e93c6d7ffec9436da21345326a15b8822b03706
3
+ metadata.gz: b32041ebda04bf085c6199ba1e29e5274f9fa86c2a210c7ee6a32e9937721037
4
+ data.tar.gz: 32b05f420b1ce6c6733615f2be5059a265ee58bf2c55269363aa14e0d0f41c2e
5
5
  SHA512:
6
- metadata.gz: 1bb0a1a79bf629a021f446c9960e84292d195ac2ad28990e0b585d90e4e4e5098b0ecd06f852e6ce6f3fbdcaef95455f3e4e7049e3addb5607e6f5296a2ad287
7
- data.tar.gz: a523ef0d125b9af140d71cf66cfa45c05082bb58cc0ba30038b11d3bd33db4dd549203e700c8bdba1c8c1ecdc282fb98144d068a98901578530b09cfd0b366bf
6
+ metadata.gz: bfdd0158be7131cdd05e7527b7005b40d90621d9a95919955bdeb58dd0e75cb41d5e7799ad43626f05d690a814600f267b9476e25e3a5b7400be6a8d36a481dd
7
+ data.tar.gz: f04d228c519cd617ff53e7292144673eaaf610e879f87fc4a95a6902e487bffab7a84bd0bbff3068a94f138b2c32a17ea91872e45f117c133f1f846029cf3ede
data/README.md CHANGED
@@ -34,11 +34,13 @@ RSpec.configure do |config|
34
34
  end
35
35
  ```
36
36
 
37
- **Redirection**
37
+ **Redirection and more**
38
38
 
39
39
  For redirection to work, you must follow the installation steps
40
40
  from [turbo_power](https://github.com/marcoroth/turbo_power).
41
41
 
42
+ **Flash**
43
+
42
44
  Required Configurations for Flash Partial
43
45
 
44
46
  ```ruby
@@ -51,8 +53,7 @@ The corresponding partials for flashes could look [like this](https://gitlab.com
51
53
 
52
54
  ## Usage
53
55
 
54
- `turbo_stream_save` is a special method for streamlining `update` or `create` functions for `turbo_stream`, which might
55
- look like this:
56
+ `turbo_stream_save` is a special method for streamlining `update' or `create' functions with `turbo_stream'. A controller action for update might look like this:
56
57
 
57
58
  ```ruby
58
59
 
@@ -64,7 +65,7 @@ def update
64
65
  end
65
66
  ```
66
67
 
67
- This will set a status, generate a flash message and perform `render_turbo_stream`, which could result in something like this:
68
+ This will set a status, generate a flash message and perform `render_turbo_stream`, which would, if update succeeded result in something like this:
68
69
 
69
70
  ```ruby
70
71
  render_turbo_stream(
@@ -84,8 +85,6 @@ render_turbo_stream(
84
85
 
85
86
  The `stream_partial` method is nothing else than a singular of `render_turbo_stream`.
86
87
 
87
- **locals**: The hash for locals goes through a `symbolize_keys`, so you need to use locals in used partials like this: `locals[:message]`.
88
-
89
88
  ```ruby
90
89
  stream_partial(
91
90
  id,
@@ -95,17 +94,19 @@ stream_partial(
95
94
  )
96
95
  ```
97
96
 
97
+ **locals**: The hash for locals goes through a `symbolize_keys`, so you need to use locals in used partials like this: `locals[:message]`.
98
+
98
99
  ## More options
99
100
 
100
- `render_turbo_stream` interprets a hash as a partial to be sent by `turbo_stream` and an array as a command to be sent. This should allow you to perform most actions from, for example, [turbo_power](https://github.com/marcoroth/turbo_power). An example of rendering a partial and adding a css class to an html element would look like this:
101
+ `render_turbo_stream` interprets a hash as a partial to be sent by `turbo_stream` and an array as a command to be sent. This allows you to perform most actions from e.g. [turbo_power](https://github.com/marcoroth/turbo_power). An example of adding a css class to an html element and updating the browser history would look like this:
101
102
 
102
103
  ```ruby
103
104
  render_turbo_stream(
104
105
  [
105
- {
106
- id: 'form',
107
- partial: 'form'
108
- },
106
+ [
107
+ :push_state,
108
+ '/articles/my-special-path'
109
+ ],
109
110
  [
110
111
  :add_css_class,
111
112
  '#colored-element',
@@ -1,3 +1,3 @@
1
1
  module RenderTurboStream
2
- VERSION = "1.3.1"
2
+ VERSION = "1.3.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: render_turbo_stream
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - christian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-22 00:00:00.000000000 Z
11
+ date: 2023-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -24,11 +24,11 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 7.0.4.3
27
- description: Writing views like (create|update).turbo_stream.haml annoyed me. This
28
- gem handles translated flash messages, sets status, and renders partials through
29
- turbo-stream. You can control it directly from the controller. With the turbo_power
30
- gem you can also handle predefined actions like redirects and much more. Includes
31
- helpers for enabling request testing.
27
+ description: Writing templates like (create|update).turbo_stream.haml annoyed me.
28
+ This gem handles translated flash messages, sets status, and renders partials through
29
+ turbo-stream directly from the controller. Together with the turbo_power gem or
30
+ custom turbo-stream actions, you can also handle predefined javascript actions like
31
+ redirects. Includes helpers for enabling request testing.
32
32
  email:
33
33
  - christian@sedlmair.ch
34
34
  executables: []
@@ -72,6 +72,5 @@ requirements: []
72
72
  rubygems_version: 3.4.12
73
73
  signing_key:
74
74
  specification_version: 4
75
- summary: Render partials by turbo-stream directly from the controller. Test helpers
76
- included.
75
+ summary: Render partials, run javascript like redirect by controller. With test helpers.
77
76
  test_files: []