module RailsAjax

Public Class Methods

config() click to toggle source

Give access to the configuration

Return
  • RailsAjax::Configuration: The RailsAjax configuration

# File lib/rails-ajax/rails-ajax.rb, line 11
def self.config
  return @configuration
end
configure(&config_block) click to toggle source

Configure RailsAjax

Parameters
  • config_block (CodeBlock): Block called that will contain all configuration directives

# File lib/rails-ajax/rails-ajax.rb, line 19
def self.configure(&config_block)
  @configuration.instance_eval(&config_block)
end
rails_ajaxifiable?(options) click to toggle source

Find if we use rails-ajax for a given set of options applicable to a link

Parameters
  • options (map<Symbol,Object>): The options provided to a link (used in link_to or form_tag)

Result
  • Boolean: Would this link be handled by rails-ajax?

# File lib/rails-ajax/rails-ajax.rb, line 29
def self.rails_ajaxifiable?(options)
  return ((options[:use_rails_ajax] != false) and # User has not removed rails-ajax voluntarily
          (options[:target] == nil) and # Open in the same window and
          (!options.has_key?(:remote))) # User has not specified Ajax call itself
end
root() click to toggle source

Give the ::root directory of the RailsAjax installation

Return
# File lib/rails-ajax.rb, line 7
def self.root
  return File.expand_path("#{File.dirname(__FILE__)}/..")
end