Skip to content

Commit

Permalink
Add configuration option for rendering jQuery part
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolalsvk committed Oct 6, 2018
1 parent b62582e commit b23719c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/render_async.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
require "render_async/version"
require "render_async/view_helper"
require "render_async/engine" if defined? Rails
require "render_async/configuration"

ActionView::Base.send :include, RenderAsync::ViewHelper if defined? ActionView::Base

module RenderAsync
class << self
attr_accessor :configuration
end

def self.configuration
@configuration ||= RenderAsync::Configuration.new
end

def self.reset
@configuration = RenderAsync::Configuration.new
end

def self.configure
yield(configuration)
end
end
9 changes: 9 additions & 0 deletions lib/render_async/configuration.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module RenderAsync
class Configuration
attr_accessor :jquery

def initialize
@jquery = false
end
end
end

0 comments on commit b23719c

Please sign in to comment.