Learn_to_code


How did I learn to code

Make your React/Rails app alive with Heroku

It has been a long year and I’ve learned a lot in Flatiron Bootcamp. My last project was an App with React frontend and Rails Backend. Once I passed my final assessment I only had one question for my instructor “How do I make it alive?”. He suggested using Heroku, so I figured it would be an interesting topic to cover in my blog.


Front-end form validation in React

If you need to build a React app that connects to your Rails API, you should probably start building a back-end first. It would make sense to build the back-end first and have it render your data. You will need a database, controllers, and models. It’s good practice to make sure that the database can only accept valid data, therefore we would need to add validations and in Rails, validations are added to models. In my particular case, I needed to add validations to my Video model. I wanted to make sure that name, URL, category_id, and brand_id fields are present for each video record in my database. Also, I wanted to make sure that there are no duplicate names or URLs in my database, so I needed to validate the uniqueness of the name and URL.


Using cloneNode to save your time and sanity

When I was working on my JavaScript and Rails Project I was trying to build an interactive app, that will present information on the screen only when it was prompted to do so by the user.


Code, hit the error, find a workaround, and watch your time

Code, hit the error, find a workaround, and watch your time


My Sinatra Project discoveries

Thank you Brian Emory!

When I was planning my Sinatra Project, I was pretty confident in my idea (based on my work experience). I didn’t have any issues with Model-View-Controller (MVC) structure, as I already had a picture of my database in my mind. But there was some things that I was worried about (environment,config). Just before i started the project I learned that simple line of code will create complete Sinatra template with all files in the right places.