bloc referral

If you are interested in learning to code with a mentor, try bloc and get $100 off.

Tuesday, July 1, 2014

Rails Panel and Better Errors

I was told of another pretty nice tool to help in working with the legacy code at work. I find that trying to figure out where I am at in the app while debugging errors to be difficult. The main reason is due to the templates being named very similarly from page to page.







Chrome comes with an element inspector which works similar to rails panel to debug front end issues and discover the actual names of items in the asset pipeline. I am still very much a novice when it comes to working with assets and templates, and find it very helpful to be able to see the page interaction and found it very useful to write integration tests.

Another great tool is the Better Errors (you can debug in the browser!) that is used at work and both are explained in this short Railscast.
I am extremely blessed to be able to learn and use these new tools everyday and looking forward to sharing new tools as I learn them.

`git checkout --`
Another quick tips I wanted to add was the use of `git checkout`.  Most people might know that `git checkout . ` can be used to clear all changes to your code to your last git commit. I have found it very useful to practice writing code without any fear of breaking something, I can also revert back to the original state of the code if I mess things bad, but sometime I find I inadvertently make changes to files that I do not commit.

For example I sometime change the spacing of a file of play in a file while doing testing that does not need to be merged to the project. Instead of reverting to the original state of the code using the `period`. This week I started using `git checkout -- <filename>`, which only reverts that file.

I am sure I saw/used this tool before or maybe used it in a Code School video, but I have yet to use it till now and felt like I could share. so if you find yourself going through the Hartl tutorial and stuck on error, rather than starting completely over, just `checkout` the files.

Thanks for reading

No comments:

Post a Comment