Andrew Bloom wrote:
> Quite often I'm tasked with doing something very similar. Check out my
> solution:
> 
> class ExperiencesController < ApplicationController
>   self.view_paths << File.join(RAILS_ROOT, "cms", "experiences")
> 
>   def show
>     render :layout => "1/layout"
>   end
> end
> 
> requiring a folder structure like:
> RAILS_ROOT/
>   app/
>   cms/
>     experiences/
>       1/
>         layout.html.erb
>   config/
>   ...
> 
> Does that help?
> 
> On Oct 14, 4:25�pm, Matthew Rudy Jacobs <[EMAIL PROTECTED]

Hey thanks andrew,
that's the same thing I'm trying to achieve,
although the code as such won't quite work in Rails 2.1.1

it'll give you errors about "found a view path that is not in the right 
format"

the correct way is
  append_view_path(...)

and you pointed out my error

I was doing;
  append_view_path("public/sites")

while actually what is required;
  append_view_path(File.join(Rails.root, "public", "sites"))

works great, it seems.
Thanks.
-- 
Posted via http://www.ruby-forum.com/.

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

Reply via email to