Sha256: 1945c1848e20603e46c2888f2528d3ed1b86a815f637dce817359d54074b5565

Contents?: true

Size: 493 Bytes

Versions: 142

Compression:

Stored size: 493 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware"

module Renalware
  module XHRHelper
    def refresh(el, partial:, locals:)
      <<-EOS.squish.html_safe
        $("#{el}").html("#{escape_javascript(render(partial, locals))}");
      EOS
    end

    def replace(el, partial:, locals:)
      <<-EOS.squish.html_safe
        $("#{el}").replaceWith("#{escape_javascript(render(partial, locals))}");
        $("#{el}").addClass("post-action-highlight");
      EOS
    end
  end
end

Version data entries

142 entries across 142 versions & 1 rubygems

Version Path
renalware-core-2.0.84 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.83 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.82 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.81 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.80 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.79 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.78 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.77 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.76 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.75 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.74 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.73 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.72 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.71 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.70 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.69 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.68 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.67 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.64 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.63 app/helpers/renalware/xhr_helper.rb