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

suntianxiang · November 06, 2014 · Last by suntianxiang replied at November 06, 2014 · 1369 hits

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 找到答案了。。谢谢啊

You need to Sign in before reply, if you don't have an account, please Sign up first.