Changeset 26

Show
Ignore:
Timestamp:
11/19/2006 07:26:22 PM (2 years ago)
Author:
matthew
Message:

Fieldsets don't have a label property, making it difficult to call. :)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/auto-admin/lib/auto_admin_controller.rb

    r23 r26  
    179179            o = child_id ? child_class.find( child_id ) : children.build 
    180180            unless o.update_attributes child_info 
    181               flash[:warning] = "Failed to #{o.new_record? ? 'add' : 'change'} the #{o.class.name.titleize.downcase} \"#{o.to_label}\" (#{set.label || 'Child list'}). " 
     181              set_name = 'Child list' 
     182              set_name = set.name if set.respond_to?(:name) && !set.name.blank? 
     183              flash[:warning] = "Failed to #{o.new_record? ? 'add' : 'change'} the #{o.class.name.titleize.downcase} \"#{o.to_label}\" (#{set_name}). " 
    182184              render :action => 'edit' and return 
    183185            end