Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 5029

Show
Ignore:
Timestamp:
09/05/06 23:07:25 (2 years ago)
Author:
david
Message:

Back with clever

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/simply_helpful/lib/simply_helpful/record_identifier.rb

    r5026 r5029  
    1818    end 
    1919 
    20     def dom_id(record) 
    21       record.new_record? ? "new_#{singular_class_name(record)}" : "#{singular_class_name(record)}_#{record.id}" 
     20    def dom_id(record, prefix = nil)  
     21        prefix ||= 'new' unless record.id  
     22        [prefix, record.class.name.underscore, record.id].compact * '_' 
    2223    end 
    2324