Search code examples
ruby-on-railsrubyherokuassets

Rails Heroku app push and see changes


I would like to ask a question about heroku and rails. As I am kind of new to rails I want to know how it works with Heroku. I have an app and would like to push it to heroku.

I know that, rails takes all js/css files and compress when you are in production mode. My problem is, when I change js or css locally and push back to same heroku app, how rails handles these changes. It would be so stupid to destroy heroku app and push again.


Solution

  • Everytime you make changes to your application locally you should run "bundle exec rake assets:precompile RAILS_ENV=production". This will compile your assets in the public folder and then you should commit them to git . Then upon running "git push heroku master" you will see your new assets on the deployed app once it is reloaded.

    As far as destroying the app. goes, when pushing changes it is only restarted. Your database and all else are kept in tact.