Skip to content

Commit

Permalink
Update selector string
Browse files Browse the repository at this point in the history
  • Loading branch information
julianrubisch committed Aug 4, 2020
1 parent eeff5f4 commit 7a781f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/futurism/channel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def receive(data)
ApplicationController.renderer.instance_variable_set(:@env, new_env)

resources.each do |signed_params, sgid|
selector = "[data-signed-params='#{signed_params}']"
selector = "[data-signed-params='%s'%s]" % [signed_params, sgid.present? ? " data-sgid='#{sgid}'" : ""]
cable_ready["Futurism::Channel"].outer_html(
selector: selector,
html: ApplicationController.render(resource(signed_params: signed_params, sgid: sgid))
Expand All @@ -26,7 +26,7 @@ def receive(data)
private

def resource(signed_params:, sgid:)
return GlobalID::Locator.locate_signed(sgid) if sgid.present?
return GlobalID::Locator.locate_signed(sgid) if sgid.present?

Rails.application.message_verifier("futurism").verify(signed_params)
end
Expand Down

0 comments on commit 7a781f9

Please sign in to comment.