I am making one static website a day for 30 days, and I want to create a small Rails app to showcase these websites. I will be hosting this on Heroku. When I run my Rails app locally it works, but it won't work on Heroku.
I read the thread about rendering static HTML pages and got it to work! By simply making links directly to my public folder:
views/landings/index.html.erb
<ul>
<li>
<a href="../oneWebsiteADay/colorNotes/index.html">Color Notes</a>
</li>
<li>
<a href="../oneWebsiteADay/yeOldeMuffinShoppe/index.html">Ye Olde Muffin Shoppe</a>
</li>
</ul>
This works, and I am able to click the links and view the static websites in their entirety. When I deploy to Heroku though I receive the following error:
I have read all documentation Heroku provides about rendering static content with Rails and modified my configurations accordingly:
config/environments/production.rb
Rails.application.configure do
config.cache_classes = true
config.eager_load = true
config.consider_all_requests_local = true
config.action_controller.perform_caching = true
config.serve_static_assets = true
config.assets.js_compressor = :uglifier
config.assets.compile = true
config.assets.digest = true
config.log_level = :info
config.i18n.fallbacks = true
config.active_support.deprecation = :notify
config.log_formatter = ::Logger::Formatter.new
config.active_record.dump_schema_after_migration = false
end
But I am still receiving the error. Not sure what else to do at this point How do I display static HTML pages on heroku?
Routes:
Rails.application.routes.draw do
get "/", to: 'landings#index'
end