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 […]
Archive | Software development
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 secure a web site using Let’s Encrypt and Apache
You probably already know Let’s Encrypt. It’s the new kid in town. It offers something that web site’s owners and administrators have been asking for a long time: free SSL certificates. Until now, if you wanted to secure a web site you had to go to the market and buy an SSL certificate from one of […]
A simple web service using PHP, JSON and MySQL
What is this post about? In today’s web and mobile apps web services are used to access someone else’s resources; this could be to communicate two processes over the network, get some data from a database or fire up a process in a remote host. Although there are still web services being developed based on technologies such […]
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 […]
Using the Google API client library for PHP
This post explains an example of use of the Google API client library for PHP, based on some code I have written recently. Introduction to Google API Google APIs Client Library for PHP provides access to many Google APIs. In this post I will show an example of use of the Google Directory API which will allow me […]
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 […]