example will not work in 1.9+

colinsurprenant Oct 3, 2011

Since 1.9 introduces native threads, we cannot assume the order of exectution and the example above is not thread safe and fails with a "deadlock detected (fatal)" error. Also Thread.pass is pointless in the context of native threads.

This will work as intended with native threads:

a = Thread....

Without module

leente Sep 30, 2011

If you want to have only the path prefix without namespacing your controller, pass :module => false.

Normal:

namespace :account do
  resources :transactions, :only => [:index]
end

account_transactions GET /account/transactions(.:format)
{:controller=>"account/transactions", :a...

1.9 behavior

jrochkind Sep 27, 2011

"In Ruby 1.9 and newer mb_chars returns self'"

This would seem to be a lie. At least in rails 3.1.0 and ruby 1.9.2, mb_chars still returns a proxy object with additional useful methods defined on it that aren't on a 1.9.2 String.

ruby-1.9.2-p180 :007 >  "àáâãäå".normalize(:kd)
NoMethodE...

more options

ssoroka Sep 13, 2011

useful options are:

:root => 'object', :skip_instruct => true, :indent => 2

:builder can also be used to pass your own Builder::XmlMarkup instance.