level 9
如题所示,求解释下具体怎么设置,尝试了网上的方法都不对,如果是在route.rb里面写入以下代码把它wrapping in a block的话,
devise_scope :user do
root to: "devise/sessions#new"
end
devise_for :user
则会显示uninitialized constant Devise::SessionController的routing error.
这个东西已经烦了我一晚上了,求救啊。求一个好方法!谢谢大家。
2014年09月18日 13点09分
1
level 12
把 public/index.html 的默认主页拿掉。
然后才用这个方式的作法才会生效:
3.14 Using root
You can specify what Rails should route */* to with the root method:
root to: *pages
#main*root *pages#
main* # shortcut for the above
2014年09月18日 23点09分
2
但是public/index.html并不存在诶。或者我没找到,它应该是和app同一级目录下的那个public文件夹吧?里面木有index.html诶。
2014年09月19日 05点09分
回复 佐佑萨玛 :在根目录下有个index.html,然后设置路由 root :to => "ControllerName#login"
2014年11月03日 10点11分
level 12
rake routes
如果你不清楚这些路由设定到底最后的规则是什麼,你可以执行:
rake routes
这样就会产生出所有URL Helper、URL 网址和对应的Controller Action都列出来。
2014年09月20日 06点09分
3
level 7
if 首先检查 public 文件夹下是否存在 index.html
delete it
else
在route.rb中添加 root *homes/index* (意思是将controller下homes中的index设置为主页)
end
2014年09月21日 03点09分
4