新手问题 我在 controller 目录下创建了一个目录,请问怎么访问这个目录底下的控制器

suntianxiang · 2014年11月06日 · 最后由 suntianxiang 回复于 2014年11月06日 · 1369 次阅读

apps/ controllers/ test/ test_controller.rb 目录结构就像这样,我应该怎么写 url 啊。

namespace :test do
  # blalbla
end

scope module: :test do
  #blabla
end

#1 楼 @alixiaomiao 没看懂。。。,在控制器加了这段代码就能像这样访问了吗(localhost/test/test)?

#2 楼 @suntianxiang 这是在 route 里的。。。

你先把这个看完吧。http://guides.rubyonrails.org/routing.html

#3 楼 @alixiaomiao 找到答案了。。谢谢啊

需要 登录 后方可回复, 如果你还没有账号请 注册新账号