Reputation: 6090
I'm trying to create a link in an eco template using Backbone Marionette with a rails backend. I'm trying to let the user download the data in CSV/XLS. If I was in a regular rails view I could do <%= link_to "CSV", surveys_path(format: "csv") %>
.
Does anyone know how I could generate a link_to piece like above within an eco template?
Upvotes: 0
Views: 141
Reputation: 6090
I actually opted to use the js-routes gem to set the route in my view and then just access it in the template via <%= @csv_route %>
.
@model.set(csv_route: Routes.survey_path(@model.get('id'), {format: 'csv'}), xls_route: Routes.survey_path(@model.get('id'), {format: 'xls'}))
Upvotes: 0