Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

issue #291: change name of error handling method from "render_error" …

…to "handle_save_error"

"render_error" is a special name for rails, so calling our function by
that name caused it to interfere with Rails' error handling process.
Our function is a very special-case function designed to handle the
case where an object save fails for some reason.  It's not a
general-purpose error handling method, so in many cases if an error
happened our render_error would itself crash and hide the original
error.

It's better to let crashes percolate up to the application's error
handling page (or Rails' default), which this change enables.
  • Loading branch information...
commit afa90519b3a78066d6d0e83ed5e36553962dad18 1 parent 14882c7
@ccabot ccabot authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 app/controllers/rails_admin/main_controller.rb
View
6 app/controllers/rails_admin/main_controller.rb
@@ -98,7 +98,7 @@ def create
end
end
else
- render_error
+ handle_save_error
end
end
@@ -130,7 +130,7 @@ def update
AbstractHistory.create_update_history @abstract_model, @object, @cached_assocations_hash, associations_hash, @modified_assoc, @old_object, _current_user
redirect_to_on_success
else
- render_error :edit
+ handle_save_error :edit
end
end
@@ -299,7 +299,7 @@ def redirect_to_on_success
end
end
- def render_error whereto = :new
+ def handle_save_error whereto = :new
action = params[:action]
flash.now[:error] = t("admin.flash.error", :name => @model_config.label, :action => t("admin.actions.#{action}d"))
Please sign in to comment.
Something went wrong with that request. Please try again.