Module: AjaxLoading::ActiveRecordExtensions

Defined in:
lib/ajax_loading/active_record_extensions.rb

Instance Method Summary collapse

Instance Method Details

#element_id(*args) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/ajax_loading/active_record_extensions.rb', line 3

def element_id(*args)
  args << self
  args.map{|t|
    t.kind_of?(ActiveRecord::Base) ?
        "#{t.class.name.underscore}_#{t.new_record? ? "new" : t.id}" :
        t.to_s
  }.join('_')
end