[Rails-core] Re: Sharing a resource's schema through REST

2007-04-25 Thread Eric Mill
> I'll make the patch to add these lines to the scaffold_resource generator. Here's the ticket with patch: http://dev.rubyonrails.org/ticket/8185 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core

[Rails-core] Re: Sharing a resource's schema through REST

2007-04-25 Thread Eric Mill
> Voila. Now the HTML response and the XML response refer to the same > object. The XML client gets the field names and types, and defaults > for the field values to boot. And we didn't even have to touch the > Rails core. Another reason this is good is that default values for attributes (at t

[Rails-core] Re: Sharing a resource's schema through REST

2007-04-25 Thread Eric Mill
> # GET /foos/new > # GET /foos/new.xml > def new > @foo = Post.new > > respond_to do |format| > format.html # new.erb > format.xml { render :xml => @foo.to_xml } > end > end > > Voila. Now the HTML response and the XML response refer to the same > object. The XM

[Rails-core] Re: Sharing a resource's schema through REST

2007-04-24 Thread Eric Mill
> Automatically generating a schema seems like overkill, given that the > schema for your models changes rarely, what's wrong with just a human > readable API doc page. Because that's a lot of work, and a standard format makes that work unneeded. The Beast forum doesn't need to publish an API do

[Rails-core] Re: Sharing a resource's schema through REST

2007-04-23 Thread Eric Mill
> I'm not necessarily sold on the idea of generating a particular schema > language, or even of generating a schema at all, but I do know that > inventing our own is something we should be very wary of. RelaxNG is a schema for *XML*, not for a *model*. This schema is only indirectly used to con

[Rails-core] Re: Sharing a resource's schema through REST

2007-04-23 Thread Eric Mill
> Okay. I see that my first patch was committed this morning (thanks > DHH) so this is the next logical step. Note that by itself, this > change enables nothing without a proper schema definition. Basically > it would be trading a little bit of aesthetics (e.g., datetime for > dateTime) for a l

[Rails-core] Sharing a resource's schema through REST

2007-04-20 Thread Eric Mill
rrent REST standard Rails is advocating? I think the most interesting part of this is the XML format, and I'd really like to form something the community agrees with as I construct a patch for this. -- Eric Mill --~--~-~--~~~---~--~~ You received this message becaus