I want to do an advanced search form in Rails that has these abilities:
Required
- 5
field_tags where a user can input a search term that searches a specific field in the table. - 1
field_tagthat searches all fields in the table (DONE).
Preferable
- Be able to specify operators like
AND,OR, etc. on these searches. - Be able to specify more detailed operators like SO does with
this,inquestion, etc.
How can I make this happen in practice, especially the 1st bullet point?
I haven’t tested this, someone please edit the syntax accordingly, but logically I do not see why it wouldn’t work.
app/views/posts/_form.html.erbapp/helpers/post_helper.rbapp/controllers/posts_controller.rbpublic/javascripts/post.js#make sure you include jQuery and this file into your view`