导轨 3.2。在这里,我想指示 allhttp://domain.dev/toys
只显示所有shops
(shop_type
在我的表格列中)是toys
.
# routes.rb
resources :shops
match 'toys' => 'shops#index', :as => :toys, :via => :get, :constraints => {:shop_type => 'toys'}
# shops_controller.rb
def index
@shops = Shop.find(:all)
end
我做错了什么?谢谢。