Article:
 |
|
Rolling with Ruby on Rails Revisited, Part 2
|
| Subject: |
|
Destroy method does nothing. |
| Date: |
|
2007-08-16 13:39:50 |
| From: |
|
gbbailey78
|
|
|
|
Hi, I've followed the tutorial (very clear - thanks!) and all has gone swimmingly, apart from my attempts to delete. This is true for both categories and recipes. When I press delete it just goes back to the list.
In the recipe_controller I have:
def destroy
Recipe.find(params[:id]).destroy
redirect_to :action => 'list'
end
The following appears in my development log under the cookbook2 app.
Processing RecipeController#destroy (for 127.0.0.1 at 2007-08-16 21:26:52) [GET]
Session ID: d5109ae98d36e8f33bd0d0fbb0c3961e
Parameters: {"action"=>"destroy", "id"=>"2", "controller"=>"recipe"}
Redirected to http://localhost:3000/recipe/list
Filter chain halted as [#<ActionController::Filters::ClassMethods::ProcFilter:0x46cc0ec @filter=#<Proc:0x03da192c@C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/verification.rb:74>>] returned false.
Completed in 0.01500 (66 reqs/sec) | DB: 0.00000 (0%) | 302 Found [http://localhost/recipe/destroy/2]
Processing RecipeController#list (for 127.0.0.1 at 2007-08-16 21:26:52) [GET]
Session ID: d5109ae98d36e8f33bd0d0fbb0c3961e
Parameters: {"action"=>"list", "controller"=>"recipe"}
[4;35;1mRecipe Load (0.000000)[0m [0mSELECT * FROM recipes [0m
Rendering within layouts/application
Rendering recipe/list
[4;36;1mRecipe Columns (0.015000)[0m [0;1mSHOW FIELDS FROM recipes[0m
DEPRECATION WARNING: Passing :post as a link modifier is deprecated. Use :method => "post" instead. :post will be removed in Rails 2.0. See http://www.rubyonrails.org/deprecation for details. (called from convert_options_to_javascript! at C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/helpers/url_helper.rb:331)
[4;35;1mCategory Columns (0.000000)[0m [0mSHOW FIELDS FROM categories[0m
[4;36;1mCategory Load (0.000000)[0m [0;1mSELECT * FROM categories WHERE (categories.`id` = 2) [0m
DEPRECATION WARNING: Passing :post as a link modifier is deprecated. Use :method => "post" instead. :post will be removed in Rails 2.0. See http://www.rubyonrails.org/deprecation for details. (called from convert_options_to_javascript! at C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/helpers/url_helper.rb:331)
[4;35;1mCategory Load (0.000000)[0m [0mSELECT * FROM categories WHERE (categories.`id` = 5) [0m
DEPRECATION WARNING: Passing :post as a link modifier is deprecated. Use :method => "post" instead. :post will be removed in Rails 2.0. See http://www.rubyonrails.org/deprecation for details. (called from convert_options_to_javascript! at C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/helpers/url_helper.rb:331)
[4;36;1mCategory Load (0.000000)[0m [0;1mSELECT * FROM categories WHERE (categories.`id` = 5) [0m
Completed in 0.04700 (21 reqs/sec) | Rendering: 0.03200 (68%) | DB: 0.01500 (31%) | 200 OK [http://localhost/recipe/list]
It doesn't appear to be a permissions thing as I can quite happily delete the entries using mysql (although I must confess to having never used mysql before).
|
Showing messages 1 through 1 of 1.
-
Destroy method does nothing [SOLVED]
2007-08-16 13:44:40
gbbailey78
[View]
Firefox + scripts disabled = No delete.
Sorry!