Files
openfoodnetwork/app/controllers/spree/admin/taxonomies_controller.rb
Luis Ramos e52937c113 Use rubocop auto correct to add frozen string literal to all files
This is an unsafe auto corection, we will need to trust our build here
2021-06-17 23:07:26 +01:00

28 lines
596 B
Ruby

# frozen_string_literal: true
module Spree
module Admin
class TaxonomiesController < ::Admin::ResourceController
respond_to :json, only: [:get_children]
def get_children
@taxons = Taxon.find(params[:parent_id]).children
end
private
def location_after_save
if @taxonomy.created_at == @taxonomy.updated_at
spree.edit_admin_taxonomy_url(@taxonomy)
else
spree.admin_taxonomies_url
end
end
def permitted_resource_params
params.require(:taxonomy).permit(:name)
end
end
end
end