DSP Project Report #3

Spring has arrived. Days getting warmer, the sun is shining, birds are singing. I’m not changing the profile of my blog to poetic, but these things are distracting me more and more.

Last week I had couple moments when quitting from contest went through my mind. It’s quite tempting, but I want to hold out to the end.

Fortunately, some progress has been made at FinanceGrinder project. Recently I’ve implemented adding new withdrawals functionality. It is quite simple for now, and similar to adding categories, but it will grow in later time.

Date Picker

Adding withdrawal form has 3 fields: Date, Amount, and User. The last one will be filled automatically in the background when logging in will be implemented.

I would like to focus on a Date field. I started with a simple text field, but typing date in the proper format by hand isn’t convenient. Next I changed it toHTMLs   <input type=”date” /> . It rendered nicely.

Date picker
HTML Date picker in Chrome.

I was able to switch date from a popup or set date using up and down buttons. But it works only on Chrome. Firefox, are you kidding me?! Come on, don’t be delayed. So I decided to use component provided by MaterializeCSS. It’s dead simple to implement.

in view file:

in javascript file:


After reloading page, we have a very nice popup with the readable picker. The most important thing for me is that it will behave in the same way on every modern browser.

That’s all for now. Not much, but commits are dropping constantly like raindrops from the roof on a rainy day. And poetry again…

DSP Project Report #2

It’s time to report my progress on the FinanceGrinder project. I’ve declared to publish reports weekly, so this one should be the third, but not much happened since last one. I didn’t have enough time to develop my application as much as I would like to. The day is too short…
It doesn’t mean that I didn’t do anything, some small progress has been made.
I have added a basic layout for application, for now, it is simple, standard MaterializeCSS layout: navbar with app name and menu, footer, and content between them.

FinanceGrinder - list of expenditure categories
FinanceGrinder – list of expenditure categories

Also, I’ve split the list of categories to distinguish incomes and expenses. Materialize provides a nice solution [link] for this.


When the categories are in place, I could finally create the most important table – transactions. This model will be responsible for orchestrating all incomes, withdrawals and later transactions between accounts.

FinanceGrinder - list of transactions
FinanceGrinder – list of transactions

For now, it’s just viewing the list of transactions. My next goal is to implement CRUD for them.


My intention is to build Minimal Viable Product with basic functionalities, publish demo and gather feedback from users. At first stage, the application can be ugly but should be efficient. I don’t want to build shiny GUI at the moment, I want to focus on main functionalities. I also would like to publish open demo as quick as it is possible.

Follow me on Twitter, Facebook or GitHub to stay up to date! 🙂

Starting a new Ruby on Rails project

In this post, I will shortly describe how to jumpstart Ruby on Rails based project. I am building a project called Finance Grinder and I’ll show you steps, that needs to be done to create new app. Also, I will describe gems (libraries), that I’ve chosen to use in my app.

How to start with Ruby on Rails
Ruby (programming language) with its most popular framework Rails don’t require many complicated steps, to start working with. You also don’t need to download gigabytes of software to install.
The Internet is full of detailed articles, tutorials, and videos about starting with RoR, so I will mention the most important, and show how I did it.
Step 1. Choose operating system
 You might be a little bit surprised of starting with that, but this is important. When you spend some time working with rails projects, you will know why.
Before ruby and rails installation you’ll need to the give effort to choose proper operating system. The best choice will be Linux or MacOS. Why not Windows? Well, it is true that all packages necessary to start can be installed on Windows (http://rubyinstaller.org), but sooner or later, I’m sure you’ll experience problems so frustrating, that you’ll switch to other OS. Therefore, better immediately install Linux on the separate partition or on a virtual machine.
I recommend Ubuntu. Maybe it is not the fastest, but most popular distribution.
Step 2. Installation of Ruby Version Manager

Before you’ll install ruby I recommend you to install Ruby Version Manager (RVM). This is a command-line tool which allows you to easily install, manage, and work with multiple ruby environments from interpreters to sets of gems. That’s a fair description from their site. To install it just run in the command line:

Step 3. Installation of Ruby On Rails
Now you can easily install the most important packages. First, you need to start with Ruby, so run a command:

RVM will download ruby, and install it. When the installation is completed you can verify it by running ruby -v. You should receive a version of installed ruby. Before rails installation, you need to select ruby in RVM and point namespace (RVM call it gemset) to install all gems (yes, rails also is a gem). You can grant your specific name to gemset. I will name it by name of my project (finance_grinder).

Now RVM knows where to store all libraries for your project, so install most important of them – rails:

This command will install Rails framework with its dependencies, so it will take a while. Once it will be finished check if it went correctly by running rails -v . It should return a number of newest version, for today it’s 5.0.2.
Before you fire up a new project, you need to install Bundler. It is a tool to manage, track and install exact versions of gems that are needed. Bundler  is some sort equivalent to Composer for PHP or npm for Node.js.

Step 4. Creating new, SHINY Rails project
Rails comes with a very handy package of generators, one of them is new project command:

After hitting the enter button, rails will generate all files for the project, ready to start. Automatically bundler will install all dependencies.

That’s it, your project is ready to be developed, you can even run it now:

Once the server is started, open browser and go to localhost:3000. You should see starting image:

Yay! You're on Rails!

Step 5. Installing favorite gems
This is not a necessary part to proceed with your project. I will install gems, which I like most, and remove preinstalled some from the project. You can see these modifications in my project repository: https://github.com/sampi60/finance_grinder.
Changes I’ve made:
  • Change database engine. Replace ‘sqlite3’ by ‘pg’. Some setup with PostgreSQL is also needed, but I will not cover it in this post.
  • Replace ‘byebug’ by ‘pry’. I just like it more, but it has the same main functionalities.
  • Use ‘rspec’ instead built in UnitTest for tests. Also add awesome gems such as: ‘rails-controller-testing’, ‘factory_girl_rails’, ‘faker’, ‘shoulda-matchers’ and ‘capybara’. These are ones of most used gems by rails developers, so I encourage you to get familiar with them and give them a try.
  • ‘better_errors’ – to see clearly what I’ve broken 🙂
  • ‘binding_of_caller’ instead ‘web-console’ to play with application on error screen
  • Add powerful ‘devise’ gem to deal with users authentication.
  • Add MaterialiceCSS framework. This is an experiment, I’ve never used it, but I always wanted to.

After each change in ‘Gemfile’ file you need to run bundle install  or just bundle  command to install new gem and make update ‘Gemfile.lock’ file.

That’s it for now. I have some favorite gems for other purposes. I will probably add them during development, or I will give a try to equivalent ones, or maybe try to build my own solutions. Will see.

Project status

Unfortunately, until now I haven’t done anything except this because I wanted to describe the process of installing environment and running new rails project. My actual goal is to catch up with code, so I rather wouldn’t cover any commit so closely.

I will try to report Finance Grinder status at every beginning of a week, announce what I did, and what I will focus on during next 7 days. I hope that such exact plan allow me to work efficiently if only I will have time.


Stay tuned, see what will happen, and don’t hesitate to leave some feedback!