Rails with JS Project

Rails with JavaScript Project

My Rails with JavaScript project is complete and I have my project review tonight. The hardest part of this project was refactoring my previous code that did not need to handle the use of JavaScript.

The real stickler throughout the project was updating the views for the pages I was going to use JavaScript with. Since I had to update the DOM via JS and use selectors to update certain elements, I had to restructure my HTML in the ERB files and remove a lot of Ruby code. I didn’t use a JS templating library, which would have probably made this a lot easier, although it would have taken a while to get setup.

JSON response for a user

Serving JSON from an API in Rails was really straightforward and very powerful. I used jQuery to get and post data since the vanilla JS section in Flatiron was a bit lacking and I didn’t feel comfortable using it the correct way. During my refactor I plan to convert the jQuery into vanilla JS and spend time learning it in-depth.

Overall I would say that this project was my least favorite so far. The project requirements were a bit strict and made me use JS for things I would have preferred to just use Ruby for. I think it would have been more fun to build a new Rails app. because it would have allowed me to plan and design properly regarding the use of JS. The next section is React which I am excited for!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.