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