app/controllers/admin/elements_controller.rb in geoblacklight_admin-0.5.0 vs app/controllers/admin/elements_controller.rb in geoblacklight_admin-0.5.1
- old
+ new
@@ -69,9 +69,11 @@
private
# Use callbacks to share common setup or constraints between actions.
def set_element
@element = Element.find(params[:id])
+ rescue ActiveRecord::RecordNotFound
+ redirect_to admin_elements_url, alert: "Element not found."
end
# Only allow a list of trusted parameters through.
def element_params
params.require(:element).permit(:label, :solr_field, :field_definition, :field_type, :required, :repeatable,