Rails doesn't need index method in controller defined?

后端 未结 1 921
猫巷女王i
猫巷女王i 2020-12-11 03:03

I noticed that an index view is routed correctly even if there isn\'t a controller method index.

As an example, the routes.rb has this route

<         


        
相关标签:
1条回答
  • 2020-12-11 03:30

    If you have the view file, it'll go ahead and render that implicitly, as documented here

    See also, this SO thread on how Rails renders your view files and controller actions.

    0 讨论(0)
提交回复
热议问题