rails/actionpack/test
José Valim f149eb19d4 From now on, parameters defined in default_url_options can be absent from named routes.
This allows the following setup to work:

  # app/controllers/application_controller.rb
  class ApplicationController
    def default_url_options(options=nil)
      { :locale => I18n.locale }
    end
  end

  # From your views and controllers:
  I18n.locale                 #=> :en
  users_url                   #=> "/en/users"
  users_url(:pl)              #=> "/pl/users"
  user_url(1)                 #=> "/en/users/1"
  user_url(:pl, 1)            #=> "/pl/users/1"
  user_url(1, :locale => :pl) #=> "/pl/users/1"

If you provide all expected parameters, it still works as previously.
But if any parameter is missing, it tries to assign all possible ones
with the hash returned in default_url_options or the one passed straight
to the named route method.

Beware that default_url_options in ApplicationController is not shared
with ActionMailer, so you are required to always give the locale in your
email views.
2010-01-07 15:34:14 +01:00
..
abstract Remove duplicated url_for code and move methods shared between ActionMailer and ActionController up to AbstractController. 2010-01-07 15:31:50 +01:00
activerecord From now on, parameters defined in default_url_options can be absent from named routes. 2010-01-07 15:34:14 +01:00
controller From now on, parameters defined in default_url_options can be absent from named routes. 2010-01-07 15:34:14 +01:00
dispatch namespace in routes changes both the path and name prefix. 2010-01-06 09:51:46 +01:00
fixtures When rendering layouts with blocks, use #capture to avoid assuming that the return value is the block's content. 2009-11-05 20:08:04 -08:00
lib I18n label helper [#745 status:resolved] 2010-01-02 22:27:02 +01:00
template Use helpers.label instead of views.labels. 2010-01-07 15:31:50 +01:00
tmp Use safe tmp dir 2009-08-13 21:03:25 -05:00
abstract_unit.rb Trash string coercion rack hacks 2010-01-04 19:46:21 -06:00
active_record_unit.rb Autoload AR test case 2010-01-04 16:50:01 -06:00
ts_isolated.rb Give useful test:isolated failures 2009-11-04 12:44:06 -08:00