Hi All, In DHH keynote he mentioned that routes where going to be adjusted so that adding a file extension to a URL will override respond_to so that controller/action/thing.xml would automatically trigger the xml part of a respond_to in an action reguardless of what the accepts header says. Does anyone have any idea when this will be implemented? It doesn''t apppear to be in edge rails yet. Thanks, -- Dan Webb http://www.danwebb.net
Mislav Marohnić
2006-Jun-30 11:47 UTC
Re: Using file extensions to override respond_to behavior
Seems like a good feature. I would definately like to see this. There isn''t anything in trunk of this at the time of writing... that could mean that writing this hasn''t been started yet. It doesn''t seem hard to implement, though - you could hack the router to change the "accept" header in the request object to a corresponding MIME type, or extend the request object with a property that would later be looked up byActionController::MimeResponds -- Mislav On 6/30/06, Dan Webb <dan@danwebb.net> wrote:> > Hi All, > > In DHH keynote he mentioned that routes where going to be adjusted so > that adding a file extension to a URL will override respond_to so that > > controller/action/thing.xml > > would automatically trigger the xml part of a respond_to in an action > reguardless of what the accepts header says. > > Does anyone have any idea when this will be implemented? It doesn''t > apppear to be in edge rails yet._______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core
On 30/06/2006, at 8:52 PM, Dan Webb wrote:> In DHH keynote he mentioned that routes where going to be adjusted so > that adding a file extension to a URL will override respond_to so that > > controller/action/thing.xml > > would automatically trigger the xml part of a respond_to in an action > reguardless of what the accepts header says. > > Does anyone have any idea when this will be implemented? It doesn''t > apppear to be in edge rails yet.Rails edge + plugins/simply_restful works exactly as described. My suggestion would be to check out the plugin if there''s nothing in the core. -- tim lucas
Ah, so it''s implemented in simply restful...that makes sense. Cheers, Dan On 6/30/06, Tim Lucas <t.lucas@toolmantim.com> wrote:> On 30/06/2006, at 8:52 PM, Dan Webb wrote: > > > In DHH keynote he mentioned that routes where going to be adjusted so > > that adding a file extension to a URL will override respond_to so that > > > > controller/action/thing.xml > > > > would automatically trigger the xml part of a respond_to in an action > > reguardless of what the accepts header says. > > > > Does anyone have any idea when this will be implemented? It doesn''t > > apppear to be in edge rails yet. > > Rails edge + plugins/simply_restful works exactly as described. My > suggestion would be to check out the plugin if there''s nothing in the > core. > > -- tim lucas > > _______________________________________________ > Rails-core mailing list > Rails-core@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-core >-- Dan Webb http://www.danwebb.net
Actually, I''ve just realised it is in edge. You just need to add a route with :format in it. On 6/30/06, Dan Webb <dan@danwebb.net> wrote:> Ah, so it''s implemented in simply restful...that makes sense. > > Cheers, > > Dan > > On 6/30/06, Tim Lucas <t.lucas@toolmantim.com> wrote: > > On 30/06/2006, at 8:52 PM, Dan Webb wrote: > > > > > In DHH keynote he mentioned that routes where going to be adjusted so > > > that adding a file extension to a URL will override respond_to so that > > > > > > controller/action/thing.xml > > > > > > would automatically trigger the xml part of a respond_to in an action > > > reguardless of what the accepts header says. > > > > > > Does anyone have any idea when this will be implemented? It doesn''t > > > apppear to be in edge rails yet. > > > > Rails edge + plugins/simply_restful works exactly as described. My > > suggestion would be to check out the plugin if there''s nothing in the > > core. > > > > -- tim lucas > > > > _______________________________________________ > > Rails-core mailing list > > Rails-core@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-core > > > > > -- > Dan Webb > http://www.danwebb.net >-- Dan Webb http://www.danwebb.net