質問編集履歴
2
スタックトレース追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -45,3 +45,51 @@
|
|
45
45
|
お分かりになるかた、助けてください。
|
46
46
|
|
47
47
|
以上よろしくお願いします。
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
スタックトレースは以下のように出力されています。
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
```ここに言語を入力
|
56
|
+
|
57
|
+
Rendered daily_stock_infos/index.html.erb within layouts/application (29.2ms)
|
58
|
+
|
59
|
+
Completed 500 Internal Server Error in 248ms
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
ActionView::Template::Error (nil is not a symbol):
|
64
|
+
|
65
|
+
57: <%= submit_tag 'submit'%>
|
66
|
+
|
67
|
+
58: <% end %>
|
68
|
+
|
69
|
+
59:
|
70
|
+
|
71
|
+
60: <%= @target_stock_detail_list.to_json.class%>
|
72
|
+
|
73
|
+
61:
|
74
|
+
|
75
|
+
62: <!-- チャート表示 -->
|
76
|
+
|
77
|
+
63: <%= hidden_field_tag 'candle_chart_data' ,@target_stock_detail_list %>
|
78
|
+
|
79
|
+
app/views/daily_stock_infos/index.html.erb:60:in `_app_views_daily_stock_infos_index_html_erb__3924945721297789072_70224501297900'
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
Rendered /opt/ruby/lib/ruby/gems/2.1.0/gems/actionpack-4.1.4/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.6ms)
|
86
|
+
|
87
|
+
Rendered /opt/ruby/lib/ruby/gems/2.1.0/gems/actionpack-4.1.4/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (0.7ms)
|
88
|
+
|
89
|
+
Rendered /opt/ruby/lib/ruby/gems/2.1.0/gems/actionpack-4.1.4/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb within rescues/layout (9.0ms)
|
90
|
+
|
91
|
+
```
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
```
|
1
コードボックス等見やすく変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -2,7 +2,9 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
+
Rails4の環境において、ActiveRecordのデータが入った変数をjsonに変換したいです。
|
6
|
+
|
5
|
-
|
7
|
+
view上で以下のようにコードを書いています。
|
6
8
|
|
7
9
|
```ここに言語を入力
|
8
10
|
|
@@ -10,7 +12,7 @@
|
|
10
12
|
|
11
13
|
```
|
12
14
|
|
13
|
-
これを実行
|
15
|
+
これを実行してActiveRecordが入っていることを確認済みです。
|
14
16
|
|
15
17
|
```ここに言語を入力
|
16
18
|
|
@@ -18,20 +20,28 @@
|
|
18
20
|
|
19
21
|
```
|
20
22
|
|
23
|
+
この時に@targetをjsonに変換したいのですが、どのような方法がありますか?
|
21
24
|
|
22
25
|
|
23
|
-
この時に@targetをjsonに変換したいのですが、どのような方法がありますか?
|
24
26
|
|
25
|
-
|
27
|
+
以下のようにすればよいのかと思ったのですが、
|
28
|
+
|
29
|
+
```ここに言語を入力
|
30
|
+
|
31
|
+
<%= @target.to_json.class%>
|
32
|
+
|
33
|
+
```
|
34
|
+
|
35
|
+
これを実行したところ、
|
36
|
+
|
37
|
+
```ここに言語を入力
|
26
38
|
|
27
39
|
nil is not a symbol
|
28
40
|
|
29
|
-
となってしまいます。
|
41
|
+
```となってしまいます。
|
30
42
|
|
31
43
|
|
32
44
|
|
33
|
-
|
45
|
+
お分かりになるかた、助けてください。
|
34
|
-
|
35
|
-
|
36
46
|
|
37
47
|
以上よろしくお願いします。
|