I'm using FullCalendar in my app and feed it with a JSON file for the appointments.
I recently introduced few conditional but this is the error I get when try to load the appointments.json page
index.json.jbuilder:15: syntax error, unexpected keyword_end, expecting end-of-input
Here is my code to generate the json file with jbuider
json.array! @appointments do |a|
json.ignore_nill!
json.extract! a, :id, :description, :patient_id
if a.patient.blank? && a.description.blank?
json.title "Appuntamento"
end
if a.patient.blank? && a.description.present?
json.title a.description
end
if a.patient.present? && a.description.present?
json.title a.patient.fullname_lastnameFirst + "\n" + a.description.capitalize
end
if a.seat.blank?
json.color "rgb(122, 122, 122)"
else
json.color a.seat.color
end
json.start a.starting_time
json.end a.ending_time
json.url appointment_url(a)
end
Any idea where it could be the problem with the missing end of input? Thanks already for the help