0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ルート(/)へのルーティング設定

Last updated at Posted at 2019-10-18

URLが「/」というルートの設定方法

「root」メソッドを使ったルーティングを設定する

記述方法

root :to => 'コントローラ名#アクション名'
もしくは
root to: 'コントローラ名#アクション名'
実務では
root "コントローラ名#アクション名"

具体例

root :to => 'info#index'
root to: 'home#index'
root "home#top"

参考URL

https://www.javadrive.jp/rails/routing/index2.html
https://techacademy.jp/magazine/7131

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?