Here is the problem i\'m stuck on. I want to pass the javascript variables to the rails controller.
Technically you cant pass variables between two languages.
You can pass those values to rails controller by appending in url
In your controller
def create
data = params[:date]
phone = params[:phone]
@booking = Booking.new(book_param)
if @booking.save
redirect_to root_url
else
flash[:notice_booking_failed] = true
redirect_to root_url
end
end
NOTE: Make sure you configure your config/route.rb accordingly
More Info http://guides.rubyonrails.org/routing.html