customizing global request handler
Thomas Lockney
tlockney at gmail.com
Wed Apr 18 13:19:08 EDT 2007
On 4/18/07, Jonas Pfenniger <zimbatm at oree.ch> wrote:
>
> Hi Carmen,
>
> to avoid patching Camping, I suggest you look into overriding the
> "service" method for the target controllers. You can do this in your
> main application module or by including a custom module in your
> controllers, as you prefer. Let me know if you need more hints.
I was going to suggest the same thing, but when I looked at it, it wasn't
clear if this would allow for grabbing data like the request headers
(allowing you to determine what form the submitted data takes). Based on the
code Carmen posted, it looks like the idea is to be able to use the same
controllers whether the data comes in from regular requests or as JSON data.
Granted, that could still be done in the controllers, but it does end up
being a bit less elegant.
--
Thomas Lockney | tlockney at gmail.com | http://opposable-thumbs.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/camping-list/attachments/20070418/bf3f649d/attachment.html
More information about the Camping-list
mailing list