LoginSignup
0
0

More than 3 years have passed since last update.

これから作るRailsアプリの大まかな作成手順~簡易画像投稿サイト~

Last updated at Posted at 2019-11-27

0.Railsチュートリアルに準拠

1.rails 5.1.6 new 『名前』

2.gemの準備をしてから、gitしておく
bundle
git init
git add -A
git commit -m "Initialize repository"

3.rails generate controller Home top #ホームコントローラとトップページを作る
root 'home#top'

4.rails generate controller Post new #ポストコントローラとnewページを作る
get '/signup', to: 'users#new' #登録フォームページになる

5.rails generate model User name:string #モデルを作る
rails db:migrate
resources :users

6.RESTに従った設計にする
GET /users index users_path すべてのユーザーを一覧するページ
GET /users/1 show user_path(user) 特定のユーザーを表示するページ
GET /users/new new new_user_path ユーザーを新規作成するページ (ユーザー登録)
POST /users create users_path ユーザーを作成するアクション
GET /users/1/edit edit edit_user_path(user) id=1のユーザーを編集するページ
PATCH /users/1 update user_path(user) ユーザーを更新するアクション
DELETE /users/1 destroy user_path(user) ユーザーを削除するアクション

7.topに登録、一覧表示へのリンクを表示。余裕があればtopを一覧表示にする。

8.クリックで特定画像ページへのリンク

9.一覧に編集と削除の表示。

10.form_forがきまれば、carrierとimagemagicもきまる。

11.一覧ページではclassで大きさを指定してきれいに並べ、実際のページでは原寸表示
.gazouookisa img {
width: 200px;
height: 200px;
}

12.heroku設定。アップして動いたら完成

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