0
我試圖重定向用戶show_city_url
或show_city_path
但我得到一個異常,他們都是undefined。在城市控制器我有三個動作顯示,喜歡和不喜歡。 unlike_city_path
和like_city_path
作品,但show_city_path
doesnt.Also當我把這個在all_cities行動redirect_to :controller=>"city",:action=>"show"
作品。我做錯了什麼?謝謝。足智多謀的助手_path和_url不工作
class HomeController < ApplicationController
def all-cities
redirect_to show_city_url
end
end
在路線
resources :city do
member do
post :like
post :dislike
get :show
end
end
現在它告訴我未初始化的常量CitiesController – katie
什麼是你的控制器的顯示/列出了城市的名字嗎? – sled
它是CityController – katie