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).
How to create your own Ruby gem
This post is the guide to creating your own gem for Rails.
Using CDN with Rails assets
Rails disable logging of asset pipeline messages
There are many assets related log messages in log file. It causes Rack to use the Rails logger very frequently.
Password protecting pages of Rails App
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.
Continue reading
Rails Best Practices
A collection of tips showing best practices programming on Ruby on Rails.
Link to download an image as attachment in Rails (send_file and remote files)
Build a link_to to download an image.
Python vs Ruby and Django vs. Rails
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.
Sessions do not work in Internet Explorer in Rails
Recently I had a strange problem when sessions didn’t work on my site on Rails in production environment. The problem was in Internet Explorer while it worked in Firefox and Chrome.
Cropping and resizing images using MiniMagick (Ruby on Rails)
There are a number of algorithms to crop and resize images. Like maintaining the original image’s aspect ratio, cropping over-sized images, padding to fill empty area.
This post shows two approaches – with cropping and without cropping. Continue reading