daru-view
daru-view copied to clipboard
Download tag for integrating with daru-io Exporters
Integrating daru-io Exporters manually each time with respond_to
blocks in the controller of the Rails app has been done in https://github.com/athityakumar/daru-io/pull/40. However, I think it'd be better for users to have a <%= download(@df) %>
tag which will do the same for the user.
Oops, seems like I linked the wrong PR ^. Integrating daru-io Exporters with 'download as {format}' has been started in https://github.com/Shekharrajak/daru_examples_io_view_rails/pull/6 manually with respond_to
blocks.
Ping @Shekharrajak
@Shekharrajak - Have a look at this helper class method added in the Rails in https://github.com/Shekharrajak/daru_examples_io_view_rails/pull/6
Can this be added as <% download %>
tag in daru-view as an optional use-case which would work when daru-io is also used?
@athityakumar , is this method will be usable in other ruby framework as well ?
@Shekharrajak - Not exactly, but should be similar. It'd have to be pipelined in a generic way (rather than respond_to), like how datatables and charts are injected into HTML.
@athityakumar , few days back I tried download button with simple html code. I have pasted it here : https://github.com/Shekharrajak/demo_download_button
Can we do something like that ?
@Shekharrajak - Oops, I had missed to see that you've replied. I think it'd be better to leave the views part of the <%= download %>
tag to be customized by the user, and just have the <%= download %>
tag do the job of respond_to
that we've implemented in the sample Rails app with the helper class.