So I have a form where in an input (type: text) and a select option one next to each other. I want to be able when choosing an option from the select option (either "search from your food" or "search food") to search from the corresponding table in the database. For example: You choose from the select option "search from your food" so in the text input you query the "user_food" table. If you choose "search food" you query the "food" table. Oh, by the way I use Sqlite3 as a database (the standard for Rails).
This is how the input looks so far:
Any help would be appreciated! Thanks in advance!