turbo-rails 0.5.8 → 0.5.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/turbo.js +660 -585
- data/app/helpers/turbo/streams/action_helper.rb +2 -7
- data/app/models/turbo/streams/tag_builder.rb +2 -1
- data/lib/turbo/version.rb +1 -1
- metadata +2 -2
@@ -14,12 +14,7 @@ module Turbo::Streams::ActionHelper
|
|
14
14
|
end
|
15
15
|
|
16
16
|
private
|
17
|
-
def convert_to_turbo_stream_dom_id(
|
18
|
-
|
19
|
-
element = element_or_dom_id
|
20
|
-
ActionView::RecordIdentifier.dom_id(element)
|
21
|
-
else
|
22
|
-
dom_id = element_or_dom_id
|
23
|
-
end
|
17
|
+
def convert_to_turbo_stream_dom_id(target)
|
18
|
+
target.respond_to?(:to_key) ? ActionView::RecordIdentifier.dom_id(target) : target
|
24
19
|
end
|
25
20
|
end
|
@@ -27,6 +27,7 @@ class Turbo::Streams::TagBuilder
|
|
27
27
|
|
28
28
|
def initialize(view_context)
|
29
29
|
@view_context = view_context
|
30
|
+
@view_context.formats |= [:html]
|
30
31
|
end
|
31
32
|
|
32
33
|
# Removes the <tt>target</tt> from the dom. The target can either be a dom id string or an object that responds to
|
@@ -121,7 +122,7 @@ class Turbo::Streams::TagBuilder
|
|
121
122
|
def render_record(possible_record)
|
122
123
|
if possible_record.respond_to?(:to_partial_path)
|
123
124
|
record = possible_record
|
124
|
-
@view_context.render(partial: record
|
125
|
+
@view_context.render(partial: record, formats: :html)
|
125
126
|
end
|
126
127
|
end
|
127
128
|
end
|
data/lib/turbo/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: turbo-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Stephenson
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-01-
|
13
|
+
date: 2021-01-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|