内部:-config / routes.rb
Rails.application.routes.draw do
mount Spree::Core::Engine, at: '/'
Spree::Core::Engine.add_routes do
namespace :api, :defaults => { :format => 'json' } do
resources :option_values
end
end
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end
Spree::Core::Engine.routes.draw do
namespace :admin, path: Spree.admin_path do
get 'masterlist' => 'products#masterlist'
end
end
内部:-controller / spree / admin / product_controller.rb
module Spree
Spree::ProductsController.class_eval do
def masterlist
session[:return_to] = request.url
respond_with(@collection)
end
end
end