Module: Searchgasm::Helpers::ControlTypes::RemoteLink

Defined in:
lib/searchgasm/helpers/control_types/remote_link.rb

Overview

Remote Link Control Types

These helpers use rails built in remote_function as links.

Instance Method Summary collapse

Instance Method Details

The same thing as order_as_link but instead of using rails link_to it uses link_to_remote

Examples

remote_order_as_link
remote_order_as_link(:remote => {:update => "users"})

Options

Please look at order_as_link, this accepts the same options with the following addition:

  • :remote – default: {}, the options to pass into link_to_remote remote options. Such as :update => => “alert(‘success’)”



37
38
39
40
# File 'lib/searchgasm/helpers/control_types/remote_link.rb', line 37

def remote_order_as_link(order_as, options = {})
  add_remote_defaults!(options)
  order_as_link(order_as, options)
end

The same thing as order_by_link but instead of using rails link_to it uses link_to_remote

Examples

remote_order_by_link
remote_order_by_link(:remote => {:update => "users"})

Options

Please look at order_by_link, this accepts the same options with the following addition:

  • :remote – default: {}, the options to pass into link_to_remote remote options. Such as :update => => “alert(‘success’)”



20
21
22
23
# File 'lib/searchgasm/helpers/control_types/remote_link.rb', line 20

def remote_order_by_link(order_by, options = {})
  add_remote_defaults!(options)
  order_by_link(order_by, options)
end

The same thing as page_link but instead of using rails link_to it uses link_to_remote

Examples

remote_page_link
remote_page_link(:remote => {:update => "users"})

Options

Please look at page_link, this accepts the same options with the following addition:

  • :remote – default: {}, the options to pass into link_to_remote remote options. Such as :update => => “alert(‘success’)”



71
72
73
74
# File 'lib/searchgasm/helpers/control_types/remote_link.rb', line 71

def remote_page_link(page, options = {})
  add_remote_defaults!(options)
  page_link(page, options)
end

The same thing as per_page_link but instead of using rails link_to it uses link_to_remote

Examples

remote_per_page_link
remote_per_page_link(:remote => {:update => "users"})

Options

Please look at per_page_link, this accepts the same options with the following addition:

  • :remote – default: {}, the options to pass into link_to_remote remote options. Such as :update => => “alert(‘success’)”



54
55
56
57
# File 'lib/searchgasm/helpers/control_types/remote_link.rb', line 54

def remote_per_page_link(per_page, options = {})
  add_remote_defaults!(options)
  per_page_link(per_page, options)
end