Defaulting parameters to false In my rails controllers,  I am consistently using this logic:

def report
  dump = params[:dump] ? params[:dump] : 'false'

  data = {}

  if dump != 'false'
    return render :json =&gt; p(data)
  end
end


Is there a better way to write this?  A ternary operation is just an eyesore.  I thought maybe just using the || operator:

dump = params[:dump] || false


But that doesn't yield the desired result.  

How can I better write this?
I'm unclear how you are using dump = false and whether the method returns anything more than nil when params[:dump] is unassigned. If it doesn't, I would recommend the use of a guard clause:

def report
  return unless params[:dump]
  data = {}
  render :json =&gt; p(data)
end