簡潔寫法
```ruby
@post.destroy
redirect_to (@post.board_id ? board_path(@post.board) : posts_path)
```