Rails Portfolio Project

  • Debug with Pry: Pry’s tag line of “Get to the code” is the most succinct explanation of Pry. Pry is a REPL developer console with a plethora of features — my favorite being the ability to dig into methods and their return values. Using Pry is as simple as adding Pry into your gemfile, adding ‘require pry’ to the top of your file, and finally add ‘binding.pry’ inside the method you’d like to take a deeper look into. Using Pry saved me countless hours in resolving “NoMethodError: undefined method for nil:NilClass” problems.
  • Devise: Devise is a useful gem that allows for flexible authentication. Devise is simple to use and consists of 10 modules that cover all aspects of user authentication, from sign-in to sign-up. Devise is also Omniauthable, which allows for sign-in from your favorite sites like GitHub, Gmail and Facebook. I applied Facebook with Omniauth as a third party authentication in my application.
  • Triple check your schema: I began my project by writing out all of my migrations and from there moved onto my controllers and views. One of the first errors I ran into was stemming from how I was defining an attribute of my User model. Rather than using ‘username’ I was applying ‘name’. Although this error was simple to resolve, I could have save myself time by looking at my schema prior to sketching out my controllers and views.
  • Spend time to plan out your project: One of the biggest challenges I tend to face in my projects is the desire to add everything and anything feature wise. Although I spent a few hours before any actual coding to map out what I wanted my application to look like I still managed to get bogged down within the first week of coding by trying to add in unnecessary features that did not relate to the provided specs. When you’re on a strict time schedule, going in circles over unneeded additions can be detrimental.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store