Oooh... I'm gonna throw my own spin on this and say tha it should not be a
create... but instead a retrieve.  While it's true you might be "creating" a
new dump, you actually want to "GET" the configuration from the system.
Just like when you request a resource that might be XML,. you don't "create
a new dump of the objects in xml" , you request them as xml, and you call
@foos.to_xml, where Rails creates the XML on the fly and renders it.

So....

# routes.rb

map.resource :configuration

# configurations_controller.rb....

class ConfigurationsController < ApplicationController

  def show
     @some_model = SomeModel.build_configuration
     # some rendering to the view, or send_file, or send_data or whatever
  end

end

That, to me, seems the appropriate method. UNLESS you really are letting
people create a configuration that you want to persist somewhere for later
retrieval, then the create action might be appropriate.  But it sounds to me
like you really are doing a RETRIEVAL, so that sounds like GET
/configuration


On Thu, Oct 16, 2008 at 11:28 AM, Jeff <[EMAIL PROTECTED]> wrote:

>
> On Oct 16, 11:20 am, Digant Kasundra <[EMAIL PROTECTED]
> s.net> wrote:
> > I have a restful app which is laid out in true restful fashion. But I
> > need a way to dump all the info since the purpose of this app is to
> > generate a config file. Do I create a new model and have the index of
> > that do the dump?  I don't want to just iterate through the individual
> > records with Show bc I do need to run som logic over the sum of data.
> >
> > So do I just scaffold something called dump and have index of /dump
> > output the config file?
> > --
> > Posted viahttp://www.ruby-forum.com/.
>
> Sounds to me like you want a new controller with a create action to
> generate the config file.  That would be restful approach.
>
> Jeff
>
> purpleworkshops.com
> softiesonrails.com
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" 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/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to