On Aug 6, 3:35 pm, Gavi Grandea <[email protected]> wrote:
> Hi,
>
> I just want to clarify why DESTROY method isn't used by the generated codes
> of scaffolding.
Mainly because it is a destructive method, and most of the time you
won't allow everybody to delete a row in the database, especially when
there are associations.
Also because it uses a trick to get the right route.
>And if I want to use it, how would I call it on the ERB file?Thank you in
>advance.
See how it is done in the rubyweblog sample, you have it in the
controller, and you have it in the index view.
<td><%= link_to 'Destroy', post, :confirm => 'Are you sure?', :method
=> :delete %></td>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "ruby-on-rails-programming-with-passion" group.
To unsubscribe from this group, send email to
ruby-on-rails-programming-with-passion-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/ruby-on-rails-programming-with-passion?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---