>>>>> "cm" == Chris McCord <
ch...@chrismccord.com> writes:
cm> You’ve just described the `plug` concept at its core. So instead
cm> of multiple controllers, you would define plug modules that
cm> operation on the connection on its way to the (single)
cm> controller [...]
cm> Is that what you have in mind?
I think what I'm looking to do is almost the opposite of all that, but I
might be misunderstanding. Plugs seem to provide standardized
processing pre-controller function and then the controller adds its
unique work at the end of the pipeline. I'd like to do the unique work
first and have the end of the request cycle managed uniformly.
More concretely, if I have the router fragment
get "/", PageController, :index
get "/baz", FancyController, :baz
get "/quux", OtherController, :quux
I'd like to have FancyController.baz and OtherController.quux do what
they do (which isn't the same thing) and as the last statement in the
function call
PageController.index(conn, params)
and have PageController.index run and PageView manage the view, not
FancyView or OtherView (in fact, I'd like not to have FancyView or
OtherView at all but understand that the placeholders might be
necessary).
An external redirect would accomplish this -- with added latency -- but
the roundtrip to the browser adds no functionality when /baz and /quux
are idempotent.
Thanks for your quick response!
k.
--
Kevin Montuori
mont...@gmail.com