Changeset 29
- Timestamp:
- 12/13/2006 12:12:59 AM (2 years ago)
- Files:
-
- trunk/auto-admin/lib/auto_admin_configuration.rb (modified) (1 diff)
- trunk/auto-admin/lib/auto_admin_controller.rb (modified) (2 diffs)
- trunk/auto-admin/lib/auto_admin_simple_theme.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/auto-admin/lib/auto_admin_configuration.rb
r28 r29 249 249 idx += 1 250 250 o = children.build 251 children.delete o 251 252 build_object(builder, o, idx, 252 253 "#{o.class.human_name} ##{n}") trunk/auto-admin/lib/auto_admin_controller.rb
r26 r29 135 135 136 136 # Save attributes on the primary object 137 flash[:notice] = @object.inspect138 137 @object.attributes = params[params[:model]] 139 138 unless @object.save … … 181 180 set_name = 'Child list' 182 181 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}). " 182 flash[:warning] = "Failed to #{o.new_record? ? 'add' : 'change'} the #{o.class.name.titleize.downcase} \"#{o.to_label}\" (#{set_name})" 183 o.errors.each_full {|s| flash[:warning] << "; " << s } 184 flash[:warning] << ". " 184 185 render :action => 'edit' and return 185 186 end trunk/auto-admin/lib/auto_admin_simple_theme.rb
r23 r29 391 391 options = @options.dup 392 392 options.update extra_options 393 name = "#{@object_name}_#{inner_object_name}" 394 table_params = @controller.params[name] 395 yield self.class.new( inner_object, name, extra_options[:model], @controller, table_params, options ) if table_params 393 if table_params = @controller.params[inner_object_name] 394 table_params.each do |row_number, row_params| 395 if row_params 396 yield self.class.new( inner_object, inner_object_name, extra_options[:model], @controller, row_params, options ) 397 end 398 end 399 end 396 400 end 397 401 def with_object(object, object_name=@object_name)
