質問編集履歴

2

create

2017/02/28 06:39

投稿

kohekohe
kohekohe

スコア14

test CHANGED
File without changes
test CHANGED
@@ -172,6 +172,6 @@
172
172
 
173
173
 
174
174
 
175
- 現在デザインは上記のようになっておりますが、Updateした後にカテゴリーがDBに反映されません。
175
+ 現在デザインは上記のようになっておりますが、createした後にカテゴリーがDBに反映されません。
176
176
 
177
177
  もし、解決方法などがわかる方がおりましたらご教示いただければと存じます。よろしくお願いします。

1

ログ情報追加

2017/02/28 06:39

投稿

kohekohe
kohekohe

スコア14

test CHANGED
File without changes
test CHANGED
@@ -116,6 +116,62 @@
116
116
 
117
117
 
118
118
 
119
+ 操作時のログは以下です。
120
+
121
+
122
+
123
+ ```lang-terminal
124
+
125
+ Started POST "/admin/products" for ::1 at 2017-02-28 15:06:43 +0900
126
+
127
+ Processing by Admin::ProductsController#create as HTML
128
+
129
+ Parameters: {"utf8"=>"✓", "authenticity_token"=>"qGGzmXU9qmlh/beJywM2iXsKBS1p1bMFQocEg4X3peuNiE1Xvmm/ZMWt53CKy2uJZjtRpmAaKu/62CEnPB39zQ==", "product"=>{"name"=>"test", "price"=>"100", "category_products_attributes"=>{"0"=>{"category_id"=>"2"}}}, "commit"=>"Create Product"}
130
+
131
+ AdminUser Load (0.4ms) SELECT `admin_users`.* FROM `admin_users` WHERE `admin_users`.`id` = 1 ORDER BY `admin_users`.`id` ASC LIMIT 1
132
+
133
+ Unpermitted parameter: category_products_attributes
134
+
135
+ (0.2ms) BEGIN
136
+
137
+ SQL (5.1ms) INSERT INTO `products` (`name`, `price`, `created_at`, `updated_at`) VALUES ('test', 100, '2017-02-28 06:06:43', '2017-02-28 06:06:43')
138
+
139
+ (0.7ms) COMMIT
140
+
141
+ Redirected to http://localhost:3000/admin/products/2
142
+
143
+ Completed 302 Found in 36ms (ActiveRecord: 6.3ms)
144
+
145
+
146
+
147
+
148
+
149
+ Started GET "/admin/products/2" for ::1 at 2017-02-28 15:06:43 +0900
150
+
151
+ Processing by Admin::ProductsController#show as HTML
152
+
153
+ Parameters: {"id"=>"2"}
154
+
155
+ AdminUser Load (0.3ms) SELECT `admin_users`.* FROM `admin_users` WHERE `admin_users`.`id` = 1 ORDER BY `admin_users`.`id` ASC LIMIT 1
156
+
157
+ Product Load (0.4ms) SELECT `products`.* FROM `products` WHERE `products`.`id` = 2 LIMIT 1
158
+
159
+ (0.5ms) SELECT COUNT(*) FROM `active_admin_comments` WHERE `active_admin_comments`.`resource_type` = 'Product' AND `active_admin_comments`.`resource_id` = '2' AND `active_admin_comments`.`namespace` = 'admin'
160
+
161
+ CACHE (0.0ms) SELECT COUNT(*) FROM `active_admin_comments` WHERE `active_admin_comments`.`resource_type` = 'Product' AND `active_admin_comments`.`resource_id` = '2' AND `active_admin_comments`.`namespace` = 'admin' [["resource_type", "Product"], ["resource_id", "2"], ["namespace", "admin"]]
162
+
163
+ Rendered /Users/Kohei/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/bundler/gems/activeadmin-6966a84c950b/app/views/active_admin/resource/show.html.arb (264.0ms)
164
+
165
+ Completed 200 OK in 271ms (Views: 266.8ms | ActiveRecord: 1.3ms)
166
+
167
+
168
+
169
+ ```
170
+
171
+
172
+
173
+
174
+
119
175
  現在デザインは上記のようになっておりますが、Updateした後にカテゴリーがDBに反映されません。
120
176
 
121
177
  もし、解決方法などがわかる方がおりましたらご教示いただければと存じます。よろしくお願いします。