Skip to content

Commit

Permalink
Added clarification for destroy link_to description in 5.14 [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
pftg committed Jun 29, 2013
1 parent 08f8c8a commit 17b01b8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions guides/source/getting_started.md
Expand Up @@ -1062,7 +1062,7 @@ You can call `destroy` on Active Record objects when you want to delete
them from the database. Note that we don't need to add a view for this them from the database. Note that we don't need to add a view for this
action since we're redirecting to the `index` action. action since we're redirecting to the `index` action.


Finally, add a 'destroy' link to your `index` action template Finally, add a 'Destroy' link to your `index` action template
(`app/views/posts/index.html.erb`) to wrap everything (`app/views/posts/index.html.erb`) to wrap everything
together. together.


Expand All @@ -1088,8 +1088,8 @@ together.
</table> </table>
``` ```


Here we're using `link_to` in a different way. We pass the named route as the first argument, Here we're using `link_to` in a different way. We pass the named route as the second argument,
and then the final two keys as another argument. The `:method` and `:'data-confirm'` and then the options as another argument. The `:method` and `:'data-confirm'`
options are used as HTML5 attributes so that when the link is clicked, options are used as HTML5 attributes so that when the link is clicked,
Rails will first show a confirm dialog to the user, and then submit the link with method `delete`. Rails will first show a confirm dialog to the user, and then submit the link with method `delete`.
This is done via the JavaScript file `jquery_ujs` which is automatically included This is done via the JavaScript file `jquery_ujs` which is automatically included
Expand Down

0 comments on commit 17b01b8

Please sign in to comment.