I’ve been going through the Jump Start Sinatra book and nearing the end.
I’m checking out Rack::Protection::EscapedParams but when I try to update with jQuery’s Datepicker I get an ArgumentError - invalid date: 500 Internal Server Error. Any ideas or why this error occurs?
This is what my date looks like:
class Song
...
def released_on=date
super Date.strptime(date, '%m/%d/%Y')
end
end
I believe I’ve found the answer to my problem. I think it has to do with the original format with the forward slash and how Rack::Protection::EscapedPams handles those. I fixed my problem by explicitly setting the date format coming from the Datepicker object. The default Datepicker format is “02/08/2015”