how to pass the date variable into erb puts command
function myDayClickHandler(eventObj){
var date = eventObj.data.calDayDate;
<%puts "asdf",date%>
};
Javascript and Ruby are something very different. Javascript is client-side, running in the browser. Ruby is run on the server side, separately from client-side code.
Ruby code (<% .. %> parts in your example) is run on the server.
Javascript code (var date = eventObj.data.calDayDate;) is executed in the browser. It's also executed after the Ruby code, when server has processed request and generated result page already.
If you want to know value of date on the server, you'll have to send it from the browser to the server in AJAX request. Any popular Javascript library will help with that.
To pass data to the Rails controller from Javascript, you will need to pass the data back through attaching query parameters in the url.
http://www.google.com?variable1=1&variable2=2
Then in the rails controller you access the variable using
params[:variable1] or params[:variable2]
You can use custom controller actions to perform an activity either using javascript to submit or render, or use traditional HTML. Javascript would be preferred for user experience.