質問編集履歴
2
View部分のコードを減らしました
test
CHANGED
File without changes
|
test
CHANGED
@@ -170,18 +170,10 @@
|
|
170
170
|
|
171
171
|
<tr>
|
172
172
|
|
173
|
-
<th>注文番号</th>
|
174
|
-
|
175
|
-
<th>注文日時</th>
|
176
|
-
|
177
|
-
<th>ユーザー名</th>
|
178
|
-
|
179
173
|
<th>配達会社</th>
|
180
174
|
|
181
175
|
<th>配達業者<br>問い合わせ番号</th>
|
182
176
|
|
183
|
-
<th>配送状況</th>
|
184
|
-
|
185
177
|
</tr>
|
186
178
|
|
187
179
|
</thead>
|
@@ -192,13 +184,7 @@
|
|
192
184
|
|
193
185
|
<tr>
|
194
186
|
|
195
|
-
<td><%=order.order_no %></td><!--注文番号-->
|
196
|
-
|
197
|
-
<td><%= order.created_at.strftime("%Y/%m/%d") %></td><!--注文日時-->
|
198
|
-
|
199
|
-
<td><%= order.user.name %></td><!--ユーザー名-->
|
200
|
-
|
201
|
-
|
187
|
+
<%= order.d_vendor.name %><!--配送会社-->
|
202
188
|
|
203
189
|
<td><%= link_to '確認', "http://thira.plavox.info/transport/api/?t=#{order.d_vendor.for_api_name}&no=#{order.d_number}", target: "_blank" %></td><!--配送状況-->
|
204
190
|
|
1
controllerのコードを追加しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -14,6 +14,8 @@
|
|
14
14
|
|
15
15
|
|
16
16
|
|
17
|
+
|
18
|
+
|
17
19
|
###期待する動作
|
18
20
|
|
19
21
|
配送状況の確認のリンクを表示、機能させたい(別タブを開き確認できる)
|
@@ -138,9 +140,25 @@
|
|
138
140
|
|
139
141
|
|
140
142
|
|
141
|
-
|
143
|
+
app/controllers/orders_controllers.rb
|
144
|
+
|
142
|
-
|
145
|
+
```ruby
|
146
|
+
|
147
|
+
class OrdersController < ApplicationController
|
148
|
+
|
149
|
+
def index
|
150
|
+
|
151
|
+
@orders = Order.includes(:d_vendors).all.reverse_order
|
152
|
+
|
153
|
+
end
|
154
|
+
|
155
|
+
end
|
156
|
+
|
157
|
+
```
|
158
|
+
|
159
|
+
|
160
|
+
|
143
|
-
app/views/
|
161
|
+
app/views/orders/index.html.erb
|
144
162
|
|
145
163
|
```ruby
|
146
164
|
|