You might be able to use

```ruby
redirect_to [:edit, @user, @user.profile]
```

For this and the next condition.