Custom controller actions in ActiveAdmin (Ruby on Rails)

August 7, 2014 · Posted in Development · Comment 

ActiveAdmin is a popular Ruby on Rails plugin for creating admin area. It helps developers solve many common problems to view/edit data as administrator. There are several other similar plugins, but I prefer ActiveAdmin because it allows developers to customize almost everything.

This post shows how to to add a custom action to a ActiveAdmin controller.

Read more

Custom slugs in Rails using gem Slugged

August 2, 2014 · Posted in Development · Comment 

There are several gems to have slug in a model in Rails application: friendly_id, slugged and some others.

Read more

Loading “Seed” Data in Rails

July 12, 2014 · Posted in Development · Comment 

A Rails application needs some data to exist in database before the application can be run. It is called ‘seed’ data.
This post shows how to create a rake task that loads ‘seed’ data. Data is stored in *.yml files.

Read more

Rails: clear old sessions stored in database

December 14, 2013 · Posted in Development · Comment 

Sessions in Rails application can be stored in a database (as well as in cookies). I used to store session data in a table in database.

Sessions table may grow very large because Rails doesn’t have a built-in mechanism to clear old session data.

So you need to remove old sessions rows from database manually.

Read more

Rails 3 Nested Models in one form using Formtastic and Cocoon gems

December 7, 2013 · Posted in Development · Comment 

This post shows how to handle nested models in one form with the parent model.

Read more

Showing images in GridView with multiple columns [Android]

October 21, 2013 · Posted in Development · Comment 

 

This post shows how to get GridView with images and show images in multiple columns.

If you are looking for showing images in ListView – read this tutorial.

Read more

ListView with Images [Android]

October 21, 2013 · Posted in Development · Comment 

This post shows how to get ListView with images using ArrayAdapter with custom objects.

In this example we will show a list of products with image and title in ListView.

Read more

Redirect from WWW to a non-WWW version of site in Rails

September 27, 2013 · Posted in Development · Comment 

It is good practice to make your site available by both www.example.com and example.com URLs. But to prevent the duplication of pages (http://www.example.com/somepage/ and http://example.com/somepage are the same) we should have one version of URL (with WWW or without) and redirect from another version to the chosen one (from www to non-www or vice versa).

Read more

How to create your own Ruby gem

April 6, 2013 · Posted in Development · 1 Comment 

This post is the guide to creating your own gem for Rails.

Read more

Using CDN with Rails assets

March 25, 2013 · Posted in Development · 1 Comment 

Read more

Next Page »