I'm learning Ruby and am having a question about how to make a if
inside the render to display param
only if it exists ...
Ex:
if params[:field]
puts 'field' => params[:field],
end
How do I resolve this in this code?
render :json => {
'request'=>{
'negotiation' => params[:negotiation],
'state' => params[:state],
'city' => params[:city],
},
'response'=>lista,
}
abs!