28 Apr 2015
Vertically aligning elements in CSS is always a headache to me. Found a good solution from a blog.
The gist is:
12 Apr 2015
stub :controller_name, 'discussions' do
active_link_html link_to_nav name: 'Forum', url: discussions_path
inactive_link_html link_to_nav name: 'Webinars', url: webinars_path
12 Apr 2015
I had a table called `answers` and it has `created_at` timestamp column among others. How can I get all the records from the table grouped by week number of the year?
The first idea that came to my mind was to use `group_by` method of Ruby. To do that I would have to run a query like this:
21 Feb 2015
If you have an app using [MonBan](https://github.com/halogenandtoast/monban) you might be using helpers like `current_user` in view layer.
How do you write functional test for it? I ran into this error when I tried.
ActionView::Template::Error: undefined method `user' for nil:NilClass ...
8 Feb 2015
Ruby provides convenient methods to find a minimum or a maximum value in an array.
numbers [23, 20, 35, 3, 8]
> [23, 20, 35, 3, 8]
> [3, 35]
ref: http://www.rubydoc.org/core2.2.0/Enumerable.html ...