質問するログイン新規登録

質問編集履歴

3

タグ追加

2020/01/07 16:03

投稿

is02
is02

スコア17

title CHANGED
File without changes
body CHANGED
File without changes

2

routes.rbの追加

2020/01/07 16:03

投稿

is02
is02

スコア17

title CHANGED
File without changes
body CHANGED
@@ -105,6 +105,19 @@
105
105
  end
106
106
  end
107
107
  ```
108
+ routes.rb
109
+ ```
110
+ Rails.application.routes.draw do
111
+ devise_for :users
112
+ root 'post_images#index'
113
+ resources :post_images, only: [:new, :create, :index, :show, :destroy] do
114
+ resource :favorites, only: [:create, :destroy]
115
+ resource :post_comments, only: [:create, :destroy]
116
+ end
117
+ resources :users, only: [:show, :edit, :update]
118
+ # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
119
+ end
120
+ ```
108
121
  ### 試したこと
109
122
  link_toのパスをpost_images_path(投稿一覧ページ)に変えたところrouting_errorになった
110
123
 

1

前提・実現したいことの修正

2020/01/07 15:09

投稿

is02
is02

スコア17

title CHANGED
File without changes
body CHANGED
@@ -1,7 +1,8 @@
1
1
  ### 前提・実現したいこと
2
2
 
3
- 前提:いいねボタンは投稿一覧ページに実装済み
3
+ 前提:いいねボタンは投稿一覧ページ、投稿詳細ページに実装済み
4
4
  実現したいこと:いいねボタンを押しても投稿一覧ページに留まりたいが、カウントはしたい。
5
+ 投稿詳細ページは変わらずいいね機能を実装したい
5
6
 
6
7
  投稿一覧ページ:post_images/index.html.erb
7
8