Last active
December 21, 2015 10:29
-
-
Save nicolasblanco/6292715 to your computer and use it in GitHub Desktop.
DE used with any kind of objects in a search controller
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class SearchesController < ApplicationController | |
| expose(:search) { Search::Doctor.new(params[:search]) } | |
| expose(:search_results) { search.execute.page(params[:page]) } | |
| expose(:current_day) do | |
| params[:current_day].present? ? Date.parse(params[:current_day]) : Date.today | |
| end | |
| expose(:current_week) do | |
| (current_day.beginning_of_week..current_day.end_of_week).to_a | |
| end | |
| def show | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment