Learn How To Create A Ruby On Rails Calendar

In this article, we are going to learn how to create a calendar with ruby on rails. Ruby on Rails already come with ready-made modules, plugins that help developers save time. Ruby On Rails is an open source framework under the MIT license that can be used to design a number of different applications. Calendar is a simple but effective app to learn RoR basics. It shows the fundamentals of the framework and also allows you to easily add your own functionality. Rails can work with multiple types of servers and database.

To start the application, you need to install rails installer on your system. You can download rails installer from http://railsinstaller.org/en and follow the instructions to install it on your system.

After completing the installation of railsinstaller, this will create sites folder on your C drive. Open the command prompt as an administrator and go to sites folder. Create an application using below command

1

rails newcalendar

This command will create some plugins, models, views, etc. in your application as shown below:

Go to the calendar folder and run the command below to start the server

1

Railss

You will see the server will start running on localhost:3000 as shown below.

Open “C:\Sites\calendar\lib” location and create “calendar.rb” file. Add the code below in the calendar.rb file. Save and Close.

Now, let’s include bootstrap to our application. In this application, we are loading bootstrap from Yandex’s CDN. You can also apply your own stylesheet for this application. Open the application.html.erb file from the “C:\Sites\calendar\app\views\layouts” location and modify the code.

Now, go to Command prompt once again and run the server with rails command and refresh your browser. You will see the calendar below.

1

Railss

In this blog, we will learn how to design a complete calendar from scratch on Ruby on Rails. While this is an extremely basic application, you can easily add more features to improve it’s functionality.