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

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

Rails disable logging of asset pipeline messages

March 22, 2013 · Posted in Development · Comment 

There are many assets related log messages in log file. It causes Rack to use the Rails logger very  frequently.

Read more

Password protecting pages of Rails App

March 17, 2013 · Posted in Development · 1 Comment 

Often it is needed to close a whole app or some pages of a Rails app in Beta mode. A simple and quick way is using http authentication. So users (beta testers, admin) can access a Rails app by entering a single username and password.
Read more

Rails Best Practices

January 5, 2013 · Posted in Development · Comment 

A collection of tips and tricks to make Rails applications better.
Read more

Link to download an image as attachment in Rails (send_file and remote files)

January 1, 2013 · Posted in Development · 2 Comments 

Build a link_to to download an image.

Read more

Python vs Ruby and Django vs. Rails

December 29, 2012 · Posted in Development · 1 Comment 

In this post I am collecting opinions about pros and cons of using two popular web frameworks Python’s Django and Ruby on Rails in web development. I tried to include all factors that matter to choose between two frameworks.

Read more

Next Page »