0
使用Rails 3.使用數組我有以下幾點:在routes.rb中
# shop.rb
SHOP_TYPES = %w(cafe restaurant station)
# routes.rb
resources :shops do
member do
get :nearby_cafes, :nearby_restaurants, :nearby_stations
end
end
而不是更新我routes.rb
每次我的SHOP_TYPES
陣列中添加其他成員,反正是有讀陣列中的routes.rb
?
謝謝。
'Shop :: SHOP_TYPES'?所以:'get * Shop :: SHOP_TYPES' – apneadiving