Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

New version

  • Loading branch information...
commit e298e5f8a3f2fd6ddbcd2e2bc245f83a012ba362 1 parent 7d08ec9
@raul authored
Showing with 18,335 additions and 0 deletions.
  1. +15 −0 ChangeLog
  2. +20 −0 MIT-LICENSE
  3. +79 −0 README
  4. +22 −0 Rakefile
  5. 0  config/routes_en-US.yml
  6. +1 −0  config/routes_es-ES.yml
  7. +1 −0  init.rb
  8. +1 −0  install.rb
  9. +218 −0 lib/translate_routes.rb
  10. +256 −0 sample_app/README
  11. +10 −0 sample_app/Rakefile
  12. +5 −0 sample_app/app/controllers/application.rb
  13. +85 −0 sample_app/app/controllers/users_controller.rb
  14. +3 −0  sample_app/app/helpers/application_helper.rb
  15. +2 −0  sample_app/app/helpers/users_helper.rb
  16. +2 −0  sample_app/app/models/user.rb
  17. +99 −0 sample_app/app/views/layouts/application.html.erb
  18. +19 −0 sample_app/app/views/users/edit.html.erb
  19. +22 −0 sample_app/app/views/users/index.html.erb
  20. +17 −0 sample_app/app/views/users/new.html.erb
  21. +13 −0 sample_app/app/views/users/show.html.erb
  22. +109 −0 sample_app/config/boot.rb
  23. +22 −0 sample_app/config/database.yml
  24. +70 −0 sample_app/config/environment.rb
  25. +17 −0 sample_app/config/environments/development.rb
  26. +24 −0 sample_app/config/environments/production.rb
  27. +22 −0 sample_app/config/environments/test.rb
  28. +24 −0 sample_app/config/initializers/i18n.rb
  29. +10 −0 sample_app/config/initializers/inflections.rb
  30. +5 −0 sample_app/config/initializers/mime_types.rb
  31. +17 −0 sample_app/config/initializers/new_rails_defaults.rb
  32. +7 −0 sample_app/config/routes.rb
  33. BIN  sample_app/db/development.sqlite3
  34. +14 −0 sample_app/db/migrate/20081024182116_create_users.rb
  35. BIN  sample_app/db/production.sqlite3
  36. +21 −0 sample_app/db/schema.rb
  37. BIN  sample_app/db/test.sqlite3
  38. +2 −0  sample_app/doc/README_FOR_APP
  39. +5 −0 sample_app/locales/i18n-routes.yml
  40. +56 −0 sample_app/locales/text.yml
  41. +7,691 −0 sample_app/log/development.log
  42. +183 −0 sample_app/log/production.log
  43. 0  sample_app/log/server.log
  44. +508 −0 sample_app/log/test.log
  45. +30 −0 sample_app/public/404.html
  46. +30 −0 sample_app/public/422.html
  47. +33 −0 sample_app/public/500.html
  48. +10 −0 sample_app/public/dispatch.cgi
  49. +24 −0 sample_app/public/dispatch.fcgi
  50. +10 −0 sample_app/public/dispatch.rb
  51. 0  sample_app/public/favicon.ico
  52. BIN  sample_app/public/images/rails.png
  53. +2 −0  sample_app/public/javascripts/application.js
  54. +963 −0 sample_app/public/javascripts/controls.js
  55. +972 −0 sample_app/public/javascripts/dragdrop.js
  56. +1,120 −0 sample_app/public/javascripts/effects.js
  57. +4,221 −0 sample_app/public/javascripts/prototype.js
  58. +5 −0 sample_app/public/robots.txt
  59. +72 −0 sample_app/public/stylesheets/scaffold.css
  60. +4 −0 sample_app/script/about
  61. +3 −0  sample_app/script/console
  62. +3 −0  sample_app/script/dbconsole
  63. +3 −0  sample_app/script/destroy
  64. +3 −0  sample_app/script/generate
  65. +3 −0  sample_app/script/performance/benchmarker
  66. +3 −0  sample_app/script/performance/profiler
  67. +3 −0  sample_app/script/performance/request
  68. +3 −0  sample_app/script/plugin
  69. +3 −0  sample_app/script/process/inspector
  70. +3 −0  sample_app/script/process/reaper
  71. +3 −0  sample_app/script/process/spawner
  72. +3 −0  sample_app/script/runner
  73. +3 −0  sample_app/script/server
  74. +9 −0 sample_app/test/fixtures/users.yml
  75. +45 −0 sample_app/test/functional/users_controller_test.rb
  76. +9 −0 sample_app/test/performance/browsing_test.rb
  77. +25 −0 sample_app/test/test_helper.rb
  78. +8 −0 sample_app/test/unit/user_test.rb
  79. +15 −0 sample_app/vendor/plugins/translate_routes/ChangeLog
  80. +20 −0 sample_app/vendor/plugins/translate_routes/MIT-LICENSE
  81. +79 −0 sample_app/vendor/plugins/translate_routes/README
  82. +22 −0 sample_app/vendor/plugins/translate_routes/Rakefile
  83. 0  sample_app/vendor/plugins/translate_routes/config/routes_en-US.yml
  84. +1 −0  sample_app/vendor/plugins/translate_routes/config/routes_es-ES.yml
  85. +1 −0  sample_app/vendor/plugins/translate_routes/init.rb
  86. +1 −0  sample_app/vendor/plugins/translate_routes/install.rb
  87. +218 −0 sample_app/vendor/plugins/translate_routes/lib/translate_routes.rb
  88. +42 −0 sample_app/vendor/plugins/translate_routes/tasks/translate_routes_tasks.rake
  89. +5 −0 sample_app/vendor/plugins/translate_routes/test/locales/routes.yml
  90. +277 −0 sample_app/vendor/plugins/translate_routes/test/translate_routes_test.rb
  91. +1 −0  sample_app/vendor/plugins/translate_routes/uninstall.rb
  92. +42 −0 tasks/translate_routes_tasks.rake
  93. +5 −0 test/locales/routes.yml
  94. +277 −0 test/translate_routes_test.rb
  95. +1 −0  uninstall.rb
View
15 ChangeLog
@@ -0,0 +1,15 @@
+-- branch rails2.2 v0.9 (Oct 27th 2008)
+ * Developed after Rails2.2rc1 release, with i18n support. Beta, not backward compatible with Rails < 2.2
+
+-- 0.96.1 (Aug 5th 2008)
+ * Fixed by Mathieu Fosse: helpers didn't worked as expected when locale_param_key is undefined
+
+-- 0.96 (Jun 10th 2008)
+ * Added update_yaml task, suggested by Francesc Esplugas
+
+-- 0.95 (Jan 21st 2008)
+ * Still beta version
+ * Added yaml files support for dictionaries
+
+-- 0.9 (Dec 27th 2007)
+ * Beta version
View
20 MIT-LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2007 Raul Murciano [http://raul.murciano.net], Domestika INTERNET S.L. [http://domestika.org]
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
79 README
@@ -0,0 +1,79 @@
+=TranslateRoutes
+
+This Rails plugin provides a simple way to translate your URLs to any number of languages, even on a fully working application.
+
+It works fine with all kind of routing definitions, including RESTful and named routes.
+<strong>Your code will remain untouched</strong>: your current routing code, helpers and links will be translated transparently.
+(Un)installing it is a very clean and simple process, so why don't you give it a chance? ;)
+
+==Quick start
+
+Let's start with a tiny example. Of course you need to define your routes first, e.g:
+<code>
+ ActionController::Routing::Routes.draw do |map|
+ map.contact 'contact', :controller => 'contact', :action => 'index'
+ end
+</code>
+
+1. Download the plugin to your app's <tt>/vendor/plugins</tt> directory.
+
+2. Write your translations on a standard YAML file (e.g: i18n-routes.yml), including the locales and it translations pairs:
+<code>
+es-ES:
+ contact: contacto
+</code>
+
+3. Append a line to your routes.rb file to activate the translations. If you loaded the translations file with
+your other I18n translations files, the line will be:
+<code>ActionController::Routing::Translator.i18n('es-ES')</code>
+and if you want to keep the file separated (e.g: config/i18n-routes.yml), the line to append is:
+<code>ActionController::Routing::Translator.translate_from_file('config','i18n-routes.yml')</code>
+
+You can see it working by executing <code>rake routes</code> on the shell:
+
+<code>
+contact_es_es_path /es-ES/contacto {:locale=>"es-ES", :controller=>"contact", :action=>"index"}
+contact_en_us_path /contact {:locale=>"en-US", :controller=>"contact", :action=>"index"}
+</code>
+
+As we can see, a new spanish route has been setted up and a <tt>locale</tt> parameter has been added to the routes.
+
+4. Include this filter in your ApplicationController:
+
+<code>before_filter :set_locale_from_url</code>
+
+Now your application recognizes the different routes and sets the <tt>I18n.locale</tt> value on your controllers,
+but what about the routes generation? As you can see on the previous <tt>rake routes</tt> execution, the
+<tt>contact_es_es_path</tt> and <tt>contact_en_us_path</tt> routing helpers have been generated and are
+available in your controllers and views. Additionally, a <tt>contact_path</tt> helper has been generated, which
+generates the routes according to the current I18n.locale value.
+
+This way <strong>you don't need to modify your application links</strong> because they <strong>adapt automatically to the current locale</strong>.
+
+5. Hey, but what about my tests?
+
+Of course, your functional and integration testing involves some requests.
+The plugin includes some code to add a default locale parameter so they can remain untouched.
+Append it to your <tt>test_helper</tt> and it will be applied.
+
+== Documentation
+
+You can find additional options and documentation on the translate_routes wiki, and a sample application that you
+can use as reference.
+
+== Suggestions, bug reports, questions
+Feedback and comments will be always welcome at raul@murciano.net
+
+== Credits
+- Raul Murciano [http://raul.murciano.net] - code
+- Domestika INTERNET S.L [http://domestika.org] - incredible support, really nice people to work with!
+
+
+== Rails routing resources
+- David Black's 'Rails Routing' ebook rocks! - 'Ruby for Rails' too, BTW.
+- Obie Fernandez's 'The Rails Way' - the definitive RoR reference, great work Obie!
+
+== License
+Copyright (c) 2007
+Raul Murciano [http://raul.murciano.net]
+Domestika INTERNET S.L. [http://domestika.org], released under the MIT license (see MIT-LICENSE)
View
22 Rakefile
@@ -0,0 +1,22 @@
+require 'rake'
+require 'rake/testtask'
+require 'rake/rdoctask'
+
+desc 'Default: run unit tests.'
+task :default => :test
+
+desc 'Test the translate_routes plugin.'
+Rake::TestTask.new(:test) do |t|
+ t.libs << 'lib'
+ t.pattern = 'test/**/*_test.rb'
+ t.verbose = true
+end
+
+desc 'Generate documentation for the translate_routes plugin.'
+Rake::RDocTask.new(:rdoc) do |rdoc|
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = 'TranslateRoutes'
+ rdoc.options << '--line-numbers' << '--inline-source'
+ rdoc.rdoc_files.include('README')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
View
0  config/routes_en-US.yml
No changes.
View
1  config/routes_es-ES.yml
@@ -0,0 +1 @@
+people: gente
View
1  init.rb
@@ -0,0 +1 @@
+require 'translate_routes'
View
1  install.rb
@@ -0,0 +1 @@
+# Install hook code here
View
218 lib/translate_routes.rb
@@ -0,0 +1,218 @@
+# Author: Raul Murciano [http://raul.murciano.net] for Domestika [http://domestika.org]
+# Copyright (c) 2007, Released under the MIT license (see MIT-LICENSE)
+
+module ActionController
+
+ module Routing
+
+ module Translator
+
+ mattr_accessor :prefix_on_default_locale
+ @@prefix_on_default_locale = false
+
+ mattr_accessor :locale_param_key
+ @@locale_param_key = :locale # set to :locale for params[:locale]
+
+ mattr_accessor :original_routes
+
+ mattr_accessor :dictionaries
+
+ def self.translate
+ init_dictionaries
+ yield @@dictionaries
+ @using_i18n = false
+ Translator.translate_current_routes
+ end
+
+ def self.translate_from_file(*path)
+ init_dictionaries
+ path = %w(locales routes.yml) if path.blank?
+ file_path = File.join(RAILS_ROOT, path)
+ yaml = YAML.load_file(file_path)
+ yaml.each_pair{ |k,v| @@dictionaries[k.to_s] = v || {} }
+ @using_i18n = false
+ Translator.translate_current_routes
+ end
+
+ def self.i18n(*locales)
+ init_dictionaries
+ locales = I18n.available_locales if locales.blank? && I18n.respond_to?(:available_locales)
+ locales.each{ |locale| @@dictionaries[locale] = {} }
+ @using_i18n = true
+ Translator.translate_current_routes
+ end
+
+ private
+
+ def self.default_locale
+ I18n.default_locale.to_s
+ end
+
+ def self.init_dictionaries
+ @@dictionaries = { default_locale => {} }
+ end
+
+ def self.available_locales
+ @@dictionaries.keys.map(&:to_s).uniq
+ end
+
+ def self.original_static_segments
+ static_segments = []
+ (@@original_routes || Routes.routes).each do |r|
+ r.segments.select do |s|
+ static_segments << s.value if s.instance_of?(ActionController::Routing::StaticSegment)
+ end
+ end
+ static_segments.uniq.sort
+ end
+
+ # code shared by translation and application helpers,
+ # it generates a suffix code for a given locale: en-US -> en_us
+ def self.locale_suffix_code
+ 'locale.to_s.underscore'
+ end
+
+ def self.add_locale_suffix_helper
+ helper_code = <<-HELPER_CODE
+ def locale_suffix(locale)
+ #{locale_suffix_code}
+ end
+ HELPER_CODE
+ [ActionController::Base, ActionView::Base].each { |d| d.module_eval(helper_code) }
+ end
+
+ class_eval <<-FOO
+ def self.locale_suffix(locale)
+ #{self.locale_suffix_code}
+ end
+ FOO
+
+ def self.translate_current_routes
+
+ # reset routes
+ @@original_routes ||= Routes.routes.dup
+ old_routes = Routes.routes.dup # Array [routeA, routeB, ...]
+ old_names = Routes.named_routes.routes.dup # Hash {:name => :route}
+ Routes.clear!
+ new_routes = []
+ new_named_routes = {}
+
+ old_routes.each do |old_route|
+
+ old_name = old_names.index(old_route)
+ # process and add the translated ones
+ trans_routes, trans_named_routes = translate_route(old_route, old_name)
+
+ if old_name
+ new_named_routes.merge! trans_named_routes
+ generate_helpers(old_name)
+ end
+
+ new_routes.concat(trans_routes)
+
+ end
+
+ # apply all new routes
+ Routes.routes = new_routes
+ new_named_routes.each { |name, r| Routes.named_routes.add name, r }
+
+ add_locale_suffix_helper
+
+ end
+
+ def self.generate_helpers(old_name)
+ ['path', 'url'].each do |suffix|
+ new_helper_name = "#{old_name}_#{suffix}"
+ def_new_helper = <<-DEF_NEW_HELPER
+ def #{new_helper_name}(*args)
+ send("#{old_name}_\#{locale_suffix(I18n.locale)}_#{suffix}", *args)
+ end
+ DEF_NEW_HELPER
+
+ [ActionController::Base, ActionView::Base].each { |d| d.module_eval(def_new_helper) }
+ ActionController::Routing::Routes.named_routes.helpers << new_helper_name.to_sym
+ end
+ end
+
+ def self.add_prefix?(lang)
+ @@prefix_on_default_locale || lang != default_locale
+ end
+
+ def self.translate_static_segment(segment, locale)
+ if @using_i18n
+ tmp = I18n.locale
+ I18n.locale = locale
+ value = I18n.t segment.value, :default => segment.value.dup
+ I18n.locale = tmp
+ else
+ value = @@dictionaries[locale][segment.value] || segment.value.dup
+ end
+ StaticSegment.new(value, :raw => segment.raw, :optional => segment.optional?)
+ end
+
+ def self.locale_segments(orig, locale)
+ segments = []
+
+ if add_prefix?(locale) # initial prefix i.e: /en-US
+ divider = DividerSegment.new(orig.segments.first.value, :optionals => false) # divider ('/')
+ static = StaticSegment.new(locale, :optional => false) # static ('en-US')
+ segments += [divider, static]
+ end
+
+ orig.segments.each do |s|
+ if s.instance_of?(StaticSegment)
+ new_segment = translate_static_segment(s, locale)
+ else
+ new_segment = s.dup # just reference the original
+ end
+ segments << new_segment
+ end
+ segments
+ end
+
+ def self.locale_requirements(orig, locale)
+ orig.requirements.merge(@@locale_param_key => locale)
+ end
+
+ def self.translate_route_by_locale(orig, locale, orig_name=nil)
+ segments = locale_segments(orig, locale)
+ requirements = locale_requirements(orig, locale)
+ conditions = orig.conditions
+
+ Route.new(segments, requirements, conditions).freeze
+ end
+
+ def self.translate_route(route, route_name = nil)
+ new_routes = []
+ new_named_routes = {}
+ available_locales.each do |locale|
+ translated = translate_route_by_locale(route, locale, route_name)
+ new_routes << translated
+ locale_suffix = locale_suffix(locale)
+ new_named_routes["#{route_name}_#{locale_suffix}".to_sym] = translated if route_name
+ end
+ [new_routes, new_named_routes]
+ end
+
+ end
+
+ end
+end
+
+
+# Add set_locale_from_url to controllers
+module ActionController
+
+ class Base
+
+ private
+
+ def set_locale_from_url
+ I18n.locale = params[ActionController::Routing::Translator.locale_param_key]
+ default_url_options({ActionController::Routing::Translator => I18n.locale })
+ end
+
+ end
+
+end
+
View
256 sample_app/README
@@ -0,0 +1,256 @@
+== Welcome to Rails
+
+Rails is a web-application framework that includes everything needed to create
+database-backed web applications according to the Model-View-Control pattern.
+
+This pattern splits the view (also called the presentation) into "dumb" templates
+that are primarily responsible for inserting pre-built data in between HTML tags.
+The model contains the "smart" domain objects (such as Account, Product, Person,
+Post) that holds all the business logic and knows how to persist themselves to
+a database. The controller handles the incoming requests (such as Save New Account,
+Update Product, Show Post) by manipulating the model and directing data to the view.
+
+In Rails, the model is handled by what's called an object-relational mapping
+layer entitled Active Record. This layer allows you to present the data from
+database rows as objects and embellish these data objects with business logic
+methods. You can read more about Active Record in
+link:files/vendor/rails/activerecord/README.html.
+
+The controller and view are handled by the Action Pack, which handles both
+layers by its two parts: Action View and Action Controller. These two layers
+are bundled in a single package due to their heavy interdependence. This is
+unlike the relationship between the Active Record and Action Pack that is much
+more separate. Each of these packages can be used independently outside of
+Rails. You can read more about Action Pack in
+link:files/vendor/rails/actionpack/README.html.
+
+
+== Getting Started
+
+1. At the command prompt, start a new Rails application using the <tt>rails</tt> command
+ and your application name. Ex: rails myapp
+2. Change directory into myapp and start the web server: <tt>script/server</tt> (run with --help for options)
+3. Go to http://localhost:3000/ and get "Welcome aboard: You're riding the Rails!"
+4. Follow the guidelines to start developing your application
+
+
+== Web Servers
+
+By default, Rails will try to use Mongrel and lighttpd if they are installed, otherwise
+Rails will use WEBrick, the webserver that ships with Ruby. When you run script/server,
+Rails will check if Mongrel exists, then lighttpd and finally fall back to WEBrick. This ensures
+that you can always get up and running quickly.
+
+Mongrel is a Ruby-based webserver with a C component (which requires compilation) that is
+suitable for development and deployment of Rails applications. If you have Ruby Gems installed,
+getting up and running with mongrel is as easy as: <tt>gem install mongrel</tt>.
+More info at: http://mongrel.rubyforge.org
+
+If Mongrel is not installed, Rails will look for lighttpd. It's considerably faster than
+Mongrel and WEBrick and also suited for production use, but requires additional
+installation and currently only works well on OS X/Unix (Windows users are encouraged
+to start with Mongrel). We recommend version 1.4.11 and higher. You can download it from
+http://www.lighttpd.net.
+
+And finally, if neither Mongrel or lighttpd are installed, Rails will use the built-in Ruby
+web server, WEBrick. WEBrick is a small Ruby web server suitable for development, but not
+for production.
+
+But of course its also possible to run Rails on any platform that supports FCGI.
+Apache, LiteSpeed, IIS are just a few. For more information on FCGI,
+please visit: http://wiki.rubyonrails.com/rails/pages/FastCGI
+
+
+== Apache .htaccess example
+
+# General Apache options
+AddHandler fastcgi-script .fcgi
+AddHandler cgi-script .cgi
+Options +FollowSymLinks +ExecCGI
+
+# If you don't want Rails to look in certain directories,
+# use the following rewrite rules so that Apache won't rewrite certain requests
+#
+# Example:
+# RewriteCond %{REQUEST_URI} ^/notrails.*
+# RewriteRule .* - [L]
+
+# Redirect all requests not available on the filesystem to Rails
+# By default the cgi dispatcher is used which is very slow
+#
+# For better performance replace the dispatcher with the fastcgi one
+#
+# Example:
+# RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
+RewriteEngine On
+
+# If your Rails application is accessed via an Alias directive,
+# then you MUST also set the RewriteBase in this htaccess file.
+#
+# Example:
+# Alias /myrailsapp /path/to/myrailsapp/public
+# RewriteBase /myrailsapp
+
+RewriteRule ^$ index.html [QSA]
+RewriteRule ^([^.]+)$ $1.html [QSA]
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
+
+# In case Rails experiences terminal errors
+# Instead of displaying this message you can supply a file here which will be rendered instead
+#
+# Example:
+# ErrorDocument 500 /500.html
+
+ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"
+
+
+== Debugging Rails
+
+Sometimes your application goes wrong. Fortunately there are a lot of tools that
+will help you debug it and get it back on the rails.
+
+First area to check is the application log files. Have "tail -f" commands running
+on the server.log and development.log. Rails will automatically display debugging
+and runtime information to these files. Debugging info will also be shown in the
+browser on requests from 127.0.0.1.
+
+You can also log your own messages directly into the log file from your code using
+the Ruby logger class from inside your controllers. Example:
+
+ class WeblogController < ActionController::Base
+ def destroy
+ @weblog = Weblog.find(params[:id])
+ @weblog.destroy
+ logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!")
+ end
+ end
+
+The result will be a message in your log file along the lines of:
+
+ Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1
+
+More information on how to use the logger is at http://www.ruby-doc.org/core/
+
+Also, Ruby documentation can be found at http://www.ruby-lang.org/ including:
+
+* The Learning Ruby (Pickaxe) Book: http://www.ruby-doc.org/docs/ProgrammingRuby/
+* Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
+
+These two online (and free) books will bring you up to speed on the Ruby language
+and also on programming in general.
+
+
+== Debugger
+
+Debugger support is available through the debugger command when you start your Mongrel or
+Webrick server with --debugger. This means that you can break out of execution at any point
+in the code, investigate and change the model, AND then resume execution!
+You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install ruby-debug'
+Example:
+
+ class WeblogController < ActionController::Base
+ def index
+ @posts = Post.find(:all)
+ debugger
+ end
+ end
+
+So the controller will accept the action, run the first line, then present you
+with a IRB prompt in the server window. Here you can do things like:
+
+ >> @posts.inspect
+ => "[#<Post:0x14a6be8 @attributes={\"title\"=>nil, \"body\"=>nil, \"id\"=>\"1\"}>,
+ #<Post:0x14a6620 @attributes={\"title\"=>\"Rails you know!\", \"body\"=>\"Only ten..\", \"id\"=>\"2\"}>]"
+ >> @posts.first.title = "hello from a debugger"
+ => "hello from a debugger"
+
+...and even better is that you can examine how your runtime objects actually work:
+
+ >> f = @posts.first
+ => #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
+ >> f.
+ Display all 152 possibilities? (y or n)
+
+Finally, when you're ready to resume execution, you enter "cont"
+
+
+== Console
+
+You can interact with the domain model by starting the console through <tt>script/console</tt>.
+Here you'll have all parts of the application configured, just like it is when the
+application is running. You can inspect domain models, change values, and save to the
+database. Starting the script without arguments will launch it in the development environment.
+Passing an argument will specify a different environment, like <tt>script/console production</tt>.
+
+To reload your controllers and models after launching the console run <tt>reload!</tt>
+
+== dbconsole
+
+You can go to the command line of your database directly through <tt>script/dbconsole</tt>.
+You would be connected to the database with the credentials defined in database.yml.
+Starting the script without arguments will connect you to the development database. Passing an
+argument will connect you to a different database, like <tt>script/dbconsole production</tt>.
+Currently works for mysql, postgresql and sqlite.
+
+== Description of Contents
+
+app
+ Holds all the code that's specific to this particular application.
+
+app/controllers
+ Holds controllers that should be named like weblogs_controller.rb for
+ automated URL mapping. All controllers should descend from ApplicationController
+ which itself descends from ActionController::Base.
+
+app/models
+ Holds models that should be named like post.rb.
+ Most models will descend from ActiveRecord::Base.
+
+app/views
+ Holds the template files for the view that should be named like
+ weblogs/index.html.erb for the WeblogsController#index action. All views use eRuby
+ syntax.
+
+app/views/layouts
+ Holds the template files for layouts to be used with views. This models the common
+ header/footer method of wrapping views. In your views, define a layout using the
+ <tt>layout :default</tt> and create a file named default.html.erb. Inside default.html.erb,
+ call <% yield %> to render the view using this layout.
+
+app/helpers
+ Holds view helpers that should be named like weblogs_helper.rb. These are generated
+ for you automatically when using script/generate for controllers. Helpers can be used to
+ wrap functionality for your views into methods.
+
+config
+ Configuration files for the Rails environment, the routing map, the database, and other dependencies.
+
+db
+ Contains the database schema in schema.rb. db/migrate contains all
+ the sequence of Migrations for your schema.
+
+doc
+ This directory is where your application documentation will be stored when generated
+ using <tt>rake doc:app</tt>
+
+lib
+ Application specific libraries. Basically, any kind of custom code that doesn't
+ belong under controllers, models, or helpers. This directory is in the load path.
+
+public
+ The directory available for the web server. Contains subdirectories for images, stylesheets,
+ and javascripts. Also contains the dispatchers and the default HTML files. This should be
+ set as the DOCUMENT_ROOT of your web server.
+
+script
+ Helper scripts for automation and generation.
+
+test
+ Unit and functional tests along with fixtures. When using the script/generate scripts, template
+ test files will be generated for you and placed in this directory.
+
+vendor
+ External libraries that the application depends on. Also includes the plugins subdirectory.
+ If the app has frozen rails, those gems also go here, under vendor/rails/.
+ This directory is in the load path.
View
10 sample_app/Rakefile
@@ -0,0 +1,10 @@
+# Add your own tasks in files placed in lib/tasks ending in .rake,
+# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
+
+require(File.join(File.dirname(__FILE__), 'config', 'boot'))
+
+require 'rake'
+require 'rake/testtask'
+require 'rake/rdoctask'
+
+require 'tasks/rails'
View
5 sample_app/app/controllers/application.rb
@@ -0,0 +1,5 @@
+class ApplicationController < ActionController::Base
+
+ before_filter :set_locale_from_url
+
+end
View
85 sample_app/app/controllers/users_controller.rb
@@ -0,0 +1,85 @@
+class UsersController < ApplicationController
+ # GET /users
+ # GET /users.xml
+ def index
+ @users = User.find(:all)
+
+ respond_to do |format|
+ format.html # index.html.erb
+ format.xml { render :xml => @users }
+ end
+ end
+
+ # GET /users/1
+ # GET /users/1.xml
+ def show
+ @user = User.find(params[:id])
+
+ respond_to do |format|
+ format.html # show.html.erb
+ format.xml { render :xml => @user }
+ end
+ end
+
+ # GET /users/new
+ # GET /users/new.xml
+ def new
+ @user = User.new
+
+ respond_to do |format|
+ format.html # new.html.erb
+ format.xml { render :xml => @user }
+ end
+ end
+
+ # GET /users/1/edit
+ def edit
+ @user = User.find(params[:id])
+ end
+
+ # POST /users
+ # POST /users.xml
+ def create
+ @user = User.new(params[:user])
+
+ respond_to do |format|
+ if @user.save
+ flash[:notice] = I18n.t('user_succesfully_created')
+ format.html { redirect_to(@user) }
+ format.xml { render :xml => @user, :status => :created, :location => @user }
+ else
+ format.html { render :action => "new" }
+ format.xml { render :xml => @user.errors, :status => :unprocessable_entity }
+ end
+ end
+ end
+
+ # PUT /users/1
+ # PUT /users/1.xml
+ def update
+ @user = User.find(params[:id])
+
+ respond_to do |format|
+ if @user.update_attributes(params[:user])
+ flash[:notice] = I18n.t('user_succesfully_updated')
+ format.html { redirect_to(@user) }
+ format.xml { head :ok }
+ else
+ format.html { render :action => "edit" }
+ format.xml { render :xml => @user.errors, :status => :unprocessable_entity }
+ end
+ end
+ end
+
+ # DELETE /users/1
+ # DELETE /users/1.xml
+ def destroy
+ @user = User.find(params[:id])
+ @user.destroy
+
+ respond_to do |format|
+ format.html { redirect_to(users_url) }
+ format.xml { head :ok }
+ end
+ end
+end
View
3  sample_app/app/helpers/application_helper.rb
@@ -0,0 +1,3 @@
+# Methods added to this helper will be available to all templates in the application.
+module ApplicationHelper
+end
View
2  sample_app/app/helpers/users_helper.rb
@@ -0,0 +1,2 @@
+module UsersHelper
+end
View
2  sample_app/app/models/user.rb
@@ -0,0 +1,2 @@
+class User < ActiveRecord::Base
+end
View
99 sample_app/app/views/layouts/application.html.erb
@@ -0,0 +1,99 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
+ <title><%= I18n.t 'title' %></title>
+ <%= stylesheet_link_tag 'scaffold' %>
+ <%= javascript_include_tag :defaults %>
+</head>
+<body onLoad="$$('.toggle-me').each(Element.hide);">
+
+<div id="header">
+ <div id="locale-switch">
+ <strong><%= I18n.t 'current_locale' %>: <%= I18n.locale.to_s %></strong> |
+ <%= I18n.locale == 'es-ES' ? link_to('en-US', :locale => 'en-US') : link_to('es-ES', :locale => 'es-ES') %>
+ </div>
+ <div id="about">
+ <a href="#" onclick="$('howto').toggle();"><%= I18n.t 'about_integration' %></a>
+ </div>
+</div>
+<hr />
+<div id="howto" class="toggle-me">
+ <p>
+ <%= I18n.t 'description' %><br />
+ <%= I18n.t 'key_files' %>:
+ </p>
+ <ul>
+ <li>
+ <a href="#" onclick="$('routes_file').toggle();" >/config/routes.rb</a>: <%= I18n.t 'routes_file' %>
+ <pre id="routes_file" class="code toggle-me"> ActionController::Routing::Translator.i18n</pre>
+ </li>
+ <li>
+ <a href="#" onclick="$('app_controller').toggle();" >/app/controllers/application.rb</a>: <%= I18n.t 'app_controller' %>
+ <pre id="app_controller" class="code toggle-me"> before_filter :set_locale_from_url</pre>
+ </li>
+ <li>
+ <a href="#" onclick="$('routes_yml').toggle();" >/locales/routes.yml</a>: <%= I18n.t 'routes_yml' %>
+ <pre id="routes_yml" class="code toggle-me">
+ "es-ES":
+ edit: editar
+ new: crear
+ users: usuarios</pre>
+ </li>
+ <li>
+ <a href="#" onclick="$('initializer').toggle();" >/config/initializers/i18n.rb</a>: <%= I18n.t 'initializer' %>
+ <pre id="initializer" class="code toggle-me">
+ # monkeypatch I18n to get the available locales
+ # (not strictly needed to use translate_routes, but recommended anyway)
+ module I18n
+ class << self
+ def available_locales
+ backend.available_locales
+ end
+ end
+
+ module Backend
+ class Simple
+ def available_locales
+ init_translations unless initialized?
+ translations.keys
+ end
+ end
+ end
+ end
+
+ # load translation files from RAILS_ROOT/locales
+ [:rb, :yml].each do |format|
+ I18n.load_path = Dir[File.join(RAILS_ROOT, 'locales', '*.{rb,yml}') ]
+ end</pre>
+ </li>
+ <li>
+ <a href="#" onclick="$('test_helper').toggle();" >/test/test_helper.rb</a>: <%= I18n.t 'test_helper' %>
+ <pre id="test_helper" class="code toggle-me">
+ # include default lang on your test requests (test requests doesn't support default_url_options):
+ module ActionController
+ module TestProcess
+ unless method_defined?(:process_without_default_locale)
+ def process_with_default_locale(action, parameters = nil, session = nil, flash = nil)
+ lang_pair = {ActionController::Routing::Translator.locale_param_key => ActionController::Routing::Translator.default_locale}
+ parameters = lang_pair.merge(parameters) rescue lang_pair
+ process_without_default_locale(action, parameters, session, flash)
+ end
+
+ alias :process_without_default_locale :process
+ alias :process :process_with_default_locale
+ end
+ end
+ end</pre>
+ </li>
+ </ul>
+</div>
+<h1><%= I18n.t('the_sample_app') %></h1>
+<p style="color: green"><%= flash[:notice] %></p>
+
+<%= yield %>
+
+</body>
+</html>
View
19 sample_app/app/views/users/edit.html.erb
@@ -0,0 +1,19 @@
+<h2><%= I18n.t 'editing_user' %></h2>
+
+<% form_for(@user) do |f| %>
+
+ <p>
+ <%= f.label :first_name, I18n.t('first_name') %><br />
+ <%= f.text_field :first_name %>
+ </p>
+ <p>
+ <%= f.label :last_name, I18n.t('last_name') %><br />
+ <%= f.text_field :last_name %>
+ </p>
+ <p>
+ <%= f.submit I18n.t 'update' %>
+ </p>
+<% end %>
+
+<%= link_to I18n.t('show'), @user %> |
+<%= link_to I18n.t('back'), users_path %>
View
22 sample_app/app/views/users/index.html.erb
@@ -0,0 +1,22 @@
+<h2><%= I18n.t 'listing_users' %></h2>
+
+<table>
+ <tr>
+ <th><%= I18n.t 'first_name' %></th>
+ <th><%= I18n.t 'last_name' %></th>
+ </tr>
+
+<% for user in @users %>
+ <tr>
+ <td><%=h user.first_name %></td>
+ <td><%=h user.last_name %></td>
+ <td><%= link_to I18n.t('show'), user %></td>
+ <td><%= link_to I18n.t('edit'), edit_user_path(user) %></td>
+ <td><%= link_to I18n.t('destroy'), user, :confirm => I18n.t('are_you_sure'), :method => :delete %></td>
+ </tr>
+<% end %>
+</table>
+
+<br />
+
+<%= link_to I18n.t('new_user'), new_user_path %>
View
17 sample_app/app/views/users/new.html.erb
@@ -0,0 +1,17 @@
+<h2><%= I18n.t 'new_user' %></h2>
+
+<% form_for(@user) do |f| %>
+
+ <p>
+ <%= f.label :first_name, I18n.t('first_name') %><br />
+ <%= f.text_field :first_name %>
+ </p>
+ <p>
+ <%= f.label :last_name, I18n.t('last_name') %><br />
+ <%= f.text_field :last_name %>
+ </p> <p>
+ <%= f.submit I18n.t('create') %>
+ </p>
+<% end %>
+
+<%= link_to I18n.t('back'), users_path %>
View
13 sample_app/app/views/users/show.html.erb
@@ -0,0 +1,13 @@
+<p>
+ <b><%= I18n.t 'first_name' %>:</b>
+ <%=h @user.first_name %>
+</p>
+
+<p>
+ <b><%= I18n.t 'last_name' %>:</b>
+ <%=h @user.last_name %>
+</p>
+
+
+<%= link_to I18n.t('edit'), edit_user_path(@user) %> |
+<%= link_to I18n.t('back'), users_path %>
View
109 sample_app/config/boot.rb
@@ -0,0 +1,109 @@
+# Don't change this file!
+# Configure your app in config/environment.rb and config/environments/*.rb
+
+RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
+
+module Rails
+ class << self
+ def boot!
+ unless booted?
+ preinitialize
+ pick_boot.run
+ end
+ end
+
+ def booted?
+ defined? Rails::Initializer
+ end
+
+ def pick_boot
+ (vendor_rails? ? VendorBoot : GemBoot).new
+ end
+
+ def vendor_rails?
+ File.exist?("#{RAILS_ROOT}/vendor/rails")
+ end
+
+ def preinitialize
+ load(preinitializer_path) if File.exist?(preinitializer_path)
+ end
+
+ def preinitializer_path
+ "#{RAILS_ROOT}/config/preinitializer.rb"
+ end
+ end
+
+ class Boot
+ def run
+ load_initializer
+ Rails::Initializer.run(:set_load_path)
+ end
+ end
+
+ class VendorBoot < Boot
+ def load_initializer
+ require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
+ Rails::Initializer.run(:install_gem_spec_stubs)
+ end
+ end
+
+ class GemBoot < Boot
+ def load_initializer
+ self.class.load_rubygems
+ load_rails_gem
+ require 'initializer'
+ end
+
+ def load_rails_gem
+ if version = self.class.gem_version
+ gem 'rails', version
+ else
+ gem 'rails'
+ end
+ rescue Gem::LoadError => load_error
+ $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
+ exit 1
+ end
+
+ class << self
+ def rubygems_version
+ Gem::RubyGemsVersion if defined? Gem::RubyGemsVersion
+ end
+
+ def gem_version
+ if defined? RAILS_GEM_VERSION
+ RAILS_GEM_VERSION
+ elsif ENV.include?('RAILS_GEM_VERSION')
+ ENV['RAILS_GEM_VERSION']
+ else
+ parse_gem_version(read_environment_rb)
+ end
+ end
+
+ def load_rubygems
+ require 'rubygems'
+ min_version = '1.1.1'
+ unless rubygems_version >= min_version
+ $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
+ exit 1
+ end
+
+ rescue LoadError
+ $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
+ exit 1
+ end
+
+ def parse_gem_version(text)
+ $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
+ end
+
+ private
+ def read_environment_rb
+ File.read("#{RAILS_ROOT}/config/environment.rb")
+ end
+ end
+ end
+end
+
+# All that for this:
+Rails.boot!
View
22 sample_app/config/database.yml
@@ -0,0 +1,22 @@
+# SQLite version 3.x
+# gem install sqlite3-ruby (not necessary on OS X Leopard)
+development:
+ adapter: sqlite3
+ database: db/development.sqlite3
+ pool: 5
+ timeout: 5000
+
+# Warning: The database defined as "test" will be erased and
+# re-generated from your development database when you run "rake".
+# Do not set this db to the same as development or production.
+test:
+ adapter: sqlite3
+ database: db/test.sqlite3
+ pool: 5
+ timeout: 5000
+
+production:
+ adapter: sqlite3
+ database: db/production.sqlite3
+ pool: 5
+ timeout: 5000
View
70 sample_app/config/environment.rb
@@ -0,0 +1,70 @@
+# Be sure to restart your server when you modify this file
+
+# Uncomment below to force Rails into production mode when
+# you don't control web/app server and can't set it the proper way
+# ENV['RAILS_ENV'] ||= 'production'
+
+# Specifies gem version of Rails to use when vendor/rails is not present
+RAILS_GEM_VERSION = '2.2.0' unless defined? RAILS_GEM_VERSION
+
+# Bootstrap the Rails environment, frameworks, and default configuration
+require File.join(File.dirname(__FILE__), 'boot')
+
+Rails::Initializer.run do |config|
+ # Settings in config/environments/* take precedence over those specified here.
+ # Application configuration should go into files in config/initializers
+ # -- all .rb files in that directory are automatically loaded.
+ # See Rails::Configuration for more options.
+
+ # Skip frameworks you're not going to use. To use Rails without a database
+ # you must remove the Active Record framework.
+ # config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
+
+ # Specify gems that this application depends on.
+ # They can then be installed with "rake gems:install" on new installations.
+ # You have to specify the <tt>:lib</tt> option for libraries, where the Gem name (<em>sqlite3-ruby</em>) differs from the file itself (_sqlite3_)
+ # config.gem "bj"
+ # config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
+ # config.gem "sqlite3-ruby", :lib => "sqlite3"
+ # config.gem "aws-s3", :lib => "aws/s3"
+
+ # Only load the plugins named here, in the order given. By default, all plugins
+ # in vendor/plugins are loaded in alphabetical order.
+ # :all can be used as a placeholder for all plugins not explicitly named
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
+
+ # Add additional load paths for your own custom dirs
+ # config.load_paths += %W( #{RAILS_ROOT}/extras )
+
+ # Force all environments to use the same logger level
+ # (by default production uses :info, the others :debug)
+ # config.log_level = :debug
+
+ # Make Time.zone default to the specified zone, and make Active Record store time values
+ # in the database in UTC, and return them converted to the specified local zone.
+ # Run "rake -D time" for a list of tasks for finding time zone names. Comment line to use default local time.
+ config.time_zone = 'UTC'
+
+ # Your secret key for verifying cookie session data integrity.
+ # If you change this key, all old sessions will become invalid!
+ # Make sure the secret is at least 30 characters and all random,
+ # no regular words or you'll be exposed to dictionary attacks.
+ config.action_controller.session = {
+ :session_key => '_sample2.2_session',
+ :secret => '70a2fbc17ea0c4d6dfce52365f92398121b3c0d1a52d000fe3affc10252d3010c59cf076449bb092aa803188516b7a61c2749cea232ff0db4ef6d2820a85232e'
+ }
+
+ # Use the database for sessions instead of the cookie-based default,
+ # which shouldn't be used to store highly confidential information
+ # (create the session table with "rake db:sessions:create")
+ # config.action_controller.session_store = :active_record_store
+
+ # Use SQL instead of Active Record's schema dumper when creating the test database.
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
+ # like if you have constraints or database-specific column types
+ # config.active_record.schema_format = :sql
+
+ # Activate observers that should always be running
+ # Please note that observers generated using script/generate observer need to have an _observer suffix
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
+end
View
17 sample_app/config/environments/development.rb
@@ -0,0 +1,17 @@
+# Settings specified here will take precedence over those in config/environment.rb
+
+# In the development environment your application's code is reloaded on
+# every request. This slows down response time but is perfect for development
+# since you don't have to restart the webserver when you make code changes.
+config.cache_classes = false
+
+# Log error messages when you accidentally call methods on nil.
+config.whiny_nils = true
+
+# Show full error reports and disable caching
+config.action_controller.consider_all_requests_local = true
+config.action_view.debug_rjs = true
+config.action_controller.perform_caching = false
+
+# Don't care if the mailer can't send
+config.action_mailer.raise_delivery_errors = false
View
24 sample_app/config/environments/production.rb
@@ -0,0 +1,24 @@
+# Settings specified here will take precedence over those in config/environment.rb
+
+# The production environment is meant for finished, "live" apps.
+# Code is not reloaded between requests
+config.cache_classes = true
+
+# Enable threaded mode
+# config.threadsafe!
+
+# Use a different logger for distributed setups
+# config.logger = SyslogLogger.new
+
+# Full error reports are disabled and caching is turned on
+config.action_controller.consider_all_requests_local = false
+config.action_controller.perform_caching = true
+
+# Use a different cache store in production
+# config.cache_store = :mem_cache_store
+
+# Enable serving of images, stylesheets, and javascripts from an asset server
+# config.action_controller.asset_host = "http://assets.example.com"
+
+# Disable delivery errors, bad email addresses will be ignored
+# config.action_mailer.raise_delivery_errors = false
View
22 sample_app/config/environments/test.rb
@@ -0,0 +1,22 @@
+# Settings specified here will take precedence over those in config/environment.rb
+
+# The test environment is used exclusively to run your application's
+# test suite. You never need to work with it otherwise. Remember that
+# your test database is "scratch space" for the test suite and is wiped
+# and recreated between test runs. Don't rely on the data there!
+config.cache_classes = true
+
+# Log error messages when you accidentally call methods on nil.
+config.whiny_nils = true
+
+# Show full error reports and disable caching
+config.action_controller.consider_all_requests_local = true
+config.action_controller.perform_caching = false
+
+# Disable request forgery protection in test environment
+config.action_controller.allow_forgery_protection = false
+
+# Tell Action Mailer not to deliver emails to the real world.
+# The :test delivery method accumulates sent emails in the
+# ActionMailer::Base.deliveries array.
+config.action_mailer.delivery_method = :test
View
24 sample_app/config/initializers/i18n.rb
@@ -0,0 +1,24 @@
+
+# monkeypatch I18n to get the available locales
+# (not strictly needed to use translate_routes, but recommended anyway)
+module I18n
+ class << self
+ def available_locales
+ backend.available_locales
+ end
+ end
+
+ module Backend
+ class Simple
+ def available_locales
+ init_translations unless initialized?
+ translations.keys
+ end
+ end
+ end
+end
+
+# load translation files from RAILS_ROOT/locales
+[:rb, :yml].each do |format|
+ I18n.load_path = Dir[File.join(RAILS_ROOT, 'locales', '*.{rb,yml}') ]
+end
View
10 sample_app/config/initializers/inflections.rb
@@ -0,0 +1,10 @@
+# Be sure to restart your server when you modify this file.
+
+# Add new inflection rules using the following format
+# (all these examples are active by default):
+# ActiveSupport::Inflector.inflections do |inflect|
+# inflect.plural /^(ox)$/i, '\1en'
+# inflect.singular /^(ox)en/i, '\1'
+# inflect.irregular 'person', 'people'
+# inflect.uncountable %w( fish sheep )
+# end
View
5 sample_app/config/initializers/mime_types.rb
@@ -0,0 +1,5 @@
+# Be sure to restart your server when you modify this file.
+
+# Add new mime types for use in respond_to blocks:
+# Mime::Type.register "text/richtext", :rtf
+# Mime::Type.register_alias "text/html", :iphone
View
17 sample_app/config/initializers/new_rails_defaults.rb
@@ -0,0 +1,17 @@
+# These settings change the behavior of Rails 2 apps and will be defaults
+# for Rails 3. You can remove this initializer when Rails 3 is released.
+
+if defined?(ActiveRecord)
+ # Include Active Record class name as root for JSON serialized output.
+ ActiveRecord::Base.include_root_in_json = true
+
+ # Store the full class name (including module namespace) in STI type column.
+ ActiveRecord::Base.store_full_sti_class = true
+end
+
+# Use ISO 8601 format for JSON serialized times and dates.
+ActiveSupport.use_standard_json_time_format = true
+
+# Don't escape HTML entities in JSON, leave that for the #json_escape helper.
+# if you're including raw json in an HTML page.
+ActiveSupport.escape_html_entities_in_json = false
View
7 sample_app/config/routes.rb
@@ -0,0 +1,7 @@
+ActionController::Routing::Routes.draw do |map|
+ map.resources :users
+# map.root :controller => 'users'
+end
+
+ActionController::Routing::Translator.i18n
+#ActionController::Routing::Translator.translate_from_file 'locales', 'i18n-routes.yml'
View
BIN  sample_app/db/development.sqlite3
Binary file not shown
View
14 sample_app/db/migrate/20081024182116_create_users.rb
@@ -0,0 +1,14 @@
+class CreateUsers < ActiveRecord::Migration
+ def self.up
+ create_table :users do |t|
+ t.string :first_name
+ t.string :last_name
+
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :users
+ end
+end
View
BIN  sample_app/db/production.sqlite3
Binary file not shown
View
21 sample_app/db/schema.rb
@@ -0,0 +1,21 @@
+# This file is auto-generated from the current state of the database. Instead of editing this file,
+# please use the migrations feature of Active Record to incrementally modify your database, and
+# then regenerate this schema definition.
+#
+# Note that this schema.rb definition is the authoritative source for your database schema. If you need
+# to create the application database on another system, you should be using db:schema:load, not running
+# all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations
+# you'll amass, the slower it'll run and the greater likelihood for issues).
+#
+# It's strongly recommended to check this file into your version control system.
+
+ActiveRecord::Schema.define(:version => 20081024182116) do
+
+ create_table "users", :force => true do |t|
+ t.string "first_name"
+ t.string "last_name"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+end
View
BIN  sample_app/db/test.sqlite3
Binary file not shown
View
2  sample_app/doc/README_FOR_APP
@@ -0,0 +1,2 @@
+Use this README file to introduce your application and point to useful places in the API for learning more.
+Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries.
View
5 sample_app/locales/i18n-routes.yml
@@ -0,0 +1,5 @@
+"es-ES":
+ edit: editar
+ new: crear
+ users: usuarios
+
View
56 sample_app/locales/text.yml
@@ -0,0 +1,56 @@
+"es-ES":
+ about_integration: Cómo integrar translate_routes
+ app_controller: añadimos un filtro para el método set_locale_from_url, incluído en el plugin
+ are_you_sure: ¿Estás seguro?
+ back: volver
+ create: crear
+ current_locale: Idioma actual
+ description:
+ Aplicación de ejemplo para mostrar lo fácil que es integrar el plugin translate_routes
+ en tu aplicación Rails usando el nuevo sistema de I18n.
+ destroy: borrar
+ editing_user: Editar usuario
+ first_name: Nombre
+ initializer: incluye bastante más código, pero te hará falta de todas formas para cargar las traducciones
+ key_files: Los archivos de la aplicación implicados en la integración son
+ last_name: Apellidos
+ listing_users: Listado de usuarios
+ new_user: Nuevo usuario
+ routes_file: puedes ver cómo añadir la traducción a las rutas de tu aplicación
+ routes_yml: traducciones para las rutas (podrían estar incluidas en los demás archivos de traducciones)
+ show: mostrar
+ test_helper: incluye el parámetro del idioma por defecto en los tests funcionales y de integración
+ the_sample_app: La aplicación de ejemplo
+ title: Aplicación de ejemplo para translate_routes
+ update: actualizar
+ user_succesfully_created: Usuario creado correctamente
+ user_succesfully_updated: Usuario creado correctamente
+
+"en-US":
+ about_integration: How to integrate translate_routes
+ app_controller: we add a filter calling set_locale_from_url, included on the plugin
+ are_you_sure: Are you sure?
+ back: back
+ create: create
+ current_locale: Current locale
+ description:
+ This is a sample application to show how easily you can integrate the translate_routes
+ plugin to your Rails applications using the new I18n system.
+ destroy: delete
+ edit: edit
+ editing_user: Editing user
+ first_name: First name
+ initializer: this file includes more code, but you would need it anyway to load your translation files
+ last_name: Last name
+ listing_users: Listing users
+ key_files: The application files involved on the integration are
+ new_user: New user
+ routes_file: one line of code add translation to your application routes
+ routes_yml: routes translations - they could be included into the other translation files
+ show: show
+ test_helper: includes the default locale parameter to your functional and integration tests
+ the_sample_app: The sample application
+ title: Sample translate routes application
+ update: update
+ user_succesfully_created: User created succesfully
+ user_succesfully_updated: User updated succesfully
View
7,691 sample_app/log/development.log
7,691 additions, 0 deletions not shown
View
183 sample_app/log/production.log
@@ -0,0 +1,183 @@
+
+
+Processing UsersController#index (for 127.0.0.1 at 2008-10-25 02:31:56) [GET]
+ Session ID: BAh7BzoMY3NyZl9pZCIlYWVmYWQxMDMzNDM2OTIzZmQzOGFlZTUyNzUzODJmYmMiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhhc2h7AAY6CkB1c2VkewA=--9f40a88b9406312509515868ec7620e70b86c49c
+ Parameters: {"action"=>"index", "controller"=>"users", "locale"=>"es-ES"}
+Rendering template within layouts/application
+Rendering users/index
+Completed in 8ms (View: 3, DB: 3) | 200 OK [http://localhost/es-ES/usuarios]
+
+
+Processing UsersController#index (for 127.0.0.1 at 2008-10-25 02:32:00) [GET]
+ Session ID: BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7ADoMY3NyZl9pZCIlYWVmYWQxMDMzNDM2OTIzZmQzOGFlZTUyNzUzODJmYmM=--1320ce1b6246688308a9320a8df6bd130bd72ce0
+ Parameters: {"action"=>"index", "controller"=>"users", "locale"=>"en-US"}
+Rendering template within layouts/application
+Rendering users/index
+Completed in 3ms (View: 2, DB: 0) | 200 OK [http://localhost/users]
+
+
+Processing UsersController#new (for 127.0.0.1 at 2008-10-25 02:32:03) [GET]
+ Session ID: BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7ADoMY3NyZl9pZCIlYWVmYWQxMDMzNDM2OTIzZmQzOGFlZTUyNzUzODJmYmM=--1320ce1b6246688308a9320a8df6bd130bd72ce0
+ Parameters: {"action"=>"new", "controller"=>"users", "locale"=>"en-US"}
+Rendering template within layouts/application
+Rendering users/new
+Completed in 7ms (View: 5, DB: 0) | 200 OK [http://localhost/users/new]
+
+
+Processing UsersController#create (for 127.0.0.1 at 2008-10-25 02:32:11) [POST]
+ Session ID: BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7ADoMY3NyZl9pZCIlYWVmYWQxMDMzNDM2OTIzZmQzOGFlZTUyNzUzODJmYmM=--1320ce1b6246688308a9320a8df6bd130bd72ce0
+ Parameters: {"user"=>{"first_name"=>"Foo", "last_name"=>"Bar"}, "commit"=>"Create", "action"=>"create", "controller"=>"users", "locale"=>"en-US"}
+Redirected to #<User:0x25d41a0>
+Completed in 9ms (DB: 1) | 302 Found [http://localhost/users]
+
+
+Processing UsersController#show (for 127.0.0.1 at 2008-10-25 02:32:11) [GET]
+ Session ID: BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsGOgtub3RpY2UiI1VzZXIgd2FzIHN1Y2Nlc3NmdWxseSBjcmVhdGVkLgY6CkB1c2VkewY7BkY6DGNzcmZfaWQiJWFlZmFkMTAzMzQzNjkyM2ZkMzhhZWU1Mjc1MzgyZmJj--f285d17f1d5abc96707ec6ed515b45d201c51c8d
+ Parameters: {"action"=>"show", "id"=>"1", "controller"=>"users", "locale"=>"en-US"}
+Rendering template within layouts/application
+Rendering users/show
+Completed in 3ms (View: 2, DB: 1) | 200 OK [http://localhost/users/1]
+
+
+Processing UsersController#show (for 127.0.0.1 at 2008-10-25 02:32:16) [GET]
+ Session ID: BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsGOgtub3RpY2UiI1VzZXIgd2FzIHN1Y2Nlc3NmdWxseSBjcmVhdGVkLgY6CkB1c2VkewY7BlQ6DGNzcmZfaWQiJWFlZmFkMTAzMzQzNjkyM2ZkMzhhZWU1Mjc1MzgyZmJj--00b8ab2fcea6322ea6b25bf2320cb0375a1be843
+ Parameters: {"action"=>"show", "id"=>"1", "controller"=>"users", "locale"=>"es-ES"}
+Rendering template within layouts/application
+Rendering users/show
+Completed in 3ms (View: 2, DB: 0) | 200 OK [http://localhost/es-ES/usuarios/1]
+
+
+Processing UsersController#index (for 127.0.0.1 at 2008-10-25 02:32:19) [GET]
+ Session ID: BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7ADoMY3NyZl9pZCIlYWVmYWQxMDMzNDM2OTIzZmQzOGFlZTUyNzUzODJmYmM=--1320ce1b6246688308a9320a8df6bd130bd72ce0
+ Parameters: {"action"=>"index", "controller"=>"users", "locale"=>"es-ES"}
+Rendering template within layouts/application
+Rendering users/index
+Completed in 4ms (View: 2, DB: 1) | 200 OK [http://localhost/es-ES/usuarios]
+
+
+Processing UsersController#index (for 127.0.0.1 at 2008-10-25 02:32:25) [GET]
+ Session ID: BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7ADoMY3NyZl9pZCIlYWVmYWQxMDMzNDM2OTIzZmQzOGFlZTUyNzUzODJmYmM=--1320ce1b6246688308a9320a8df6bd130bd72ce0
+ Parameters: {"action"=>"index", "controller"=>"users", "locale"=>"en-US"}
+Rendering template within layouts/application
+Rendering users/index
+Completed in 4ms (View: 2, DB: 1) | 200 OK [http://localhost/users]
+
+
+Processing UsersController#index (for 127.0.0.1 at 2008-10-25 02:43:32) [GET]
+ Session ID: BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7ADoMY3NyZl9pZCIlYWVmYWQxMDMzNDM2OTIzZmQzOGFlZTUyNzUzODJmYmM=--1320ce1b6246688308a9320a8df6bd130bd72ce0
+ Parameters: {"action"=>"index", "controller"=>"users", "locale"=>"en-US"}
+Rendering template within layouts/application
+Rendering users/index
+Completed in 11ms (View: 6, DB: 3) | 200 OK [http://localhost/users]
+
+
+Processing UsersController#index (for 127.0.0.1 at 2008-10-25 02:43:36) [GET]
+ Session ID: BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7ADoMY3NyZl9pZCIlYWVmYWQxMDMzNDM2OTIzZmQzOGFlZTUyNzUzODJmYmM=--1320ce1b6246688308a9320a8df6bd130bd72ce0
+ Parameters: {"action"=>"index", "controller"=>"users", "locale"=>"es-ES"}
+Rendering template within layouts/application
+Rendering users/index
+Completed in 4ms (View: 2, DB: 1) | 200 OK [http://localhost/es-ES/usuarios]
+
+
+Processing UsersController#show (for 127.0.0.1 at 2008-10-25 02:43:41) [GET]
+ Session ID: BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7ADoMY3NyZl9pZCIlYWVmYWQxMDMzNDM2OTIzZmQzOGFlZTUyNzUzODJmYmM=--1320ce1b6246688308a9320a8df6bd130bd72ce0
+ Parameters: {"action"=>"show", "id"=>"1", "controller"=>"users", "locale"=>"es-ES"}
+Rendering template within layouts/application
+Rendering users/show
+Completed in 4ms (View: 2, DB: 1) | 200 OK [http://localhost/es-ES/usuarios/1]
+
+
+Processing UsersController#show (for 127.0.0.1 at 2008-10-25 02:43:51) [GET]
+ Session ID: BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7ADoMY3NyZl9pZCIlYWVmYWQxMDMzNDM2OTIzZmQzOGFlZTUyNzUzODJmYmM=--1320ce1b6246688308a9320a8df6bd130bd72ce0
+ Parameters: {"action"=>"show", "id"=>"1", "controller"=>"users", "locale"=>"es-ES"}
+Rendering template within layouts/application
+Rendering users/show
+Completed in 12ms (View: 4, DB: 0) | 200 OK [http://localhost/es-ES/usuarios/1]
+
+
+Processing UsersController#index (for 127.0.0.1 at 2008-10-25 02:43:53) [GET]
+ Session ID: BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7ADoMY3NyZl9pZCIlYWVmYWQxMDMzNDM2OTIzZmQzOGFlZTUyNzUzODJmYmM=--1320ce1b6246688308a9320a8df6bd130bd72ce0
+ Parameters: {"action"=>"index", "controller"=>"users", "locale"=>"es-ES"}
+Rendering template within layouts/application
+Rendering users/index
+Completed in 7ms (View: 5, DB: 1) | 200 OK [http://localhost/es-ES/usuarios]
+
+
+Processing UsersController#index (for 127.0.0.1 at 2008-10-25 02:43:56) [GET]
+ Session ID: BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7ADoMY3NyZl9pZCIlYWVmYWQxMDMzNDM2OTIzZmQzOGFlZTUyNzUzODJmYmM=--1320ce1b6246688308a9320a8df6bd130bd72ce0
+ Parameters: {"action"=>"index", "controller"=>"users", "locale"=>"en-US"}
+Rendering template within layouts/application
+Rendering users/index
+Completed in 3ms (View: 2, DB: 0) | 200 OK [http://localhost/users]
+
+
+Processing UsersController#show (for 127.0.0.1 at 2008-10-25 02:43:59) [GET]
+ Session ID: BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7ADoMY3NyZl9pZCIlYWVmYWQxMDMzNDM2OTIzZmQzOGFlZTUyNzUzODJmYmM=--1320ce1b6246688308a9320a8df6bd130bd72ce0
+ Parameters: {"action"=>"show", "id"=>"1", "controller"=>"users", "locale"=>"en-US"}
+Rendering template within layouts/application
+Rendering users/show
+Completed in 3ms (View: 2, DB: 0) | 200 OK [http://localhost/users/1]
+
+
+Processing UsersController#index (for 127.0.0.1 at 2008-10-25 02:44:01) [GET]
+ Session ID: BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7ADoMY3NyZl9pZCIlYWVmYWQxMDMzNDM2OTIzZmQzOGFlZTUyNzUzODJmYmM=--1320ce1b6246688308a9320a8df6bd130bd72ce0
+ Parameters: {"action"=>"index", "controller"=>"users", "locale"=>"en-US"}
+Rendering template within layouts/application
+Rendering users/index
+Completed in 7ms (View: 4, DB: 1) | 200 OK [http://localhost/users]
+
+
+Processing UsersController#index (for 127.0.0.1 at 2008-10-25 02:44:08) [GET]
+ Session ID: BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7ADoMY3NyZl9pZCIlYWVmYWQxMDMzNDM2OTIzZmQzOGFlZTUyNzUzODJmYmM=--1320ce1b6246688308a9320a8df6bd130bd72ce0
+ Parameters: {"action"=>"index", "controller"=>"users", "locale"=>"es-ES"}
+Rendering template within layouts/application
+Rendering users/index
+Completed in 3ms (View: 2, DB: 0) | 200 OK [http://localhost/es-ES/usuarios]
+
+
+Processing UsersController#index (for 127.0.0.1 at 2008-10-25 02:48:26) [GET]
+ Session ID: BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7ADoMY3NyZl9pZCIlYWVmYWQxMDMzNDM2OTIzZmQzOGFlZTUyNzUzODJmYmM=--1320ce1b6246688308a9320a8df6bd130bd72ce0
+ Parameters: {"action"=>"index", "controller"=>"users", "locale"=>"es-ES"}
+Rendering template within layouts/application
+Rendering users/index
+Completed in 12ms (View: 6, DB: 3) | 200 OK [http://localhost/es-ES/usuarios]
+
+
+Processing UsersController#index (for 127.0.0.1 at 2008-10-25 02:48:32) [GET]
+ Session ID: BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7ADoMY3NyZl9pZCIlYWVmYWQxMDMzNDM2OTIzZmQzOGFlZTUyNzUzODJmYmM=--1320ce1b6246688308a9320a8df6bd130bd72ce0
+ Parameters: {"action"=>"index", "controller"=>"users", "locale"=>"en-US"}
+Rendering template within layouts/application
+Rendering users/index
+Completed in 3ms (View: 2, DB: 0) | 200 OK [http://localhost/users]
+
+
+Processing UsersController#index (for 127.0.0.1 at 2008-10-25 08:27:26) [GET]
+ Session ID: BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7ADoMY3NyZl9pZCIlYWVmYWQxMDMzNDM2OTIzZmQzOGFlZTUyNzUzODJmYmM=--1320ce1b6246688308a9320a8df6bd130bd72ce0
+ Parameters: {"action"=>"index", "controller"=>"users", "locale"=>"en-US"}
+Rendering template within layouts/application
+Rendering users/index
+Completed in 15ms (View: 7, DB: 4) | 200 OK [http://localhost/users]
+
+
+Processing UsersController#index (for 127.0.0.1 at 2008-10-25 08:27:33) [GET]
+ Session ID: BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7ADoMY3NyZl9pZCIlYWVmYWQxMDMzNDM2OTIzZmQzOGFlZTUyNzUzODJmYmM=--1320ce1b6246688308a9320a8df6bd130bd72ce0
+ Parameters: {"action"=>"index", "controller"=>"users", "locale"=>"es-ES"}
+Rendering template within layouts/application
+Rendering users/index
+Completed in 8ms (View: 7, DB: 0) | 200 OK [http://localhost/es-ES/usuarios]
+
+
+Processing UsersController#index (for 127.0.0.1 at 2008-10-25 08:27:39) [GET]
+ Session ID: BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7ADoMY3NyZl9pZCIlYWVmYWQxMDMzNDM2OTIzZmQzOGFlZTUyNzUzODJmYmM=--1320ce1b6246688308a9320a8df6bd130bd72ce0
+ Parameters: {"action"=>"index", "controller"=>"users", "locale"=>"es-ES"}
+Rendering template within layouts/application
+Rendering users/index
+Completed in 6ms (View: 2, DB: 1) | 200 OK [http://localhost/es-ES/usuarios]
+
+
+Processing UsersController#index (for 127.0.0.1 at 2008-10-25 08:27:39) [GET]
+ Session ID: BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7ADoMY3NyZl9pZCIlYWVmYWQxMDMzNDM2OTIzZmQzOGFlZTUyNzUzODJmYmM=--1320ce1b6246688308a9320a8df6bd130bd72ce0
+ Parameters: {"action"=>"index", "controller"=>"users", "locale"=>"es-ES"}
+Rendering template within layouts/application
+Rendering users/index
+Completed in 6ms (View: 4, DB: 0) | 200 OK [http://localhost/es-ES/usuarios]
View
0  sample_app/log/server.log
No changes.
View
508 sample_app/log/test.log
@@ -0,0 +1,508 @@
+ SQL (0.9ms) SELECT count(*) AS count_all FROM "users" 
+ SQL (0.4ms) SELECT count(*) AS count_all FROM "users" 
+ User Load (0.4ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+ User Load (0.5ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+ User Load (0.4ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+ User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+ SQL (0.5ms) SELECT count(*) AS count_all FROM "users" 
+
+
+Processing UsersController#create (for 0.0.0.0 at 2008-10-25 02:27:18) [POST]
+ Session ID:
+ Parameters: {"user"=>{}, "action"=>"create", "controller"=>"users", "locale"=>"en-US"}
+ User Create (0.5ms) INSERT INTO "users" ("updated_at", "first_name", "last_name", "created_at") VALUES('2008-10-25 00:27:18', NULL, NULL, '2008-10-25 00:27:18')
+Redirected to #<User:0x23db68c>
+Completed in 9ms (DB: 4) | 302 Found [http://test.host/users?]
+ SQL (0.2ms) SELECT count(*) AS count_all FROM "users" 
+ SQL (0.2ms) SELECT count(*) AS count_all FROM "users" 
+ User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+
+
+Processing UsersController#destroy (for 0.0.0.0 at 2008-10-25 02:27:18) [DELETE]
+ Session ID:
+ Parameters: {"action"=>"destroy", "id"=>"953125641", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+ User Destroy (0.3ms)  DELETE FROM "users"
+ WHERE "id" = 953125641
+
+Redirected to http://test.host/users
+Completed in 3ms (DB: 1) | 302 Found [http://test.host/users/953125641]
+ SQL (0.2ms) SELECT count(*) AS count_all FROM "users" 
+ User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+
+
+Processing UsersController#edit (for 0.0.0.0 at 2008-10-25 02:27:18) [GET]
+ Session ID:
+ Parameters: {"action"=>"edit", "id"=>"953125641", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+Rendering template within layouts/application
+Rendering users/edit
+Completed in 6ms (View: 4, DB: 1) | 200 OK [http://test.host/users/953125641/edit]
+
+
+Processing UsersController#index (for 0.0.0.0 at 2008-10-25 02:27:18) [GET]
+ Session ID:
+ Parameters: {"action"=>"index", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.4ms) SELECT * FROM "users" 
+Rendering template within layouts/application
+Rendering users/index
+Completed in 7ms (View: 4, DB: 0) | 200 OK [http://test.host/users]
+
+
+Processing UsersController#new (for 0.0.0.0 at 2008-10-25 02:27:18) [GET]
+ Session ID:
+ Parameters: {"action"=>"new", "controller"=>"users", "locale"=>"en-US"}
+Rendering template within layouts/application
+Rendering users/new
+Completed in 5ms (View: 3, DB: 0) | 200 OK [http://test.host/users/new]
+ User Load (0.4ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+
+
+Processing UsersController#show (for 0.0.0.0 at 2008-10-25 02:27:18) [GET]
+ Session ID:
+ Parameters: {"action"=>"show", "id"=>"953125641", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+Rendering template within layouts/application
+Rendering users/show
+Completed in 4ms (View: 2, DB: 1) | 200 OK [http://test.host/users/953125641]
+ User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+
+
+Processing UsersController#update (for 0.0.0.0 at 2008-10-25 02:27:18) [PUT]
+ Session ID:
+ Parameters: {"user"=>{}, "action"=>"update", "id"=>"953125641", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+Redirected to #<User:0x235ea24>
+Completed in 3ms (DB: 1) | 302 Found [http://test.host/users/953125641?]
+ SQL (0.6ms) SELECT count(*) AS count_all FROM "users" 
+
+
+Processing UsersController#create (for 0.0.0.0 at 2008-10-25 02:28:27) [POST]
+ Session ID:
+ Parameters: {"user"=>{}, "action"=>"create", "controller"=>"users", "locale"=>"en-US"}
+ User Create (0.6ms) INSERT INTO "users" ("updated_at", "first_name", "last_name", "created_at") VALUES('2008-10-25 00:28:27', NULL, NULL, '2008-10-25 00:28:27')
+Redirected to #<User:0x23db9fc>
+Completed in 10ms (DB: 4) | 302 Found [http://test.host/users?]
+ SQL (0.3ms) SELECT count(*) AS count_all FROM "users" 
+ SQL (0.4ms) SELECT count(*) AS count_all FROM "users" 
+ User Load (0.4ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+
+
+Processing UsersController#destroy (for 0.0.0.0 at 2008-10-25 02:28:27) [DELETE]
+ Session ID:
+ Parameters: {"action"=>"destroy", "id"=>"953125641", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.4ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+ User Destroy (0.4ms)  DELETE FROM "users"
+ WHERE "id" = 953125641
+
+Redirected to http://test.host/users
+Completed in 3ms (DB: 2) | 302 Found [http://test.host/users/953125641]
+ SQL (0.2ms) SELECT count(*) AS count_all FROM "users" 
+ User Load (0.6ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+
+
+Processing UsersController#edit (for 0.0.0.0 at 2008-10-25 02:28:27) [GET]
+ Session ID:
+ Parameters: {"action"=>"edit", "id"=>"953125641", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.4ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+Rendering template within layouts/application
+Rendering users/edit
+Completed in 8ms (View: 7, DB: 1) | 200 OK [http://test.host/users/953125641/edit]
+
+
+Processing UsersController#index (for 0.0.0.0 at 2008-10-25 02:28:27) [GET]
+ Session ID:
+ Parameters: {"action"=>"index", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.7ms) SELECT * FROM "users" 
+Rendering template within layouts/application
+Rendering users/index
+Completed in 6ms (View: 4, DB: 1) | 200 OK [http://test.host/users]
+
+
+Processing UsersController#new (for 0.0.0.0 at 2008-10-25 02:28:27) [GET]
+ Session ID:
+ Parameters: {"action"=>"new", "controller"=>"users", "locale"=>"en-US"}
+Rendering template within layouts/application
+Rendering users/new
+Completed in 3ms (View: 3, DB: 0) | 200 OK [http://test.host/users/new]
+ User Load (0.4ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+
+
+Processing UsersController#show (for 0.0.0.0 at 2008-10-25 02:28:27) [GET]
+ Session ID:
+ Parameters: {"action"=>"show", "id"=>"953125641", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+Rendering template within layouts/application
+Rendering users/show
+Completed in 3ms (View: 2, DB: 1) | 200 OK [http://test.host/users/953125641]
+ User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+
+
+Processing UsersController#update (for 0.0.0.0 at 2008-10-25 02:28:27) [PUT]
+ Session ID:
+ Parameters: {"user"=>{}, "action"=>"update", "id"=>"953125641", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+Redirected to #<User:0x2364e10>
+Completed in 3ms (DB: 1) | 302 Found [http://test.host/users/953125641?]
+ SQL (0.6ms) SELECT count(*) AS count_all FROM "users" 
+ SQL (0.3ms) SELECT count(*) AS count_all FROM "users" 
+ User Load (0.4ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+ User Load (0.4ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+ User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+ User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+ SQL (0.6ms) SELECT count(*) AS count_all FROM "users" 
+ SQL (0.3ms) SELECT count(*) AS count_all FROM "users" 
+ User Load (0.4ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+ User Load (0.4ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+ User Load (0.4ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+ User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+ SQL (0.4ms) SELECT count(*) AS count_all FROM "users" 
+
+
+Processing UsersController#create (for 0.0.0.0 at 2008-10-25 02:48:10) [POST]
+ Session ID:
+ Parameters: {"user"=>{}, "action"=>"create", "controller"=>"users", "locale"=>"en-US"}
+ User Create (0.5ms) INSERT INTO "users" ("updated_at", "first_name", "last_name", "created_at") VALUES('2008-10-25 00:48:10', NULL, NULL, '2008-10-25 00:48:10')
+Redirected to #<User:0x23de314>
+Completed in 7ms (DB: 4) | 302 Found [http://test.host/users?]
+ SQL (0.2ms) SELECT count(*) AS count_all FROM "users" 
+ SQL (0.3ms) SELECT count(*) AS count_all FROM "users" 
+ User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+
+
+Processing UsersController#destroy (for 0.0.0.0 at 2008-10-25 02:48:10) [DELETE]
+ Session ID:
+ Parameters: {"action"=>"destroy", "id"=>"953125641", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+ User Destroy (0.4ms)  DELETE FROM "users"
+ WHERE "id" = 953125641
+
+Redirected to http://test.host/users
+Completed in 2ms (DB: 1) | 302 Found [http://test.host/users/953125641]
+ SQL (0.2ms) SELECT count(*) AS count_all FROM "users" 
+ User Load (0.4ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+
+
+Processing UsersController#edit (for 0.0.0.0 at 2008-10-25 02:48:10) [GET]
+ Session ID:
+ Parameters: {"action"=>"edit", "id"=>"953125641", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+Rendering template within layouts/application
+Rendering users/edit
+Completed in 6ms (View: 5, DB: 1) | 200 OK [http://test.host/users/953125641/edit]
+
+
+Processing UsersController#index (for 0.0.0.0 at 2008-10-25 02:48:10) [GET]
+ Session ID:
+ Parameters: {"action"=>"index", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.5ms) SELECT * FROM "users" 
+Rendering template within layouts/application
+Rendering users/index
+Completed in 4ms (View: 3, DB: 0) | 200 OK [http://test.host/users]
+
+
+Processing UsersController#new (for 0.0.0.0 at 2008-10-25 02:48:10) [GET]
+ Session ID:
+ Parameters: {"action"=>"new", "controller"=>"users", "locale"=>"en-US"}
+Rendering template within layouts/application
+Rendering users/new
+Completed in 4ms (View: 3, DB: 0) | 200 OK [http://test.host/users/new]
+ User Load (0.4ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+
+
+Processing UsersController#show (for 0.0.0.0 at 2008-10-25 02:48:10) [GET]
+ Session ID:
+ Parameters: {"action"=>"show", "id"=>"953125641", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+Rendering template within layouts/application
+Rendering users/show
+Completed in 3ms (View: 2, DB: 1) | 200 OK [http://test.host/users/953125641]
+ User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+
+
+Processing UsersController#update (for 0.0.0.0 at 2008-10-25 02:48:10) [PUT]
+ Session ID:
+ Parameters: {"user"=>{}, "action"=>"update", "id"=>"953125641", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+Redirected to #<User:0x2366530>
+Completed in 2ms (DB: 1) | 302 Found [http://test.host/users/953125641?]
+ SQL (0.6ms) SELECT count(*) AS count_all FROM "users" 
+
+
+Processing UsersController#create (for 0.0.0.0 at 2008-10-25 17:12:38) [POST]
+ Session ID:
+ Parameters: {"user"=>{}, "action"=>"create", "controller"=>"users", "locale"=>"en-US"}
+ User Create (0.7ms) INSERT INTO "users" ("updated_at", "first_name", "last_name", "created_at") VALUES('2008-10-25 15:12:38', NULL, NULL, '2008-10-25 15:12:38')
+Redirected to #<User:0x23cc7e0>
+Completed in 10ms (DB: 4) | 302 Found [http://test.host/users?]
+ SQL (0.4ms) SELECT count(*) AS count_all FROM "users" 
+ SQL (0.4ms) SELECT count(*) AS count_all FROM "users" 
+ User Load (0.4ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+
+
+Processing UsersController#destroy (for 0.0.0.0 at 2008-10-25 17:12:38) [DELETE]
+ Session ID:
+ Parameters: {"action"=>"destroy", "id"=>"953125641", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.4ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+ User Destroy (0.4ms)  DELETE FROM "users"
+ WHERE "id" = 953125641
+
+Redirected to http://test.host/users
+Completed in 3ms (DB: 2) | 302 Found [http://test.host/users/953125641]
+ SQL (0.2ms) SELECT count(*) AS count_all FROM "users" 
+ User Load (0.6ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+
+
+Processing UsersController#edit (for 0.0.0.0 at 2008-10-25 17:12:38) [GET]
+ Session ID:
+ Parameters: {"action"=>"edit", "id"=>"953125641", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.4ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+Rendering template within layouts/application
+Rendering users/edit
+Completed in 8ms (View: 6, DB: 1) | 200 OK [http://test.host/users/953125641/edit]
+
+
+Processing UsersController#index (for 0.0.0.0 at 2008-10-25 17:12:38) [GET]
+ Session ID:
+ Parameters: {"action"=>"index", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.5ms) SELECT * FROM "users" 
+Rendering template within layouts/application
+Rendering users/index
+Completed in 5ms (View: 3, DB: 1) | 200 OK [http://test.host/users]
+
+
+Processing UsersController#new (for 0.0.0.0 at 2008-10-25 17:12:38) [GET]
+ Session ID:
+ Parameters: {"action"=>"new", "controller"=>"users", "locale"=>"en-US"}
+Rendering template within layouts/application
+Rendering users/new
+Completed in 3ms (View: 3, DB: 0) | 200 OK [http://test.host/users/new]
+ User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+
+
+Processing UsersController#show (for 0.0.0.0 at 2008-10-25 17:12:38) [GET]
+ Session ID:
+ Parameters: {"action"=>"show", "id"=>"953125641", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+Rendering template within layouts/application
+Rendering users/show
+Completed in 3ms (View: 2, DB: 1) | 200 OK [http://test.host/users/953125641]
+ User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+
+
+Processing UsersController#update (for 0.0.0.0 at 2008-10-25 17:12:38) [PUT]
+ Session ID:
+ Parameters: {"user"=>{}, "action"=>"update", "id"=>"953125641", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+Redirected to #<User:0x2354588>
+Completed in 2ms (DB: 1) | 302 Found [http://test.host/users/953125641?]
+ SQL (0.6ms) SELECT count(*) AS count_all FROM "users" 
+
+
+Processing UsersController#create (for 0.0.0.0 at 2008-10-27 21:00:53) [POST]
+ Session ID:
+ Parameters: {"user"=>{}, "action"=>"create", "controller"=>"users", "locale"=>"en-US"}
+ User Create (0.6ms) INSERT INTO "users" ("updated_at", "first_name", "last_name", "created_at") VALUES('2008-10-27 20:00:53', NULL, NULL, '2008-10-27 20:00:53')
+Redirected to #<User:0x23b467c>
+Completed in 11ms (DB: 4) | 302 Found [http://test.host/users?]
+ SQL (0.3ms) SELECT count(*) AS count_all FROM "users" 
+ SQL (0.4ms) SELECT count(*) AS count_all FROM "users" 
+ User Load (0.5ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+
+
+Processing UsersController#destroy (for 0.0.0.0 at 2008-10-27 21:00:53) [DELETE]
+ Session ID:
+ Parameters: {"action"=>"destroy", "id"=>"953125641", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.5ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+ User Destroy (0.4ms)  DELETE FROM "users"
+ WHERE "id" = 953125641
+
+Redirected to http://test.host/users
+Completed in 3ms (DB: 2) | 302 Found [http://test.host/users/953125641]
+ SQL (0.2ms) SELECT count(*) AS count_all FROM "users" 
+ User Load (0.5ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+
+
+Processing UsersController#edit (for 0.0.0.0 at 2008-10-27 21:00:53) [GET]
+ Session ID:
+ Parameters: {"action"=>"edit", "id"=>"953125641", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.4ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+Rendering template within layouts/application
+Rendering users/edit
+Completed in 11ms (View: 9, DB: 1) | 200 OK [http://test.host/users/953125641/edit]
+
+
+Processing UsersController#index (for 0.0.0.0 at 2008-10-27 21:00:53) [GET]
+ Session ID:
+ Parameters: {"action"=>"index", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.5ms) SELECT * FROM "users" 
+Rendering template within layouts/application
+Rendering users/index
+Completed in 5ms (View: 4, DB: 1) | 200 OK [http://test.host/users]
+
+
+Processing UsersController#new (for 0.0.0.0 at 2008-10-27 21:00:53) [GET]
+ Session ID:
+ Parameters: {"action"=>"new", "controller"=>"users", "locale"=>"en-US"}
+Rendering template within layouts/application
+Rendering users/new
+Completed in 4ms (View: 3, DB: 0) | 200 OK [http://test.host/users/new]
+ User Load (0.4ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+
+
+Processing UsersController#show (for 0.0.0.0 at 2008-10-27 21:00:53) [GET]
+ Session ID:
+ Parameters: {"action"=>"show", "id"=>"953125641", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+Rendering template within layouts/application
+Rendering users/show
+Completed in 4ms (View: 2, DB: 1) | 200 OK [http://test.host/users/953125641]
+ User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+
+
+Processing UsersController#update (for 0.0.0.0 at 2008-10-27 21:00:53) [PUT]
+ Session ID:
+ Parameters: {"user"=>{}, "action"=>"update", "id"=>"953125641", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+Redirected to #<User:0x232a0d0>
+Completed in 2ms (DB: 1) | 302 Found [http://test.host/users/953125641?]
+ SQL (0.6ms) SELECT count(*) AS count_all FROM "users" 
+
+
+Processing UsersController#create (for 0.0.0.0 at 2008-10-27 21:34:24) [POST]
+ Session ID:
+ Parameters: {"user"=>{}, "action"=>"create", "controller"=>"users", "locale"=>"en-US"}
+ User Create (0.6ms) INSERT INTO "users" ("updated_at", "first_name", "last_name", "created_at") VALUES('2008-10-27 20:34:24', NULL, NULL, '2008-10-27 20:34:24')
+Redirected to #<User:0x2469dd8>
+Completed in 9ms (DB: 4) | 302 Found [http://test.host/users?]
+ SQL (0.2ms) SELECT count(*) AS count_all FROM "users" 
+ SQL (0.4ms) SELECT count(*) AS count_all FROM "users" 
+ User Load (0.4ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+
+
+Processing UsersController#destroy (for 0.0.0.0 at 2008-10-27 21:34:24) [DELETE]
+ Session ID:
+ Parameters: {"action"=>"destroy", "id"=>"953125641", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.4ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+ User Destroy (0.6ms)  DELETE FROM "users"
+ WHERE "id" = 953125641
+
+Redirected to http://test.host/users
+Completed in 3ms (DB: 2) | 302 Found [http://test.host/users/953125641]
+ SQL (0.3ms) SELECT count(*) AS count_all FROM "users" 
+ User Load (0.5ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+
+
+Processing UsersController#edit (for 0.0.0.0 at 2008-10-27 21:34:24) [GET]
+ Session ID:
+ Parameters: {"action"=>"edit", "id"=>"953125641", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.4ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+Rendering template within layouts/application
+Rendering users/edit
+Completed in 9ms (View: 8, DB: 1) | 200 OK [http://test.host/users/953125641/edit]
+
+
+Processing UsersController#index (for 0.0.0.0 at 2008-10-27 21:34:24) [GET]
+ Session ID:
+ Parameters: {"action"=>"index", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.5ms) SELECT * FROM "users" 
+Rendering template within layouts/application
+Rendering users/index
+Completed in 6ms (View: 4, DB: 0) | 200 OK [http://test.host/users]
+
+
+Processing UsersController#new (for 0.0.0.0 at 2008-10-27 21:34:24) [GET]
+ Session ID:
+ Parameters: {"action"=>"new", "controller"=>"users", "locale"=>"en-US"}
+Rendering template within layouts/application
+Rendering users/new
+Completed in 4ms (View: 3, DB: 0) | 200 OK [http://test.host/users/new]
+ User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+
+
+Processing UsersController#show (for 0.0.0.0 at 2008-10-27 21:34:24) [GET]
+ Session ID:
+ Parameters: {"action"=>"show", "id"=>"953125641", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+Rendering template within layouts/application
+Rendering users/show
+Completed in 4ms (View: 3, DB: 1) | 200 OK [http://test.host/users/953125641]
+ User Load (0.4ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+
+
+Processing UsersController#update (for 0.0.0.0 at 2008-10-27 21:34:24) [PUT]
+ Session ID:
+ Parameters: {"user"=>{}, "action"=>"update", "id"=>"953125641", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+Redirected to #<User:0x23dfe44>
+Completed in 2ms (DB: 1) | 302 Found [http://test.host/users/953125641?]
+ SQL (0.6ms) SELECT count(*) AS count_all FROM "users" 
+
+
+Processing UsersController#create (for 0.0.0.0 at 2008-10-27 21:37:58) [POST]
+ Session ID:
+ Parameters: {"user"=>{}, "action"=>"create", "controller"=>"users", "locale"=>"en-US"}
+ User Create (0.6ms) INSERT INTO "users" ("updated_at", "first_name", "last_name", "created_at") VALUES('2008-10-27 20:37:58', NULL, NULL, '2008-10-27 20:37:58')
+Redirected to #<User:0x23b3510>
+Completed in 10ms (DB: 4) | 302 Found [http://test.host/users?]
+ SQL (0.3ms) SELECT count(*) AS count_all FROM "users" 
+ SQL (0.4ms) SELECT count(*) AS count_all FROM "users" 
+ User Load (0.4ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+
+
+Processing UsersController#destroy (for 0.0.0.0 at 2008-10-27 21:37:58) [DELETE]
+ Session ID:
+ Parameters: {"action"=>"destroy", "id"=>"953125641", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.4ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+ User Destroy (0.4ms)  DELETE FROM "users"
+ WHERE "id" = 953125641
+
+Redirected to http://test.host/users
+Completed in 3ms (DB: 2) | 302 Found [http://test.host/users/953125641]
+ SQL (0.3ms) SELECT count(*) AS count_all FROM "users" 
+ User Load (0.6ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+
+
+Processing UsersController#edit (for 0.0.0.0 at 2008-10-27 21:37:58) [GET]
+ Session ID:
+ Parameters: {"action"=>"edit", "id"=>"953125641", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.4ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+Rendering template within layouts/application
+Rendering users/edit
+Completed in 12ms (View: 11, DB: 1) | 200 OK [http://test.host/users/953125641/edit]
+
+
+Processing UsersController#index (for 0.0.0.0 at 2008-10-27 21:37:58) [GET]
+ Session ID:
+ Parameters: {"action"=>"index", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.5ms) SELECT * FROM "users" 
+Rendering template within layouts/application
+Rendering users/index
+Completed in 7ms (View: 6, DB: 1) | 200 OK [http://test.host/users]
+
+
+Processing UsersController#new (for 0.0.0.0 at 2008-10-27 21:37:58) [GET]
+ Session ID:
+ Parameters: {"action"=>"new", "controller"=>"users", "locale"=>"en-US"}
+Rendering template within layouts/application
+Rendering users/new
+Completed in 4ms (View: 3, DB: 0) | 200 OK [http://test.host/users/new]
+ User Load (0.4ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+
+
+Processing UsersController#show (for 0.0.0.0 at 2008-10-27 21:37:58) [GET]
+ Session ID:
+ Parameters: {"action"=>"show", "id"=>"953125641", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+Rendering template within layouts/application
+Rendering users/show
+Completed in 4ms (View: 3, DB: 1) | 200 OK [http://test.host/users/953125641]
+ User Load (0.4ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+
+
+Processing UsersController#update (for 0.0.0.0 at 2008-10-27 21:37:58) [PUT]
+ Session ID:
+ Parameters: {"user"=>{}, "action"=>"update", "id"=>"953125641", "controller"=>"users", "locale"=>"en-US"}
+ User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."id" = 953125641) 
+Redirected to #<User:0x232b32c>
+Completed in 2ms (DB: 1) | 302 Found [http://test.host/users/953125641?]
View
30 sample_app/public/404.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+ <title>The page you were looking for doesn't exist (404)</title>
+ <style type="text/css">
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
+ div.dialog {
+ width: 25em;
+ padding: 0 4em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #ccc;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ }
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
+ </style>
+</head>
+
+<body>
+ <!-- This file lives in public/404.html -->
+ <div class="dialog">
+ <h1>The page you were looking for doesn't exist.</h1>
+ <p>You may have mistyped the address or the page may have moved.</p>
+ </div>
+</body>
+</html>
View
30 sample_app/public/422.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+ <title>The change you wanted was rejected (422)</title>
+ <style type="text/css">
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
+ div.dialog {
+ width: 25em;
+ padding: 0 4em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #ccc;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ }
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
+ </style>
+</head>
+
+<body>
+ <!-- This file lives in public/422.html -->
+ <div class="dialog">
+ <h1>The change you wanted was rejected.</h1>
+ <p>Maybe you tried to change something you didn't have access to.</p>
+ </div>
+</body>
+</html>
View
33 sample_app/public/500.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+ <title>We're sorry, but something went wrong (500)</title>
+ <style type="text/css">
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
+ div.dialog {
+ width: 25em;
+ padding: 0 4em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #ccc;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ }
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
+ </style>
+</head>
+
+<body>
+ <!-- This file lives in public/500.html -->
+ <div class="dialog">
+ <h1>We're sorry, but something went wrong.</h1>
+ <p>We've been notified about this issue and we'll take a look at it shortly.</p>
+ <p><small>(If you're the administrator of this website, then please read
+ the log file "<%=h RAILS_ENV %>.log"
+ to find out what went wrong.)</small></p>
+ </div>
+</body>
+</html>
View
10 sample_app/public/dispatch.cgi
@@ -0,0 +1,10 @@
+#!/opt/local/bin/ruby
+
+require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
+
+# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
+# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired
+require "dispatcher"
+
+ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
+Dispatcher.dispatch
View
24 sample_app/public/dispatch.fcgi
@@ -0,0 +1,24 @@
+#!/opt/local/bin/ruby
+#
+# You may specify the path to the FastCGI crash log (a log of unhandled
+# exceptions which forced the FastCGI instance to exit, great for debugging)
+# and the number of requests to process before running garbage collection.
+#