On Dec 12, 2005, at 5:01 PM, Kyle Maxwell wrote:

Sounds pretty reasonable to me.  Couple thoughts:

I know that the Globalize plugin uses template.en-US.rhtml,
template.es-MX.rhtml, etc.  To me this is preferable to
en-US/template.rhtml.  That would lead to a lot of extra folders lying
about.  Can we use a patch like this to enable this behavior?  This is
a minor concern, but one I think others would raise too.

Should this be specified on an application-wide basis, or on a
request-by-request basis, perhaps mediated by before_filters?

Kyle

Interesting idea, Kyle.

I think the best way to accomplish what you're suggesting is some way of embedding a 'proc' in to the alternate path array. So, in essence, while my patch would currently allow someone to do this:

ActionView.alternate_base_paths_before << RAILS_ROOT + '/special/ location'

We should enable people to use it like this also:

ActionView.alternate_base_paths_before << proc { |controller| RAILS_ROOT + "/app/views/#{controller.language}/" }

This makes use of the folder method (instead of the filename method) that you seemed to not prefer as much, but it would be a lot easier to implement. As you suggested, the above method would rely on some before_filter setting a cattr_attribute (such as :language) so that our base path could be configured on a per-request basis.

Duane Johnson
(canadaduane)
_______________________________________________
Rails-core mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-core

Reply via email to