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.
@@ -14,12 +14,7 @@ module Turbo::Streams::ActionHelper
14
14
  end
15
15
 
16
16
  private
17
- def convert_to_turbo_stream_dom_id(element_or_dom_id)
18
- if element_or_dom_id.respond_to?(:to_key)
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.to_partial_path, locals: { record.model_name.singular.to_sym => record }, formats: [ :html ])
125
+ @view_context.render(partial: record, formats: :html)
125
126
  end
126
127
  end
127
128
  end
@@ -1,3 +1,3 @@
1
1
  module Turbo
2
- VERSION = "0.5.8"
2
+ VERSION = "0.5.9"
3
3
  end
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.8
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-25 00:00:00.000000000 Z
13
+ date: 2021-01-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails