Ironhack journal - Week[4]

Estimated reading time: ~4 mins

Ruby on Rails

On monday we had the opportunity to meet Patricia Gao currently working as Rails Back-end Developer at Cabify.

She started introducing us what is Ruby on Rails, a Ruby framework, what is cool about Rails is that it makes web applications using HTML, CSS, and JavaScript that runs on a web server.

We also learnt what is an MVC (model–view–controller) framework:

It went from 0 to 30, now; a week before I have the feeling that this week was the best one so far, slow but consistently growing. My strategy was to learn the small but unconnected chunks of Rails and in the last few days I put the parts together and make something. That said I’m more a visual person, thats why I like more Front-end but seems that Ruby would be good for side projects.

I still need tons of practice to be able to express what is in my mind, but felt pretty good about myself. Even with a little experience of programming, I found Ruby on Rails powerful and it blew my mind.

In this journey, one of things that I have been focusing is to keep my excitement and spirit high. Seriously I still can’t believe that I am actually enjoying the overall experience.

More than 50% of the program is already over while writing this blog post, we are on Wednesday of the 5th week.

One good thing about Monday morning was that we had time to ask lot of questions because we finished the lesson twenty minutes before one o’clock.

Monday recap

On Tuesday at 18:30h, I went to a non Ironhack Meetup, actually a Front-end Developers Madrid Meetup. They’ve talked about Google Analytics, it was such a great event.

Tuesday recap

On Wednesday some of the Ironhackers had a Yoga class (see photograph below), and a twenty User Experience talk (so short). As I’m not a Yoga guy, I went home to review the lesson and exercises.

Yoga time

Wednesday and Thursday recap

On Friday I had a one-on-one meeting with Raul who gave me feedback about how I’m doing in the Bootcamp. He told me that I have typo errors and problems finding them. He also told me that I know more than I think which is something interesting to keep in mind.

I’ve found something interesting this week. Rails give IDs to some elements automatically and this is not a good practice! I.E:

<input type="text" name="project[name]" id="project_name">

We’ve been doing with Patricia a Timetracking weekly project.

The Podcast is in Spanish.

I’ve also published yesterday WeCodeSign Podcast - 1x05 about UX & UI.

I’ve maded a Rails Cheetsheet for everyone who likes to start with a new project.

New project Cheetsheet

rails new 'name_of_the_project'=> It creates a new folder with the skeleton of the project inside

New controller

rails g controller 'name_of_the_controller' => Plural, 1st in MixedCase

New model

rails g model "name_of_the_model" => Singular, MixedCase


rake db:create => starts the Data Base

dake db:migrate => Rails then adds it to an internal list of migrations that you have, so that it can tell whether they are pending or have been run already.

rails g migration < migration_name > 'attribute:type' => When you generate a migration yourself.

rake db:rollback => Destroy the migration

Add username to User model

rails g migration add_username_to_users username:string

Remode username to User model

rails g migration remove_username_from_users username:string

Add price to Product model

rails g migration add_price_to_products price:float

Remove price from Product model

rails g migration remove_price_from_products price:float

Add shipping details to Order model

rails g migration add_shipping_details_to_orders user_id:integer address:string phone_number:string

Remove shipping details from Order model

rails g migration remove_shipping_details_from_orders user_id:integer address:string phone_number:string

Here are some of the most used migration commands that you will see.


rename_column :<table>, :<current_column_name>, :<new_column_name>

rails g migration fix_brand_name_in_cars

So, I’m a happy Ruby developer this week.

See you in a week!

This post was written under: