El Friday 20 February 2009 18:49:41 Pradeep Gatram escribió:
> Hmmm,
>
> (Can I somehow post a small spike/poc project to illustrate what I am
> saying below?)
>
> After reading your reponses, I tried a simple spike. I created a new
> rails project with a single model and its controller.
>
> script/generate model foo name:string
> script/generate controller foo
>
> And edited the controller to
>
> class FooController < ApplicationController
>   active_scaffold :foo do |config|
>     config.actions.exclude :delete
>   end
> end
>
> After the usual db:migrate and db:fixtures:load stuff, I fired up my
> script/console. And as Sergio said
>
> >> FooController.new.respond_to? :delete
>
> => false
>
> BUT, when I fired up mongrel and type in
> http://localhost:3000/foo/delete/953125641?_method=get
>
> I see the familiar delete confirmation question!!! What is happening
> here? And Kenny, I have not added the delete/destroy methods anywhere
> in my controller. This is where I am stuck.

Rails render a view named as action even if you don't have a method for that 
action. But it's only rendering, not executing the action.

You can try it in other way:
1. Enter to http://localhost:3000/foo without excluding delete (to get delete 
links)
2. Exclude delete
3. Click in delete

It happens nothing. You can see log file and view has been rendered, but no 
sql to delete. You can refresh list and your record will be there.

-- 
Sergio Cambra .:: entreCables S.L. ::.
Nicolás Guillén 6, locales 2 y 3. 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) [email protected]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---

  • wh... Pradeep Gatram
    • ... Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::.
      • ... Kenny Ortmann
        • ... Pradeep Gatram
          • ... Pradeep Gatram
          • ... Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::.
            • ... Pradeep Gatram
              • ... Pradeep Gatram
                • ... Pradeep Gatram

Reply via email to