Veske
Veske

Reputation: 557

Heroku messes up styles

I uploaded my app to heroku and suddenly everything is just changed, text is randomly aligned left and right while in my own server it's all in the middle just like I say'd it to.

What is going on with it?

Link to page so you can see whats going on: https://harjutus2.herokuapp.com

Edit: I have it aligned middle in css files and also in every p b and h2 element out of frustration to get it work. Plus my links are supposed to be colored blue but that's suddenly gone also.

Upvotes: 0

Views: 759

Answers (1)

Richard Peck
Richard Peck

Reputation: 76774

Your styles look good to me!


Assets

There's something you should know about Heroku's handling of styles. You have to precompile your assets before you deploy the app. Reason for this is to give the app a consistent feel, and reduces load on the Heroku dynos

Here's how to set it up:

#config/environments/production.rb
config.serve_static_assets = true
config.assets.compile = true

When you want to deploy to Heroku, you just need to run:

rake assets:precompile RAILS_ENV=production

This will precompile your styles, allowing you to keep them consistent on Heroku & locally

Upvotes: 2

Related Questions