使用Rails 3.我有以下内容:
# 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
中读取数组吗?
感谢。
答案 0 :(得分:1)
TYPES = :nearby_cafes, :nearby_restaurants, :nearby_stations
....
get *TYPES