Sha256: d1a40bd2dc9a39f3af36c7bab98a2d9d0f78774048f4a4a6b36e4a711166deaf

Contents?: true

Size: 369 Bytes

Versions: 7

Compression:

Stored size: 369 Bytes

Contents

module RailsScript
  module LoaderHelper

    def include_rails_script
      javascript_tag <<-RUBY
  jQuery(function() {
    window.$this = new (App.#{ controller_path.split(/\/|_/).map(&:capitalize).join('') } || App.Base)();
    if (typeof $this.#{ action_name } === 'function') {
      return $this.#{ action_name }.call();
    }
  });
      RUBY
    end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rails_script-0.1.2 lib/rails_script/loader_helper.rb
rails_script-0.1.1 lib/rails_script/loader_helper.rb
rails_script-0.1.0 lib/rails_script/loader_helper.rb
rails_script-0.0.7 lib/rails_script/loader_helper.rb
rails_script-0.0.5 lib/rails_script/loader_helper.rb
rails_script-0.0.4 lib/rails_script/loader_helper.rb
rails_script-0.0.3 lib/rails_script/loader_helper.rb