LoginSignup
0
1

More than 3 years have passed since last update.

ルートパスとは

Posted at

ルートパス

ルートパスとはアプリケーションのアクセス先でルーティングの設定で、呼び出すアクションを指定する

root to: 'コントローラー名#アクション名'

【例】コントローラー名がpostの場合

config/routes.rb
Rails.application.routes.draw do
  root to: 'posts#index'
end

これでhttp://localhost:3000にアクセスしたらpostsのindexアクションにとぶことができる

0
1
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
1