Forum: Ruby on Rails Namespacing views simply and effectively?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
710eb9516d466362bc80a2f8d3c31cab?d=identicon&s=25 Chris Hanks (preciousbodilyfluids)
on 2009-06-05 00:35
So, to help arrange the files in my application directory, I used a tip
from this blog post:

http://m.onkey.org/2007/12/9/namespaced-models

Essentially, I moved all my controller, model and sweeper files into
folders with names that described their general purpose, and then put a
line like the following in environment.rb:

["accounts", "blog", "support"].each do |path|
  ["models", "controllers", "sweepers"].each do |component|
    config.load_paths += %W( #{RAILS_ROOT}/app/#{component}/#{path} )
  end
end

This worked out pretty well. Now, I want to figure out a way to do the
same with views. I've experimented a bit with putting them in the same
folders, under app/views, and pointing to them like:

before_filter { |controller| controller.view_paths = ["app/views/blog"]
}

But this gets very messy - Rails starts looking for layouts and partials
in the same place, even though those are shared among different parts of
the site and shouldn't be namespaced.

Does anyone have a suggestion? I have an annoyingly large number of view
folders and files, and I want to neaten them up a bit.

Thanks!
710eb9516d466362bc80a2f8d3c31cab?d=identicon&s=25 Chris Hanks (preciousbodilyfluids)
on 2009-06-05 21:13
Nobody has any ideas?
This topic is locked and can not be replied to.