ruby on rails - Adding a Key to csv erb template output -
currently in create.csv.erb
template have this.
<%- event_headers = @event_filters -%>
<%= csv.generate_line(event_headers) %>
it generates csv file
event1,event2,event3,event4
i add sort of key or header, output looks this
events: event1,event2,event3,event4
or this
events: event1,event2,event3,event4
is possible?
use string interpolation construct string wish have :)
<%= "events: #{csv.generate_line(event_headers)}" %>
Comments
Post a Comment