I had been in troubles setting up some relationships… in Rails too. Just to avoid the same headhecks in the future I decided to write this post. This code is supposed to help me (and you!) to make things easier next time. The code has been tested on ruby-2.3.0 and Rails 5.0.2. One_to_many relationship As an […]
Tag Archives | ruby on rails
Test a model in Rails 5 using Rspec in 3 steps
I create a basic Rails 5 application, add an scaffold and create some basic tests on the model. I use RSpec for the test environment, Factory Girl for the factories and Faker to generate some test data. Ready? Let’s go!. Step 1. Prepare the basic infrastructure I’am using RVM to keep the Rails’ versions under control, […]
Code for fun! Create a Rails API
Introduction The use of the term Application Programming Interface, or API, is very common in the computer community. My interest in this post is focused on the Web APIs or, in other words, the tools used by web communities to facilitate sharing content and data between communities and applications So let’s share some data in […]
How to develop a Rails app using Github and Nitrous
Why to try Nitrous, another tool in town? One thing that I believe is crucial in the software development field is the collaboration among developers. As a programmer you should be able to easily show your code to your colleagues either because you need to comment some feature, to check your objects’ design or for whatever other reason you can […]
Deploy your first Rails 4.0 app on Heroku using Vagrant
Introduction This post describes how to develop a simple Rails 4.0 application using Vagrant, and how to deploy it to Heroku. In a previous post I have already described how to configure a development environment for Rails using Vagrant. Please check the post if you have problems installing the development environment. The application used on this example is just […]
How to configure a development environment for Rails using Vagrant
Vagrant is a tool to manage the set up and the configuration of virtual machines, quite useful if you are a developer in Ruby on Rails. Vagrant allows you to use a set of hypervisors to run your virtual machines, such as VMware or AWS. On its default configuration it uses VirtualBox, a free tool from Oracle […]