I want to provide csv links in a view, and I put the csv generation code in ApplicationHelper . However, I get this error:
undefined method `send_data' for #<#<Class:0x0000010151c708>:0x0000010151a070>
referring to this:
send_data content, :type => "text/plain", :filename => filename, :disposition => 'attachment'
If I put csv code in the controller, it works fine. I was hoping to use an assistant to avoid having to define routes for each controller for which I want to provide csv parameters (I have a group). How can I make send_data (and other necessary methods) available helper?
ruby ruby-on-rails ruby-on-rails-3 controller view-helpers
David May 12 '11 at 23:37 2011-05-12 23:37
source share