Getting the Hang of It
24 Jun 2016
Reading time ~1 minute
What I Did
- Internship Group Meeting: Project Naming Ceremony
- Refactored a few classes
- Paired with Eli to wrap up my password_resets resource (for almost 2 hours!@&#$^%!*)
What I Learned
- If an
ifblock’s conditional is
falseand no alternative is given, a rails controller action will attempt to render a view corresponding with the controller name, which results in a “template not found error” in many cases.
- Simply preventing a user from viewing a link to a protected page is obviously not enough to prevent a malicious user from accessing that page directly through a URL request. For this reason, one should double check things directly in controller actions.
- To efficiently debug code, one should run pry and test as many cases as possible in the console to discover the expected result and then modify code from there.
- I’ve realized that severely refactoring code without having written tests along the way is an extremely inefficient thing. After any major change I made, I had to manually check through all other functions to make sure I did not break anything, which I realize is completely ludicrous. If I want to refactor my code further (which is not a complete necessity), I ought to write an RSpec suite first.
- Form’s can be configured with specified URL redirect paths as well as specific parameters that may override the default params hash items.
- I think I’ve finally gotten the hang of how to go about working on new features with git while being able to properly rebase branches and merge properly in to master…finally.