Here's the latest puzzle stumping me. Seems it should be simple but
I'm feeling like a moron. I would like to have a link that, when
clicked, returns the results of a pre-set find.
Here's the deal. I'm working on a contact management and scheduling
app for the photo studio I work for. I want our staff to be able to
create assignments (think of them as events). Most of the time when an
assignment is booked, a date and time are established. But sometimes
the date isn't certain. Other times we find that an assignment needs
to be rescheduled but the client doesn't yet know when.
In either of those cases, the database column "starts_at" (of type
datetime) will be empty.
I would like the user interface to have a link (something like
"Pending Assignments") which, when clicked, would find and display all
assignments for which starts_at is empty. Or starts_at.year, or
starts_at.day or whatever.
I want this to be a link rather than a form input because the find
criteria is always going to be the same.
I installed the Searchlogic gem but can't come up with how to get it
to do what I want.
I have an index action in the assignments_controller that basically
does an @assignments = Assignment.find(:all). Can I leverage that so
that it returns a select set if there is some criteria and all
Assignments if not? I guess the "some criteria" part is what eludes
Thanks for any suggestions and pointers.