Hy everybody,
how can I use the "send_data" method in a radius tag?
More details:
in a RoR application I've used the method "send_data" to download e file
stored in a database table in this way:
rhtml code:
<%= link_to 'Download', :action => 'download', :id => file_list.id %>
controller code:
def download
@file = FileList.find(params[:id])
@xml = @file.xmlfile #polymorphic associations
send_data(@xml.file, :type => "txt/xml", :filename =>
"[EMAIL PROTECTED]")
end
It's work fine, but now in my radiant extension I need a tag that do the
same thing. I've developed this tag:
tag "download" do |tag|
@file_id = request.parameters[:file]
@file = FileList.find(:all, :conditions => [ "id = ?", @file_id ])
@file.each do |file|
send_data("#{file.xmlfile.file}", :type => "txt/xml", :filename =>
"#{file.filename}")
end
end
It returs me the error "undefined method send_data for #"
Anyone can help me?
Thanks and greatings
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
Radiant mailing list
Post: [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant