render_turbo_stream 4.0.0 → 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -9
- data/lib/render_turbo_stream/check_template.rb +1 -1
- data/lib/render_turbo_stream/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: caa22ab0fcd032899bc52bb3e92bc576e26bea6bb187acbe0e00b3162e78c054
|
4
|
+
data.tar.gz: 7314b1bb2199fb89fc83df166c5a02749c82b291ab0210ababbf1afffedfb72a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a99d072daf0c5cfb3955790ba17aa63ddbabdd7332ced553f06abb988ad5150329f1a787da4d03b58d34b088398d6ec64b3774fde34b429f46837e13ac11418a
|
7
|
+
data.tar.gz: 6d16c9a72c015961e6597847d664806871f550088b0a54f8a4e4f0c0df186844de4ca1838159fcfe8243f76de0c8ca53fa0513aa688c7e091db5d648491b4d8b
|
data/README.md
CHANGED
@@ -2,24 +2,22 @@
|
|
2
2
|
|
3
3
|
2021 DHH annouced a great milestone in web development with [Rails 7, "Fulfilling a Vision"](https://rubyonrails.org/2021/12/15/Rails-7-fulfilling-a-vision).
|
4
4
|
|
5
|
-
|
5
|
+
To say it up front: If you want to have all the benefits of Turbo without disturbing the handy default Rails workflow, you must use WebSockets sometimes, which are well integrated in Turbo, see [README Turbo::StreamsChannel](https://gitlab.com/sedl/renderturbostream/-/blob/main/README-channels.md). But the starting point is here. And I recommend that you download my [Quick-and-dirty test project](https://gitlab.com/sedl/renderturbostream_railsapp), set it up, see all the tests succeed, and then read through this README.
|
6
6
|
|
7
|
-
Defining templates like `(create|update).turbo_stream.haml`
|
7
|
+
Defining templates like `(create|update).turbo_stream.haml` is a heavy mix of logic and view. This gem separates logic and view so that `*.turbo_stream.*` templates are no longer necessary and the logic can stay on the ruby side.
|
8
8
|
|
9
|
-
|
9
|
+
For `:replace` actions, responses must be wrapped inside a `turbo_frame_tag` with a matching `target_id`. The gem will regex the content and wrap it by a `turbo_frame_tag` if necessary but not present. This way the matching `target_id` is only defined in one place. This check only happens on the first call after restarting the application in production and on every call if precompile assets is set to true in configs.
|
10
10
|
|
11
|
-
|
11
|
+
There are many different ways to handle **redirects** since turbo. The gem brings this into a workflow.
|
12
12
|
|
13
|
-
Execute [turbo_power](https://github.com/marcoroth/turbo_power) commands such as adding a css class to an html element,
|
13
|
+
Execute [turbo_power](https://github.com/marcoroth/turbo_power) commands such as adding a css class to an html element, can be sent directly from the controller.
|
14
14
|
|
15
|
-
|
15
|
+
Has a testing strategy.
|
16
16
|
|
17
17
|
An overview of how we design a rails-7 application with turbo
|
18
18
|
is [published on dev.to](https://dev.to/chmich/rails-7-vite-wrapping-up-1pia).
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
April 2023 first released this gem is in a very early state. I am happy if others contribute for increase the quality of this new kind of working with rails 7.
|
20
|
+
I am happy if it can help.
|
23
21
|
|
24
22
|
**Chris**
|
25
23
|
|
@@ -13,7 +13,7 @@ module RenderTurboStream
|
|
13
13
|
@action = action
|
14
14
|
@partial_path = partial
|
15
15
|
@template_path = template
|
16
|
-
@available_instance_variables = available_instance_variables
|
16
|
+
@available_instance_variables = nil #available_instance_variables #=> because if an instance variable was not set on production and the first call, and it was set on a later call, the gem would not know that and not set it.
|
17
17
|
prt = (partial ? partial : template).split('/')
|
18
18
|
if prt.length < 2
|
19
19
|
raise 'Partial or template path must always be specified with the controller path, for example «articles/partial_name».'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: render_turbo_stream
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- christian
|
@@ -85,5 +85,5 @@ requirements: []
|
|
85
85
|
rubygems_version: 3.4.12
|
86
86
|
signing_key:
|
87
87
|
specification_version: 4
|
88
|
-
summary: Complete workflow for turbo
|
88
|
+
summary: Complete workflow for turbo with a testing strategy.
|
89
89
|
test_files: []
|