Add Widget class to produce button/widget(s) to embed directly in views
jaredlt opened this issue · comments
Eg.
@cal_widget = AddToCalendar::Widget.new(event_attributes)
# view.html.erb
<%= @cal_widget.button %> # or link or whatever
design one first inspired eg. https://www.addevent.com/products/add-to-calendar-button
but think about how to handle different styling etc.
Have pre-made versions for bootstrap, bulma etc?
- https://stackoverflow.com/questions/27631265/include-gems-assets-in-rails-4
- https://stackoverflow.com/questions/22900375/how-to-serve-image-assets-from-an-engine-in-a-rails-app
- https://stackoverflow.com/questions/21701099/how-to-access-a-filepng-file-generated-by-a-gem-in-my-rails-application
- https://medium.com/@paulfarino/wrap-your-assets-in-a-gem-3ad7ecf5b075