Sha256: 903b71c5ed4b0d36e7a4b8abc50b1d12a9b53580b53deca502e2bf7c8b62a182

Contents?: true

Size: 863 Bytes

Versions: 38

Compression:

Stored size: 863 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/:mls_number
    def details
      @open_houses = OpenHouse.find(params[:mls_number])
    end
    
    # get /admin/open-houses
    def admin_index
      render :layout => 'caboose/admin'      
    end
    
    # get /admin/open-houses/refresh
    def admin_refresh                  
      RetsImporter.update_helper('OpenHouse', 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

38 entries across 38 versions & 1 rubygems

Version Path
caboose-rets-0.1.56 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.55 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.54 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.53 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.52 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.51 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.50 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.49 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.48 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.47 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.46 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.45 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.44 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.43 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.42 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.41 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.40 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.39 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.38 app/controllers/caboose_rets/open_houses_controller.rb
caboose-rets-0.1.37 app/controllers/caboose_rets/open_houses_controller.rb