its not a good idea to have different logic for different formats. Here you can have just:
```
@posts = Post.published
@posts = @posts.contains(params[:search_form]) if params[:search_form]
```