Here is something I don't understand. Why is the first example not working (ArgumentError) but the second?
class FooController < ActionController::Base
layout proc { request[:action] == 'index' ? 'foo' : false }
end
class FooController < ActionController::Base
layout proc { |controller| request[:action] == 'index' ? 'foo' : false }
end
I'm creating a proc
and NOT a lambda
. And I always thought only lambdas
require correct arguments.
Gets the block converted to a lambda
somewhere?