I recently finished making a simple site with Ruby on Rails. I did a Sinatra app quite a while ago, and in order to best compare/contrast Rails development, I decided to do this project in the same domain – a D&D character manager. I learned that while they are similar, Rails code tends to be much less verbose, and many, many things I thought annoying to do in Sinatra were actually very simplified in Rails. While it required a lot less code to do the same things, there was still a higher level of complexity and greater depth of knowledge needed to complete the similar project. It felt much more satisfying when figuring out the routing, and making sure a user could navigate and use the site successfully – doing away with a lot of the tedium that came with Sinatra.
Because I was using Rails this time around, I was also able to more easily make a secure site, and more easily validate and sanitize inputs from users. I was also able to incorporate omni-auth, which is a single-sign-on solution. This makes it more easy for new and existing users to log in, and also increases security – the fewer password hashes I need to keep server-side the better! This resource helped me a ton with figuring out user sign-ins.
My favorite thing about Rails is how easy it is to make RESTful routes, and easily use CRUD actions, once I had a firm idea of what I wanted users to be able to do. The conventions really feel ingrained into the framework, which is cool. Looking through my project, one other thing I loved about learning to use Rails was creating partial views, and rendering them in multiple other views. This made it so much more convenient to set up simple layouts and especially cut down on the hassle of having separate forms for creating and editing characters.
This project was a long time coming – I have been learning a lot of Javascript in the mean time – and kept coming back to it. It’s really satisfying to have it done. Soon, however, I’ll come back to it again, and add Javascript to cut down on page reloads, and make the site function a bit better overall. It should be fun to put some of those newer skills to use, and incorporate them back into this site.