mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
And again: override redirect to index page when editing properties from edit page
This commit is contained in:
@@ -184,7 +184,8 @@ module Admin
|
||||
|
||||
# Overriding method on Spree's resource controller
|
||||
def location_after_save
|
||||
if params[:enterprise].key? :producer_properties_attributes && request.referrer != main_app.edit_admin_enterprise_path(@enterprise)
|
||||
refered_from_edit = URI(request.referer).path == main_app.edit_admin_enterprise_path(@enterprise)
|
||||
if params[:enterprise].key?(:producer_properties_attributes) && !refered_from_edit
|
||||
main_app.admin_enterprises_path
|
||||
else
|
||||
main_app.edit_admin_enterprise_path(@enterprise)
|
||||
|
||||
Reference in New Issue
Block a user