This will be more readable with the ternary operator:

```ruby
user = params.has_key?(:user) ? params[:user] : 'root'
```