質問編集履歴

2

追加

2017/04/21 01:00

投稿

pecchan
pecchan

スコア555

test CHANGED
File without changes
test CHANGED
@@ -119,3 +119,79 @@
119
119
 
120
120
 
121
121
  宜しくお願い致します。
122
+
123
+
124
+
125
+
126
+
127
+ 2017/4/21 coffe scriptのエラー画像追加
128
+
129
+ returnを2つ記述するとエラーが出るようなのですが・・・。
130
+
131
+ ![イメージ説明](55e186fa764f649d527997ab569ce509.jpeg)
132
+
133
+
134
+
135
+
136
+
137
+ 2017/4/21 jsの読み込ませ方追加
138
+
139
+ jsは、
140
+
141
+ app\assets\javascripts以下にcommon.js.coffeeを置いています。内容は以下になります。
142
+
143
+ ```coffescript
144
+
145
+ document.addEventListener 'turbolinks:load', ->
146
+
147
+
148
+
149
+ $('.iframe_box').colorbox
150
+
151
+ iframe: true
152
+
153
+ innerWidth: 600
154
+
155
+ innerHeight: 600
156
+
157
+ return
158
+
159
+
160
+
161
+ $('a.colorbox').colorbox()
162
+
163
+ return
164
+
165
+
166
+
167
+
168
+
169
+ ```
170
+
171
+
172
+
173
+ 上記jsをapp\assets\javascripts\application.jsで
174
+
175
+ 読み込んでます
176
+
177
+ ```coffescript
178
+
179
+ //= require jquery
180
+
181
+ //= require jquery_ujs
182
+
183
+ //= require turbolinks
184
+
185
+ //= require_tree .
186
+
187
+ //= require bootstrap-sprockets
188
+
189
+ //= require data-confirm-modal
190
+
191
+ //= require cocoon
192
+
193
+ //= require jquery.colorbox
194
+
195
+ //= require common
196
+
197
+ ```

1

追加

2017/04/21 01:00

投稿

pecchan
pecchan

スコア555

test CHANGED
File without changes
test CHANGED
@@ -52,6 +52,20 @@
52
52
 
53
53
  ```
54
54
 
55
+ こっちでも一緒
56
+
57
+ 呼出し元
58
+
59
+ ```ruby
60
+
61
+ <%= link_to 'ポップアップのテスト', '/choice.html', class: 'iframe_box', data: { turbolinks: false } %>
62
+
63
+ ```
64
+
65
+
66
+
67
+
68
+
55
69
 
56
70
 
57
71
 
@@ -59,6 +73,26 @@
59
73
  実行させたいjs(app\assets\javascripts\common.js)
60
74
 
61
75
  ```javascript
76
+
77
+
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+ document.addEventListener 'turbolinks:load', ->
88
+
89
+ $('a.colorbox').colorbox()
90
+
91
+ return
92
+
93
+
94
+
95
+
62
96
 
63
97
  $ ->
64
98