Next interesting thing for my Evendy.ru app - feature request to generate and import events directly to the *.ics files.
Good starting point for this type of feature - nice iCalendar gem.
Let’s add a simple link to our Event page:
Great, next let’s write our get_cal method and will add it to the methods section:
According this example, we should prepare raw blob data on server side, and send it to the our frontend application in the response param.
But to simulate download, we need to create some temporary link object, with href which points to the our raw blob.
Great, in the next step, let’s check our server side. Our CalendarCommand:
Here, we created FeaturesController and reloaded our run_command method with new calendar_response method:
And controller:
That’s it. Let’s download generated file and add our event.