Skip to content
This repository
Browse code

Remove `:confirm` in favor of `:data => { :confirm => 'Text' }` option

This applies to the following helpers:
`button_to`
`button_tag`
`image_submit_tag`
`link_to`
`submit_tag`
  • Loading branch information...
commit fb8a830a329b78a5863c1dbfb70a4005d3de60ec 1 parent c08f30f
Carlos Galdino authored June 01, 2012
4  actionpack/CHANGELOG.md
Source Rendered
... ...
@@ -1,5 +1,9 @@
1 1
 ## Rails 4.0.0 (unreleased) ##
2 2
 
  3
+*   Remove `:confirm` in favor of `:data => { :confirm => "Text" }` option for `button_to`, `button_tag`, `image_submit_tag`, `link_to` and `submit_tag` helpers.
  4
+
  5
+    *Carlos Galdino*
  6
+
3 7
 *   Show routes in exception page while debugging a `RoutingError` in development. *Richard Schneeman and Mattt Thompson*
4 8
 
5 9
 *   Add `ActionController::Flash.add_flash_types` method to allow people to register their own flash types. e.g.:
29  actionpack/lib/action_view/helpers/form_tag_helper.rb
@@ -382,9 +382,7 @@ def radio_button_tag(name, value, checked = false, options = {})
382 382
       # Creates a submit button with the text <tt>value</tt> as the caption.
383 383
       #
384 384
       # ==== Options
385  
-      # * <tt>:confirm => 'question?'</tt> - If present the unobtrusive JavaScript
386  
-      #   drivers will provide a prompt with the question specified. If the user accepts,
387  
-      #   the form is processed normally, otherwise no action is taken.
  385
+      # * <tt>:data</tt> - This option can be used to add custom data attributes.
388 386
       # * <tt>:disabled</tt> - If true, the user will not be able to use this input.
389 387
       # * Any other key creates standard HTML options for the tag.
390 388
       #
@@ -407,16 +405,12 @@ def radio_button_tag(name, value, checked = false, options = {})
407 405
       #   submit_tag "Edit", :class => "edit_button"
408 406
       #   # => <input class="edit_button" name="commit" type="submit" value="Edit" />
409 407
       #
410  
-      #   submit_tag "Save", :confirm => "Are you sure?"
  408
+      #   submit_tag "Save", :data => { :confirm => "Are you sure?" }
411 409
       #   # => <input name='commit' type='submit' value='Save' data-confirm="Are you sure?" />
412 410
       #
413 411
       def submit_tag(value = "Save changes", options = {})
414 412
         options = options.stringify_keys
415 413
 
416  
-        if confirm = options.delete("confirm")
417  
-          options["data-confirm"] = confirm
418  
-        end
419  
-
420 414
         tag :input, { "type" => "submit", "name" => "commit", "value" => value }.update(options)
421 415
       end
422 416
 
@@ -428,10 +422,7 @@ def submit_tag(value = "Save changes", options = {})
428 422
       # so this helper will also accept a block.
429 423
       #
430 424
       # ==== Options
431  
-      # * <tt>:confirm => 'question?'</tt> - If present, the
432  
-      #   unobtrusive JavaScript drivers will provide a prompt with
433  
-      #   the question specified. If the user accepts, the form is
434  
-      #   processed normally, otherwise no action is taken.
  425
+      # * <tt>:data</tt> - This option can be used to add custom data attributes.
435 426
       # * <tt>:disabled</tt> - If true, the user will not be able to
436 427
       #   use this input.
437 428
       # * Any other key creates standard HTML options for the tag.
@@ -452,10 +443,6 @@ def button_tag(content_or_options = nil, options = nil, &block)
452 443
         options ||= {}
453 444
         options = options.stringify_keys
454 445
 
455  
-        if confirm = options.delete("confirm")
456  
-          options["data-confirm"] = confirm
457  
-        end
458  
-
459 446
         options.reverse_merge! 'name' => 'button', 'type' => 'submit'
460 447
 
461 448
         content_tag :button, content_or_options || 'Button', options, &block
@@ -466,9 +453,7 @@ def button_tag(content_or_options = nil, options = nil, &block)
466 453
       # <tt>source</tt> is passed to AssetTagHelper#path_to_image
467 454
       #
468 455
       # ==== Options
469  
-      # * <tt>:confirm => 'question?'</tt> - This will add a JavaScript confirm
470  
-      #   prompt with the question specified. If the user accepts, the form is
471  
-      #   processed normally, otherwise no action is taken.
  456
+      # * <tt>:data</tt> - This option can be used to add custom data attributes.
472 457
       # * <tt>:disabled</tt> - If set to true, the user will not be able to use this input.
473 458
       # * Any other key creates standard HTML options for the tag.
474 459
       #
@@ -485,15 +470,11 @@ def button_tag(content_or_options = nil, options = nil, &block)
485 470
       #   image_submit_tag("agree.png", :disabled => true, :class => "agree_disagree_button")
486 471
       #   # => <input class="agree_disagree_button" disabled="disabled" src="/images/agree.png" type="image" />
487 472
       #
488  
-      #   image_submit_tag("save.png", :confirm => "Are you sure?")
  473
+      #   image_submit_tag("save.png", :data => { :confirm => "Are you sure?" })
489 474
       #   # => <input src="/images/save.png" data-confirm="Are you sure?" type="image" />
490 475
       def image_submit_tag(source, options = {})
491 476
         options = options.stringify_keys
492 477
 
493  
-        if confirm = options.delete("confirm")
494  
-          options["data-confirm"] = confirm
495  
-        end
496  
-
497 478
         tag :input, { "type" => "image", "src" => path_to_image(source) }.update(options)
498 479
       end
499 480
 
38  actionpack/lib/action_view/helpers/url_helper.rb
@@ -132,8 +132,7 @@ def url_for(options = nil)
132 132
       #     # posts_path
133 133
       #
134 134
       #   link_to(body, url_options = {}, html_options = {})
135  
-      #     # url_options, except :confirm or :method,
136  
-      #     # is passed to url_for
  135
+      #     # url_options, except :method, is passed to url_for
137 136
       #
138 137
       #   link_to(options = {}, html_options = {}) do
139 138
       #     # name
@@ -144,9 +143,7 @@ def url_for(options = nil)
144 143
       #   end
145 144
       #
146 145
       # ==== Options
147  
-      # * <tt>:confirm => 'question?'</tt> - This will allow the unobtrusive JavaScript
148  
-      #   driver to prompt with the question specified. If the user accepts, the link is
149  
-      #   processed normally, otherwise no action is taken.
  146
+      # * <tt>:data</tt> - This option can be used to add custom data attributes.
150 147
       # * <tt>:method => symbol of HTTP verb</tt> - This modifier will dynamically
151 148
       #   create an HTML form and immediately submit the form for processing using
152 149
       #   the HTTP verb specified. Useful for having links perform a POST operation
@@ -226,13 +223,15 @@ def url_for(options = nil)
226 223
       #   link_to "Nonsense search", searches_path(:foo => "bar", :baz => "quux")
227 224
       #   # => <a href="/searches?foo=bar&amp;baz=quux">Nonsense search</a>
228 225
       #
229  
-      # The two options specific to +link_to+ (<tt>:confirm</tt> and <tt>:method</tt>) are used as follows:
  226
+      # The only option specific to +link_to+ (<tt>:method</tt>) is used as follows:
230 227
       #
231  
-      #   link_to "Visit Other Site", "http://www.rubyonrails.org/", :confirm => "Are you sure?"
232  
-      #   # => <a href="http://www.rubyonrails.org/" data-confirm="Are you sure?"">Visit Other Site</a>
  228
+      #   link_to("Destroy", "http://www.example.com", :method => :delete)
  229
+      #   # => <a href='http://www.example.com' rel="nofollow" data-method="delete">Destroy</a>
  230
+      #
  231
+      # You can also use custom data attributes using the <tt>:data</tt> option:
233 232
       #
234  
-      #   link_to("Destroy", "http://www.example.com", :method => :delete, :confirm => "Are you sure?")
235  
-      #   # => <a href='http://www.example.com' rel="nofollow" data-method="delete" data-confirm="Are you sure?">Destroy</a>
  233
+      #   link_to "Visit Other Site", "http://www.rubyonrails.org/", :data => { :confirm => "Are you sure?" }
  234
+      #   # => <a href="http://www.rubyonrails.org/" data-confirm="Are you sure?"">Visit Other Site</a>
236 235
       def link_to(name = nil, options = nil, html_options = nil, &block)
237 236
         html_options, options = options, name if block_given?
238 237
         options ||= {}
@@ -255,10 +254,9 @@ def link_to(name = nil, options = nil, html_options = nil, &block)
255 254
       # to allow styling of the form itself and its children. This can be changed
256 255
       # using the <tt>:form_class</tt> modifier within +html_options+. You can control
257 256
       # the form submission and input element behavior using +html_options+.
258  
-      # This method accepts the <tt>:method</tt> and <tt>:confirm</tt> modifiers
259  
-      # described in the +link_to+ documentation. If no <tt>:method</tt> modifier
260  
-      # is given, it will default to performing a POST operation. You can also
261  
-      # disable the button by passing <tt>:disabled => true</tt> in +html_options+.
  257
+      # This method accepts the <tt>:method</tt> modifier described in the +link_to+ documentation.
  258
+      # If no <tt>:method</tt> modifier is given, it will default to performing a POST operation.
  259
+      # You can also disable the button by passing <tt>:disabled => true</tt> in +html_options+.
262 260
       # If you are using RESTful routes, you can pass the <tt>:method</tt>
263 261
       # to change the HTTP verb used to submit the form.
264 262
       #
@@ -269,9 +267,7 @@ def link_to(name = nil, options = nil, html_options = nil, &block)
269 267
       # * <tt>:method</tt> - Symbol of HTTP verb. Supported verbs are <tt>:post</tt>, <tt>:get</tt>,
270 268
       #   <tt>:delete</tt>, <tt>:patch</tt>, and <tt>:put</tt>. By default it will be <tt>:post</tt>.
271 269
       # * <tt>:disabled</tt> - If set to true, it will generate a disabled button.
272  
-      # * <tt>:confirm</tt> - This will use the unobtrusive JavaScript driver to
273  
-      #   prompt with the question specified. If the user accepts, the link is
274  
-      #   processed normally, otherwise no action is taken.
  270
+      # * <tt>:data</tt> - This option can be used to add custom data attributes.
275 271
       # * <tt>:remote</tt> -  If set to true, will allow the Unobtrusive JavaScript drivers to control the
276 272
       #   submit behavior. By default this behavior is an ajax submit.
277 273
       # * <tt>:form</tt> - This hash will be form attributes
@@ -311,7 +307,7 @@ def link_to(name = nil, options = nil, html_options = nil, &block)
311 307
       #
312 308
       #
313 309
       #   <%= button_to "Delete Image", { :action => "delete", :id => @image.id },
314  
-      #             :confirm => "Are you sure?", :method => :delete %>
  310
+      #                                   :method => :delete, :data => { :confirm => "Are you sure?" } %>
315 311
       #   # => "<form method="post" action="/images/delete/1" class="button_to">
316 312
       #   #      <div>
317 313
       #   #        <input type="hidden" name="_method" value="delete" />
@@ -321,8 +317,8 @@ def link_to(name = nil, options = nil, html_options = nil, &block)
321 317
       #   #    </form>"
322 318
       #
323 319
       #
324  
-      #   <%= button_to('Destroy', 'http://www.example.com', :confirm => 'Are you sure?',
325  
-      #             :method => "delete", :remote => true) %>
  320
+      #   <%= button_to('Destroy', 'http://www.example.com',
  321
+      #             :method => "delete", :remote => true, :data => { :confirm' => 'Are you sure?' }) %>
326 322
       #   # => "<form class='button_to' method='post' action='http://www.example.com' data-remote='true'>
327 323
       #   #       <div>
328 324
       #   #         <input name='_method' value='delete' type='hidden' />
@@ -627,10 +623,8 @@ def convert_options_to_data_attributes(options, html_options)
627 623
             html_options = html_options.stringify_keys
628 624
             html_options['data-remote'] = 'true' if link_to_remote_options?(options) || link_to_remote_options?(html_options)
629 625
 
630  
-            confirm = html_options.delete('confirm')
631 626
             method  = html_options.delete('method')
632 627
 
633  
-            html_options["data-confirm"] = confirm if confirm
634 628
             add_method_to_attributes!(html_options, method) if method
635 629
 
636 630
             html_options
11  actionpack/test/template/form_tag_helper_test.rb
@@ -382,7 +382,7 @@ def test_submit_tag
382 382
   def test_submit_tag_with_confirmation
383 383
     assert_dom_equal(
384 384
       %(<input name='commit' type='submit' value='Save' data-confirm="Are you sure?" />),
385  
-      submit_tag("Save", :confirm => "Are you sure?")
  385
+      submit_tag("Save", :data => { :confirm => "Are you sure?" })
386 386
     )
387 387
   end
388 388
 
@@ -437,10 +437,17 @@ def test_button_tag_with_block_and_options
437 437
     assert_dom_equal('<button name="temptation" type="button"><strong>Do not press me</strong></button>', output)
438 438
   end
439 439
 
  440
+  def test_button_tag_with_confirmation
  441
+    assert_dom_equal(
  442
+      %(<button name="button" type="submit" data-confirm="Are you sure?">Save</button>),
  443
+      button_tag("Save", :type => "submit", :data => { :confirm => "Are you sure?" })
  444
+    )
  445
+  end
  446
+
440 447
   def test_image_submit_tag_with_confirmation
441 448
     assert_dom_equal(
442 449
       %(<input type="image" src="/images/save.gif" data-confirm="Are you sure?" />),
443  
-      image_submit_tag("save.gif", :confirm => "Are you sure?")
  450
+      image_submit_tag("save.gif", :data => { :confirm => "Are you sure?" })
444 451
     )
445 452
   end
446 453
 
14  actionpack/test/template/url_helper_test.rb
@@ -90,7 +90,7 @@ def test_button_to_with_query_and_no_name
90 90
   def test_button_to_with_javascript_confirm
91 91
     assert_dom_equal(
92 92
       "<form method=\"post\" action=\"http://www.example.com\" class=\"button_to\"><div><input data-confirm=\"Are you sure?\" type=\"submit\" value=\"Hello\" /></div></form>",
93  
-      button_to("Hello", "http://www.example.com", :confirm => "Are you sure?")
  93
+      button_to("Hello", "http://www.example.com", :data => { :confirm => "Are you sure?" })
94 94
     )
95 95
   end
96 96
 
@@ -108,7 +108,7 @@ def test_button_to_with_remote_and_form_options
108 108
   def test_button_to_with_remote_and_javascript_confirm
109 109
     assert_dom_equal(
110 110
       "<form method=\"post\" action=\"http://www.example.com\" class=\"button_to\" data-remote=\"true\"><div><input data-confirm=\"Are you sure?\" type=\"submit\" value=\"Hello\" /></div></form>",
111  
-      button_to("Hello", "http://www.example.com", :remote => true, :confirm => "Are you sure?")
  111
+      button_to("Hello", "http://www.example.com", :remote => true, :data => { :confirm => "Are you sure?" })
112 112
     )
113 113
   end
114 114
 
@@ -208,15 +208,15 @@ def test_link_tag_with_custom_onclick
208 208
   def test_link_tag_with_javascript_confirm
209 209
     assert_dom_equal(
210 210
       "<a href=\"http://www.example.com\" data-confirm=\"Are you sure?\">Hello</a>",
211  
-      link_to("Hello", "http://www.example.com", :confirm => "Are you sure?")
  211
+      link_to("Hello", "http://www.example.com", :data => { :confirm => "Are you sure?" })
212 212
     )
213 213
     assert_dom_equal(
214 214
       "<a href=\"http://www.example.com\" data-confirm=\"You can't possibly be sure, can you?\">Hello</a>",
215  
-      link_to("Hello", "http://www.example.com", :confirm => "You can't possibly be sure, can you?")
  215
+      link_to("Hello", "http://www.example.com", :data => { :confirm => "You can't possibly be sure, can you?" })
216 216
     )
217 217
     assert_dom_equal(
218 218
       "<a href=\"http://www.example.com\" data-confirm=\"You can't possibly be sure,\n can you?\">Hello</a>",
219  
-      link_to("Hello", "http://www.example.com", :confirm => "You can't possibly be sure,\n can you?")
  219
+      link_to("Hello", "http://www.example.com", :data => { :confirm => "You can't possibly be sure,\n can you?" })
220 220
     )
221 221
   end
222 222
 
@@ -265,14 +265,14 @@ def test_link_tag_using_post_javascript_and_rel
265 265
   def test_link_tag_using_post_javascript_and_confirm
266 266
     assert_dom_equal(
267 267
       "<a href=\"http://www.example.com\" data-method=\"post\" rel=\"nofollow\" data-confirm=\"Are you serious?\">Hello</a>",
268  
-      link_to("Hello", "http://www.example.com", :method => :post, :confirm => "Are you serious?")
  268
+      link_to("Hello", "http://www.example.com", :method => :post, :data => { :confirm => "Are you serious?" })
269 269
     )
270 270
   end
271 271
 
272 272
   def test_link_tag_using_delete_javascript_and_href_and_confirm
273 273
     assert_dom_equal(
274 274
       "<a href='\#' rel=\"nofollow\" data-confirm=\"Are you serious?\" data-method=\"delete\">Destroy</a>",
275  
-      link_to("Destroy", "http://www.example.com", :method => :delete, :href => '#', :confirm => "Are you serious?"),
  275
+      link_to("Destroy", "http://www.example.com", :method => :delete, :href => '#', :data => { :confirm => "Are you serious?" }),
276 276
       "When specifying url, form should be generated with it, but not this.href"
277 277
     )
278 278
   end
4  guides/code/getting_started/app/views/comments/_comment.html.erb
@@ -10,6 +10,6 @@
10 10
 
11 11
 <p>
12 12
   <%= link_to 'Destroy Comment', [comment.post, comment],
13  
-               :confirm => 'Are you sure?',
14  
-               :method => :delete %>
  13
+               :method => :delete,
  14
+               :data => { :confirm => 'Are you sure?' } %>
15 15
 </p>
2  guides/code/getting_started/app/views/posts/index.html.erb
@@ -17,7 +17,7 @@
17 17
     <td><%= post.text %></td>
18 18
     <td><%= link_to 'Show', :action => :show, :id => post.id %>
19 19
     <td><%= link_to 'Edit', :action => :edit, :id => post.id %>
20  
-    <td><%= link_to 'Destroy', { :action => :destroy, :id => post.id }, :method => :delete, :confirm => 'Are you sure?' %>
  20
+    <td><%= link_to 'Destroy', { :action => :destroy, :id => post.id }, :method => :delete, :data => { :confirm => 'Are you sure?' } %>
21 21
   </tr>
22 22
 <% end %>
23 23
 </table>
9  guides/source/ajax_on_rails.textile
Source Rendered
@@ -129,7 +129,7 @@ will produce
129 129
 
130 130
 <ruby>
131 131
 button_to 'Delete Image', { action: 'delete', id: @image.id },
132  
-             confirm: 'Are you sure?', method: :delete
  132
+             method: :delete, data: { confirm: 'Are you sure?' }
133 133
 </ruby>
134 134
 
135 135
 will produce
@@ -144,8 +144,8 @@ will produce
144 144
 </html>
145 145
 
146 146
 <ruby>
147  
-button_to 'Destroy', 'http://www.example.com', confirm: 'Are you sure?',
148  
-             method: 'delete', remote: true, data: { disable_with: 'loading...' }
  147
+button_to 'Destroy', 'http://www.example.com',
  148
+             method: 'delete', remote: true, data: { disable_with: 'loading...', confirm: 'Are you sure?' }
149 149
 </ruby>
150 150
 
151 151
 will produce
@@ -217,7 +217,6 @@ link_to_remote "Delete the item",
217 217
 Note that if we wouldn't override the default behavior (POST), the above snippet would route to the create action rather than destroy.
218 218
 
219 219
 ** *JavaScript filters* You can customize the remote call further by wrapping it with some JavaScript code. Let's say in the previous example, when deleting a link, you'd like to ask for a confirmation by showing a simple modal text box to the user. This is a typical example what you can accomplish with these options - let's see them one by one:
220  
-*** +:confirm+ =&gt; +msg+ Pops up a JavaScript confirmation dialog, displaying +msg+. If the user chooses 'OK', the request is launched, otherwise canceled.
221 220
 *** +:condition+ =&gt; +code+ Evaluates +code+ (which should evaluate to a boolean) and proceeds if it's true, cancels the request otherwise.
222 221
 *** +:before+ =&gt; +code+ Evaluates the +code+ just before launching the request. The output of the code has no influence on the execution. Typically used show a progress indicator (see this in action in the next example).
223 222
 *** +:after+ =&gt; +code+ Evaluates the +code+ after launching the request. Note that this is different from the +:success+ or +:complete+ callback (covered in the next section) since those are triggered after the request is completed, while the code snippet passed to +:after+ is evaluated after the remote call is made. A common example is to disable elements on the page or otherwise prevent further action while the request is completed.
@@ -307,4 +306,4 @@ JavaScript testing reminds me the definition of the world 'classic' by Mark Twai
307 306
 * Cucumber+Webrat
308 307
 * Mention stuff like screw.unit/jsSpec
309 308
 
310  
-Note to self: check out the RailsConf JS testing video
  309
+Note to self: check out the RailsConf JS testing video
17  guides/source/getting_started.textile
Source Rendered
@@ -1144,7 +1144,7 @@ together.
1144 1144
     <td><%= post.text %></td>
1145 1145
     <td><%= link_to 'Show', :action => :show, :id => post.id %></td>
1146 1146
     <td><%= link_to 'Edit', :action => :edit, :id => post.id %></td>
1147  
-    <td><%= link_to 'Destroy', { :action => :destroy, :id => post.id }, :method => :delete, :confirm => 'Are you sure?' %></td>
  1147
+    <td><%= link_to 'Destroy', { :action => :destroy, :id => post.id }, :method => :delete, :data => { :confirm => 'Are you sure?' } %></td>
1148 1148
   </tr>
1149 1149
 <% end %>
1150 1150
 </table>
@@ -1152,13 +1152,12 @@ together.
1152 1152
 
1153 1153
 Here we're using +link_to+ in a different way. We wrap the
1154 1154
 +:action+ and +:id+ attributes in a hash so that we can pass those two keys in
1155  
-first as one argument, and then the final two keys as another argument. The +:method+ and +:confirm+
  1155
+first as one argument, and then the final two keys as another argument. The +:method+ and +:'data-confirm'+
1156 1156
 options are used as HTML5 attributes so that when the link is clicked,
1157  
-Rails will first show a confirm dialog to the user, and then submit the
1158  
-link with method +delete+. This is done via the JavaScript file +jquery_ujs+
1159  
-which is automatically included into your application's layout
1160  
-(+app/views/layouts/application.html.erb+) when you generated the application.
1161  
-Without this file, the confirmation dialog box wouldn't appear.
  1157
+Rails will first show a confirm dialog to the user, and then submit the link with method +delete+.
  1158
+This is done via the JavaScript file +jquery_ujs+ which is automatically included
  1159
+into your application's layout (+app/views/layouts/application.html.erb+) when you
  1160
+generated the application. Without this file, the confirmation dialog box wouldn't appear.
1162 1161
 
1163 1162
 !images/getting_started/confirm_dialog.png(Confirm Dialog)!
1164 1163
 
@@ -1627,8 +1626,8 @@ So first, let's add the delete link in the
1627 1626
 
1628 1627
 <p>
1629 1628
   <%= link_to 'Destroy Comment', [comment.post, comment],
1630  
-               :confirm => 'Are you sure?',
1631  
-               :method => :delete %>
  1629
+               :method => :delete,
  1630
+               :data => { :confirm => 'Are you sure?' } %>
1632 1631
 </p>
1633 1632
 </erb>
1634 1633
 
2  guides/source/layouts_and_rendering.textile
Source Rendered
@@ -78,7 +78,7 @@ If we want to display the properties of all the books in our view, we can do so
78 78
     <td><%= book.content %></td>
79 79
     <td><%= link_to "Show", book %></td>
80 80
     <td><%= link_to "Edit", edit_book_path(book) %></td>
81  
-    <td><%= link_to "Remove", book, :confirm => "Are you sure?", :method => :delete %></td>
  81
+    <td><%= link_to "Remove", book, :method => :delete, :data => { :confirm => "Are you sure?" } %></td>
82 82
   </tr>
83 83
 <% end %>
84 84
 </table>
2  railties/lib/rails/generators/erb/scaffold/templates/index.html.erb
@@ -19,7 +19,7 @@
19 19
   <% end -%>
20 20
       <td><%%= link_to 'Show', <%= singular_table_name %> %></td>
21 21
       <td><%%= link_to 'Edit', edit_<%= singular_table_name %>_path(<%= singular_table_name %>) %></td>
22  
-      <td><%%= link_to 'Destroy', <%= singular_table_name %>, confirm: 'Are you sure?', method: :delete %></td>
  22
+      <td><%%= link_to 'Destroy', <%= singular_table_name %>, method: :delete, data: { confirm: 'Are you sure?' } %></td>
23 23
     <%% end %>
24 24
   </tbody>
25 25
 </table>

0 notes on commit fb8a830

Please sign in to comment.
Something went wrong with that request. Please try again.