Topic: Different view result according to filter and text box
Googled a lot about this one. Maybe i'm missing something here...
I have an index page with:
date filter | department filter | text_box(user) | text_box(phone_number)
The filters and text_box are going to filter a Model X.
Depending on the user input I have 3 possible views:
Default: no input -> I show view 1
Data filtered by date -> result 1 with (date filtered)
department filter -> view 2
department filter + user -> view 3
if the user filters by department the text_box(user) changes to a filter(listing the users from this department)
What i'm doing.
Checking params and showing the view according to result but with this i end up with a lot of ifs...
so i have the impression that i'm doing it the wrong way...
thanks in advance!