Translate

Friday, September 2, 2016

Rails - How to enable asset pipeline in development


Sometimes, for debugging purpose, it can be quite helpful to enable the Rails assets pipeline in development model.


to do this, go to config/enviroments/development.rb and add the following configuration:

config.assets.debug = false
config.assets.compile = false
config.assets.digest = true

An important thing to keep in mind is be sure  to have  config.assets.debug = true (the default setting) is disabled.

Finally, you only need to restart your server and then run:

rake assets:precompile

Git: How to rename a branch


To rename a branch created locally, what you need to do is:


  • First, go to the branch you want to rename:
git checkout my_branch_1
  • then, rename your current branch by typing the following command:
git branch -m my_new_name_branch_2



if you display all branches (git branch) you will in green color the new name of your branch

GIT: How to delete last commit?



To undo or delete a commit previously done, just type the following command in your console:


git reset --hard HEAD~1