>
> You can use the || (or) operator:
>
>    per_page = @params[:per_page] || 20
>
>
> David
>

I think you've got to be careful about your precedence there...

irb(main):001:0> foo = nil or 20
=> 20
irb(main):002:0> foo
=> nil
irb(main):003:0> foo = (nil or 20)
=> 20
irb(main):004:0> foo
=> 20

Though, maybe it's just irb?

-Harold