Permalink
Browse files

Fix the build with Ruby 1.9.2 / errors[:base]

  • Loading branch information...
1 parent 749d64b commit 11f5982a8c259876654a7cd82ffa05fff391eb2c Benoit Bénézech committed May 4, 2011
Showing with 2 additions and 5 deletions.
  1. +2 −5 app/controllers/rails_admin/main_controller.rb
@@ -305,11 +305,8 @@ def render_error whereto = :new
action = params[:action]
flash.now[:error] = t("admin.flash.error", :name => @model_config.label, :action => t("admin.actions.#{action}d"))
-
- if @object.errors[:base].size > 0
- flash.now[:error] << ". " << @object.errors[:base].to_s
- end
-
+ flash.now[:error] += ". #{@object.errors[:base].to_sentence}" unless @object.errors[:base].blank?
+
respond_to do |format|
format.html { render whereto, :layout => 'rails_admin/form', :status => :not_acceptable }
format.js { render whereto, :layout => 'rails_admin/plain.html.erb', :status => :not_acceptable }

0 comments on commit 11f5982

Please sign in to comment.