Assembling Pages Last: Edge Caching, ESI and Rails
Related cards:
Make Sure Your Rails Application is Actually Caching (and not just pretending) - Alfa Jango Blog ยป Blog Archive
It occurred to me that many Rails/Passenger/Apache applications may have caching set up in a way that it appears to be caching, when it is not actually caching.
Upgrading Cucumber and Capybara to the latest versions available for Rails 2
Specify these gem versions in your Gemfile:
gem 'cucumber', '~> 1.3.0'
gem 'cucumber-rails', '= 0.3.2' # max version for Rails 2
gem 'capybara', '< 2' # capybara 2+ requires Rails 3
gem 'mime-types', '< 2' # dependeny of capybara
...
Building and Scaling a Startup on Rails: 12 Things We Learned the Hard Way - Axon Flux - A Ruby on Rails Blog
There are a bunch of basic functional elements to building out a popular Rails app that I've never really seen explained in one place, but we had to learn the hard way while building Posterous.
RailsLab .:. Scaling Rails - Scaling Rails Screencasts
Learn everything you need to know about Scaling your Rails app through 13 informative Screencasts produced by Gregg Pollack with the support of New Relic.
dusen and edge_rider gems no longer depend on Rails
dusen 0.4.8 and edge_rider 0.2.3 no longer depend on Rails (they still depend on ActiveRecord). That means you can use them e.g. with Sinatra.
Making the rails 3.1. asset pipeline and asset precompiling work in production mode
Recently, we had an interesting lunch-break with the rails 3.1. asset-pipeline in production mode. Daniel Zahn made a blogpost about our journey, precompiling assets, fingerprinting, Haml, Sass & Compass and what he calls "the dark heinous hutch".
When sessions, cookies and Clearance tokens expire and how to change it
Expiration of Rails sessions
By default Rails sessions expire when the user closes her browser window.
To change this edit your config/initializers/session_store.rb
like this:
ActionController::Base.session = ...
Caching in Rails < 6.1 may down parts of your application when using public cache control
Proxy caching is a good feature to serve your publicly visible application content faster and reduce load on your servers. It is e.g. available in nginx, but also affects proxies delivered by ISPs.
Unfortunately, there is a little problem in Rail...
Security issues with hash conditions in Rails 2 and Rails 3
Find conditions for scopes can be given either as an array (:conditions => ['state = ?', 'draft']
) or a hash (:conditions => { 'state' => 'draft' }
). The later is nicer to read, but has horrible security implications in some versions of Ru...
How to create Rails Generators (Rails 3 and above)
General
Programatically invoke Rails generators
: Require the generator, instantiate it and invoke it (because generators are Thor::Group
s, you need to invoke them with invoke_all
). Example:
require 'generators/wheelie/haml/...