Hi all,
This adds a filter/pretty (or grid/pretty) toggle to Pools#show. I built on Pools#index
and ended up building a helper method and moving the existing code into application.js, if
this isn't too much of a taboo. We'll be using it in a lot more places. I set
class="active" on whichever is currently selected so that when we have elements
for the icons, we can style them with CSS to indicate which is selected.
There are a lot more places where this will be needed that haven't been implemented
just yet; this should make it easier to implement those.
I want to call one weird thing out because it doesn't feel right, but I can't find
a less-bad solution: I duplicated the filter_view? method between ApplicationController
and ApplicationHelper. Same exact code. The reason I got here is that I need to reference
filter_view? in a helper and/or a partial, neither of which is able to call controller
methods. I initially just moved it to ApplicationHelper instead, but it turns out that
controllers need to access it too, and controllers can't call helper methods. So for
now I duplicated it, hoping that someone will point out a much more elegant solution.
-- Matt