Class: Refinery::Bookings::BookingsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/refinery/bookings/bookings_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



8
9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/refinery/bookings/bookings_controller.rb', line 8

def index
  # you can use meta fields from your model instead (e.g. browser_title)
  # by swapping @page for @booking in the line below:
  
  respond_to do |format|
    format.html { present(@page) }
    format.js   { render :json => { 
      :dates => @bookings.map{|b| b.date.to_date.strftime('%Y,%m,%d')},
      :start_date => Date.today.strftime('%d-%m-%Y') } }
  end
end