0
0

More than 3 years have passed since last update.

Rails + MySQL + Vue.jsでアプリを作成する➂/簡単な画面を作成する

Last updated at Posted at 2020-04-19

※前回:Rails + MySQL + Vue.jsでアプリを作成する②/MySQLの導入

コントローラーの作成

次のコマンドをターミナルで実行してください

$ rails generate controller StaticPages top

ルーティングの編集

config/routes.rb
Rails.application.routes.draw do
  root 'static_pages#top'
end

ビューの編集

app/views/static_pages/top.html.erb
<h1>トップページです!!</h1>
<p>Hello World!!</p>

確認

$ rails s


http://localhost:3000/
にいき、

スクリーンショット 2020-04-19 16.40.09.png

というような表示になれば成功です!!!

Rails + MySQL + Vue.jsでアプリを作成する④/Vueの導入

AWSでのデプロイ手順はこちら

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