Poetry of Programming

Its about Ruby on Rails – Kiran Soumya

By

SSL/HTTPS on Devise + Rails3

I have seen gems like ssl_requirement, but its too complicated for securing just two pages of user login and sign up.

Referred few blogs and found few useful links for the same:

1> For
# Creating your private key
# Creating your certificate signing request
# Getting your certificate
# Configuring your web server
Refer: http://www.buildingwebapps.com/articles/79189-using-ssl-in-rails-applications
2> For Setting up Rails app with Devise, I have referred this :
http://blog.grow20.com/fun-with-ssl-for-accounts-only

More useful links:
http://blog.dynamic50.com/2011/02/15/ssl-on-wildcard-domains-on-heroku-using-godaddy/
http://www.themomorohoax.com/2010/10/08/using-ssl-in-rails-3

By

Rake Task in Rails 3 on Production ENV

Cannot execute Rake Task in production environment? Does it throws errors of uninitialized objects or refuses to load Model classes?

To execute a rake task for eager loading we require,
config.threadsafe! to be disabled in production which is enabled by default.

But our requirement is to get it disabled only on running a rake task.

Rake already sets a Ruby global: $rails_rake_task

So, in config/environments/production.rb, just say:

 config.threadsafe! unless $rails_rake_task