You could make this something like
```ruby
@contribution = @need.contributions.build(contribution_params.merge(user: current_user))
```

The point being, you don't need to put this in a conditional, since current_user may be nil, and writing a nil into that relationship is fine. Also you can pass it in as an attribute to the model if you desire (though it is just a matter of style).