Sha256: 4639182081c1f2843044f0a8c97e4aed2aa54869845233bf311406e2d2b25e4e

Contents?: true

Size: 841 Bytes

Versions: 41

Compression:

Stored size: 841 Bytes

Contents

require "open-uri"

module CabooseRets
  class OpenHousesController < ApplicationController
    
    # get /open-houses
    def index
      @open_houses = OpenHouse.where("open_house_type = 'PUB' and open_house_date >= '#{DateTime.now.strftime("%F")}'").reorder("open_house_date, start_time").all
    end
    
    # get /open-houses/:id
    def details
      @open_houses = OpenHouse.find(params[:id])
    end
    
    # get /admin/open-houses
    def admin_index
      render :layout => 'caboose/admin'      
    end
    
    # get /admin/open-houses/refresh
    def admin_refresh                  
      RetsImporter.update_helper('OPH', DateTime.parse(1.month.ago.strftime('%F %T')))
      resp = Caboose::StdClass.new
      resp.success = "The open houses have been refreshed successfully."
      render :json => resp
    end

  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
caboose-rets-0.1.18 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.17 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.16 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.15 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.14 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.13 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.12 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.11 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.10 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.9 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.8 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.7 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.6 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.5 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.4 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.3 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.2 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.1 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.0.87 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.0.86 app/controllers/caboose_rets/open_houses_controller.rb