質問編集履歴

3

編集

2019/11/30 02:02

投稿

yakumo02
yakumo02

スコア103

test CHANGED
File without changes
test CHANGED
@@ -267,3 +267,79 @@
267
267
  = render 'shared/sub_footer'
268
268
 
269
269
  ```
270
+
271
+
272
+
273
+ エラーメッセージ
274
+
275
+ ```
276
+
277
+ Couldn't find Item without an ID
278
+
279
+ Request info
280
+
281
+ Request parameters
282
+
283
+ {"controller"=>"purchase", "action"=>"done"}
284
+
285
+ Rack session
286
+
287
+ (Object too large. Modify ActionDispatch::Request::Session#inspect or adjust BetterErrors.maximum_variable_inspect_size if you need to see it.)
288
+
289
+ Local Variables
290
+
291
+ id
292
+
293
+ nil
294
+
295
+ Instance Variables
296
+
297
+ @_action_has_layout
298
+
299
+ true
300
+
301
+ @_routes
302
+
303
+ nil
304
+
305
+ @_request
306
+
307
+ (Object too large. Modify ActionDispatch::Request#inspect or adjust BetterErrors.maximum_variable_inspect_size if you need to see it.)
308
+
309
+ @_response
310
+
311
+ (Object too large. Modify ActionDispatch::Response#inspect or adjust BetterErrors.maximum_variable_inspect_size if you need to see it.)
312
+
313
+ @_lookup_context
314
+
315
+ #<ActionView::LookupContext:0x00007fd024bc8828 @details_key=nil, @cache=true, @prefixes=["purchase", "application"], @rendered_format=nil, @details={:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby, :coffee, :jbuilder, :haml]}, @view_paths=#<ActionView::PathSet:0x00007fd024bc8738 @paths=[#<ActionView::OptimizedFileSystemResolver:0x00007fd0208c11b0 @pattern=":prefix/:action{.:locale,}{.:formats,}{+:variants,}{.:handlers,}", @cache=#<ActionView::Resolver::Cache:0x7fd0208c1188 keys=24 queries=0>, @path="/Users/katoukento/projects/freemarket_sample_62b/app/views">, #<ActionView::OptimizedFileSystemResolver:0x00007fd0208c19a8 @pattern=":prefix/:action{.:locale,}{.:formats,}{+:variants,}{.:handlers,}", @cache=#<ActionView::Resolver::Cache:0x7fd0208c1980 keys=16 queries=0>, @path="/Users/katoukento/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/devise-4.7.1/app/views">, #<ActionView::OptimizedFileSystemResolver:0x00007fd0208c20d8 @pattern=":prefix/:action{.:locale,}{.:formats,}{+:variants,}{.:handlers,}", @cache=#<ActionView::Resolver::Cache:0x7fd0208c20b0 keys=16 queries=0>, @path="/Users/katoukento/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/kaminari-core-1.1.1/app/views">]>>
316
+
317
+ @_action_name
318
+
319
+ "done"
320
+
321
+ @_response_body
322
+
323
+ nil
324
+
325
+ @marked_for_same_origin_verification
326
+
327
+ true
328
+
329
+ @_config
330
+
331
+ {}
332
+
333
+ @current_user
334
+
335
+ #<User id: 4, email: "katou@gmail.com", created_at: "2019-11-29 02:37:47", updated_at: "2019-11-29 02:37:47", provider: nil, uid: nil, nickname: "加藤", last_name: "けんと", first_name: "加藤", last_name_kana: "ケント", first_name_kana: "カトウ", birthday_year: 1, birthday_month: 2, birthday_day: 2, phone_number: 333, address_last_name: "加藤", address_first_name: "けんと", address_last_name_kana: "カトウ", address_first_name_kana: "ケント", post_code: "6893541", address_prefecture: "31", address_city: "米子市", address_number: "0-0-0", address_building: "1", address_phone_number: nil, introduce: nil>
336
+
337
+ @card
338
+
339
+ #<Card id: 19, user_id: 4, customer_id: "cus_d2f3014728cb6d51a81df8f63c45", card_id: "car_39b06cf04c45f84f8ce838193b23", created_at: "2019-11-29 03:20:08", updated_at: "2019-11-29 03:20:08">
340
+
341
+ @_params
342
+
343
+ <ActionController::Parameters {"controller"=>"purchase", "action"=>"done"} permitted: false>
344
+
345
+ ```

2

更新

2019/11/30 02:02

投稿

yakumo02
yakumo02

スコア103

test CHANGED
File without changes
test CHANGED
@@ -71,3 +71,199 @@
71
71
  itemsテーブルのid2を取りたいです
72
72
 
73
73
  ![イメージ説明](81840b4152e58aaa3fe967c5eeda558e.png)
74
+
75
+
76
+
77
+ コントローラー index
78
+
79
+ ```
80
+
81
+ def index
82
+
83
+ @item = Item.find(params[:format])
84
+
85
+ @card = Card.find_by(user_id: current_user.id)
86
+
87
+ @user = User.find(id= current_user.id)
88
+
89
+ if @card.blank?
90
+
91
+
92
+
93
+ else
94
+
95
+ ```
96
+
97
+
98
+
99
+ view
100
+
101
+ ```
102
+
103
+ -# ページのヘッダー部分
104
+
105
+ %header.header
106
+
107
+ = render 'shared/sub_header'
108
+
109
+
110
+
111
+ -# メイン画面
112
+
113
+ %main.confirmation-main
114
+
115
+ %section.confirmation-main__container
116
+
117
+ -# メイン画面ヘッダー
118
+
119
+ %h2.confirmation-main__container__header
120
+
121
+ 購入内容の確認
122
+
123
+
124
+
125
+ -# 商品情報、値段
126
+
127
+ %section.confirmation-main__container__buy-content
128
+
129
+ .confirmation-main__container__buy-content__inner
130
+
131
+ %h3.confirmation-main__container__buy-content__inner__item
132
+
133
+ =image_tag ("#{@item.image}"),class: "huku_1"
134
+
135
+ .confirmation-main__container__buy-content__inner__item-name
136
+
137
+ .confirmation-main__container__buy-content__inner__item-name__box
138
+
139
+ = @item.product_name
140
+
141
+
142
+
143
+
144
+
145
+ -# ポイント、支払い金額、購入ボタン
146
+
147
+ .confirmation-main__container__buy-content__inner__buy-form
148
+
149
+ .confirmation-main__container__buy-content__inner__buy-form__list
150
+
151
+ %p.confirmation-main__container__buy-content__inner__buy-form__list__price
152
+
153
+ ¥
154
+
155
+ = @item.price
156
+
157
+ %span.confirmation-main__container__buy-content__inner__buy-form__list__price__text
158
+
159
+ 送料込み
160
+
161
+ %ul.confirmation-main__container__buy-content__inner__buy-form__list__point
162
+
163
+ ポイントはありません
164
+
165
+ .confirmation-buy-box
166
+
167
+ %ul.confirmation-main__container__buy-content__inner__buy-form__list__table
168
+
169
+ %li.confirmation-main__container__buy-content__inner__buy-form__list__table__list
170
+
171
+ .confirmation-main__container__buy-content__inner__buy-form__list__table__list__left-text
172
+
173
+ 支払い金額
174
+
175
+ .confirmation-main__container__buy-content__inner__buy-form__list__table__list__right-text
176
+
177
+ ¥
178
+
179
+ = @item.price
180
+
181
+ = form_with url: pay_purchase_index_path(@item.id), method: :post, local: true do |f|
182
+
183
+ =f.submit "購入する",data: {"turbolinks" => false} ,class: "btn linkbtn"
184
+
185
+ -# 配送先とユーザーの住所
186
+
187
+ %section.confirmation-main__container__buy-info
188
+
189
+ .confirmation-main__container__buy-info__container
190
+
191
+ %h3 配送先
192
+
193
+ %address.confirmation-main__container__buy-info__container__address
194
+
195
+ .confirmation-main__container__buy-info__container__address__postal-code
196
+
197
+
198
+
199
+ = @user.post_code
200
+
201
+ .confirmation-main__container__buy-info__container__address__address-name
202
+
203
+ = @user.address_prefecture
204
+
205
+ = @user.address_city
206
+
207
+ = @user.address_number
208
+
209
+
210
+
211
+ .confirmation-main__container__buy-info__container__address__user-name
212
+
213
+ = @user.address_last_name
214
+
215
+ = @user.address_first_name
216
+
217
+
218
+
219
+ =link_to "/purchase/show", class: 'confirmation-main__container__buy-info__container__user-info-fix',method: :get do
220
+
221
+ %span 変更する >
222
+
223
+
224
+
225
+
226
+
227
+
228
+
229
+ -# クレジットカード情報
230
+
231
+ %section.confirmation-main__container__credit-info
232
+
233
+ .confirmation-main__container__credit-info__inner
234
+
235
+ %h3 支払い方法
236
+
237
+ - if @default_card_information.blank?
238
+
239
+ %br /
240
+
241
+ - else
242
+
243
+ .confirmation-main__container__credit-info__inner__card-number
244
+
245
+ = "**** **** **** " + @default_card_information.last4
246
+
247
+ .confirmation-main__container__credit-info__inner__deadline
248
+
249
+ - exp_month = @default_card_information.exp_month.to_s
250
+
251
+ - exp_year = @default_card_information.exp_year.to_s.slice(2,3)
252
+
253
+ = exp_month + " / " + exp_year
254
+
255
+ = image_tag '//www-mercari-jp.akamaized.net/assets/img/card/visa.svg?210491352', class: "confirmation-main__container__credit-info__inner__logo"
256
+
257
+ =link_to card_new_path, class: 'confirmation-main__container__buy-info__container__user-info-fix' do
258
+
259
+ %span 変更する >
260
+
261
+
262
+
263
+
264
+
265
+ -# merucariロゴフッター
266
+
267
+ = render 'shared/sub_footer'
268
+
269
+ ```

1

編集

2019/11/30 02:00

投稿

yakumo02
yakumo02

スコア103

test CHANGED
File without changes
test CHANGED
@@ -65,3 +65,9 @@
65
65
  =f.submit "購入する",data: {"turbolinks" => false} ,class: "btn linkbtn"
66
66
 
67
67
  ```
68
+
69
+
70
+
71
+ itemsテーブルのid2を取りたいです
72
+
73
+ ![イメージ説明](81840b4152e58aaa3fe967c5eeda558e.png)