Module: LookForHelper

Defined in:
lib/look_for/helpers/look_for_helper.rb

Overview

look_for/helpers/look_for_helper.rb

Instance Method Summary collapse

Instance Method Details

#look_for(*args) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/look_for/helpers/look_for_helper.rb', line 4

def look_for(*args)
  opt = args[3] || {}
  opt[:controller] = :look_for
  opt[:action]     = :search
  opt[:width]    ||= 0
  opt[:height]   ||= 0
  opt[:object_name] = args.first
  opt[:method_names] = args[1]

  html_opt = args[4] || {}
  html_opt[:remote] = true
  html_opt[:id] ||= "look_for_#{args.first.downcase.pluralize}"

  link_to args[2], opt, html_opt.merge(method: :post)
end