Sha256: 78a10796029fef55da86e641c28c6f520c182607095179d17f2976a6c38b2ba8

Contents?: true

Size: 462 Bytes

Versions: 31

Compression:

Stored size: 462 Bytes

Contents

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

31 entries across 31 versions & 1 rubygems

Version Path
renalware-core-2.0.16 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.15 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.14 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.13 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.12 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.11 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.9 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.8 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.7 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.5 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.4 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.3 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.2 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.1 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.0 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.0.pre.rc13 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.0.pre.rc11 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.0.pre.rc10 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.0.pre.rc9 app/helpers/renalware/xhr_helper.rb
renalware-core-2.0.0.pre.rc8 app/helpers/renalware/xhr_helper.rb