× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

Basic Authentication for Ruby Sinatra Script

John Hamelink
Aug 29, 2014
<p><strong>Q: What was the request about? </strong></p><p>Josh was looking to extend a simple sinatra app into one with authentication. Through a discussion of his needs, it became clear that moving to rails would make things easier to maintain over time, and the abundance of authentication gems available would help save time and code maintenance.<br><br><strong>Q: How did you help with the request?</strong></p><p>I showed Josh how to create a ruby gem by demonstrating the base structure. Together, we refactored the existing codebase while filling out the gem and testing it. After we were done, Josh was able to run the existing code in complete isolation.</p><p>I helped Josh install Postgres on his computer, and I showed him how to install a new rails instance with a&nbsp;postgres configuration pre-installed.<br><br><strong>Q: Any best practices &amp; key learnings you can share?</strong></p><p>Separation of concerns is really important when building business logic - it can really help when testing and refactoring your code.</p>