Rails application pattern