daru-view icon indicating copy to clipboard operation
daru-view copied to clipboard

Download tag for integrating with daru-io Exporters

Open athityakumar opened this issue 7 years ago • 6 comments

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.

athityakumar avatar Aug 05 '17 14:08 athityakumar

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

athityakumar avatar Aug 06 '17 23:08 athityakumar

@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 avatar Aug 09 '17 01:08 athityakumar

@athityakumar , is this method will be usable in other ruby framework as well ?

Shekharrajak avatar Aug 09 '17 03:08 Shekharrajak

@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 avatar Aug 09 '17 10:08 athityakumar

@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 avatar Aug 10 '17 16:08 Shekharrajak

@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.

athityakumar avatar Aug 22 '17 15:08 athityakumar