Cool, José. I started working on decoupling rendering and controller.
For instance, AV::Renderer and friends shouldn't need a controller
instance. However, PartialRenderer relies on the controller - I don't
see the point why the PartialRenderer is responsible for finding a
template. Isn't that a concern for the LookupContext? I'd love to see
the *Renderer being Renderer and nothing more. Any thoughts on this?

In addition, is there any interesting in restructuring the view tests?
I'd move things and make it more obvious where to find what.

Nick

On 1 Mai, 15:40, José Valim <[email protected]> wrote:
> PS: This started as a personal conversation with Nick Sutterer and
> Aaron Patterson, but I am sending to this mailing list as I think
> others may find this information useful.
>
> Nick, I could not control myself and pushed some initial code about
> what we discussed. ;)
>
> Yehuda have already started and defined some time ago a module called
> ActionView::Context. If you want to behave as an ActionView::Context,
> all you need to do is to include this module:
>
> https://github.com/rails/rails/blob/master/actionpack/lib/action_view...
>
> In order to make this context as slim as possible, I have created the
> view_renderer (as we discussed):
>
> https://github.com/rails/rails/blob/master/actionpack/lib/action_view...
>
> Which is now used in the controller:
>
> https://github.com/rails/rails/blob/master/actionpack/lib/abstract_co...
>
> And here is an example of what is needed to render a controller
> sinatra style:
>
> https://github.com/rails/rails/blob/master/actionpack/test/controller...
>
> There is still a lot more to decouple:
>
> 1) There is still some controller - view context - view renderer
> coupling to iron out (but not a lot).
> 2) Test cases (AC::TestCase and AV::TestCase are extremely coupled).
> Particularly, AV::TestCase should be able to run against a minimal
> AV::Context.
> 3) Helpers are extremely coupled. If you try to use just one of the
> helpers in isolation, let's say AV::Helpers::FormHelper, it is likely
> that it will fail because it does not have many dependencies. Ideally,
> we would use ActiveSupport::Concern and make such dependencies
> explicit, as happens in ActionController modules.
>
> José Valimwww.plataformatec.com.br
> Founder and Lead Developer

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" 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-core?hl=en.

Reply via email to