Rails.application.routes.draw do get 'schools/new' get 'schools/make' end
然后文件目录是这个样子的:!
结果第一个能访问的到,第二个报错说找不到 make 这个方法,但是我在 schoolsController 里面 def 了的,,然后就有点晕,刚才 java 过来,求大神指点一二
补充一下,而且最坑爹的就是,如果自己定义了 new 方法,里面写一个 p '访问到了'他不会有输出,,应该是 new 方法没有被访问到 = =
再补充一下,重启之后,第一个也访问不到,报错
用 rake routes 命令看看生成的路由
rake routes
#1 楼 @chromer Prefix Verb URI Pattern Controller#Action schools_new GET /schools/new(.:format) schools#new schools_make GET /schools/make(.:format) schools#make
#1 楼 @chromer
@941112341 把 SchoolsController 从你那个什么 zjsu 文件夹移出来
#4 楼 @chromer 请问有不移的解决方法吗?
#5 楼 @941112341 http://guides.ruby-china.org/routing.html
#6 楼 @chromer 额这个我之前看过,但是好像没有包管理的 = =!,但是我想到了一个办法添加 module,to 的时候加进去,,不过感觉有点麻烦......还是谢谢您了