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.
How to block showing your site in IFrame (Anti-iframe)
Recently, I found that one of my popular sites is shown as part of other site. So visitors of that not-mine site, being on that site, can access all the services of my sites. They used my site content and services via iframe and took benefits from my site.
Below is the solution how to prevent this, i.e. block showing your site content via iframe. The solution is pretty simple.
Continue reading
Take screenshots of websites from command line and programmatically with PHP or .NET
There are many cases when you may want to take a screenshot of a webpage from command line or programmatically from a PHP script or a .NET program.
Taking Screenshots of Websites with .NET Windows Forms
In order to take screenshots in .NET you might use a WebBrowser control and saves an image rendered.
If you are looking for code examples to take webpage screenshots in PHP, read the post Taking Screenshots of Websites with PHP.
Continue reading