I would like to set up a pair of style guides for the admin and public sections of a website.
Each will need its own layout which will contain a mixture of static ht
I wanted to do something really stupid once, so if you do too, try this working example.
match :movedpage, :to => proc { |env|
if Rails.env.production?
@remote_path = 'http://productionhost.com'
elsif Rails.env.staging?
@remote_path = 'http://staginghost.com'
else
@remote_path = 'http://localhost:3000'
end
[
200,
{"Content-Type" => "text/html"},
[File.read("public/moved_page.html").gsub('@remote_path', @remote_path)]
]
}, :via => :all
Where moved_page.html was a static page asking people up update their bookmarks and @remote_path just typed in a link like @remote_path. Note that <%= %> won't work because you don't have view helpers in there.
So, theres enough rope to get yourself in trouble ^_^