Re: [Rails] [AWDR] Tutorial in A4 wont ‘destroy’ itemsThanks for the
explanation, Steven. Excellent information.
Best regards,
Bill
----- Original Message -----
From: Steven Chanin
To: [email protected]
Sent: Saturday, May 06, 2006 9:36 AM
Subject: Re: [Rails] [AWDR] Tutorial in A4 wont ‘destroy’ items
I believe that this is a change that came out in Rails 1.1.
In Rails 1.0 and before, the controllers generated by script generate
scaffold would accept destroy requests that came in via gets.
In Rails 1.1, the following code was added to the output from generate
scaffold:
# GETs should be safe (see
URIs, Addressability, and the use of HTTP GET and POST)
verify :method => :post, :only => [ :destroy, :create, :update ],
:redirect_to => { :action => :list }
I suspect this is causing the behavior you are seeing.
Steven Chanin
From: Dormanns M. [email protected]
Reply-To: [email protected]
Date: Fri, 5 May 2006 21:17:50 +0200
To: [email protected], [email protected]
Subject: Re: [Rails] [AWDR] Tutorial in A4 wont ‘destroy’ items
Just ran into this problem too. In case your probem is still open,
this is what solved it for me:
changed :confirm => ‘Are you sure?’ to :confirm => ‘Are you sure?’ ,
:post => true in the view. Scaffold generated controllers by default do
not accept database modifications with a get method.
Hope this helps,
Marcel.
On 4/30/06, Randy W. Sims [email protected] wrote:
Bill W. wrote:
> Hi Randy,
>
> Randy W. Sims wrote:
>
>> It looks like AdminController#destroy is not getting called.
>>
>
> The first line in your error log below shows that
> AdminController#destroy is in fact getting called. That's why I
> suggested you check the params value. Can you verify that you can
add,
> show, and edit an item but then are not able to delete that same
item?
> If so, did you copy/paste your code in your original post? Or did
you
> retype some of it? Lots of folks have worked through that
tutorial, so
> it’s probably something small. Hang in there!
Yeah, I have tried the code you posted with no results which is why
I
thought it wasn’t getting called. Show & Edit work properly, only
Destroy fails. They all get called with the same id. Destry works up
to
the point where I make the change to list.rhtml. It fails even when
I
copy & paste the code directly from the pdf.
Thanks,
Randy.
_______________________________________________
Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails
Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails
Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails