sends zip file with test data
This commit is contained in:
17
app/controllers/admin/newsletters_controller.rb
Normal file
17
app/controllers/admin/newsletters_controller.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
require 'zip'
|
||||
class Admin::NewslettersController < Admin::BaseController
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
def users
|
||||
folder = Rails.root + "/tmp/"
|
||||
zipfile_name = folder + "emails.zip"
|
||||
|
||||
Zip::File.open(zipfile_name, Zip::File::CREATE) do |zipfile|
|
||||
zipfile.get_output_stream("emails.txt") { |os| os.write 'peter@example.com' }
|
||||
end
|
||||
send_file(File.join(folder + "emails.zip"), :type => 'application/zip')
|
||||
end
|
||||
|
||||
end
|
||||
@@ -162,5 +162,12 @@
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<li <%= "class=active" if controller_name == "newsletter" %>>
|
||||
<%= link_to admin_newsletters_path do %>
|
||||
<span class="icon-stats"></span>
|
||||
Newsletter
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
1
app/views/admin/newsletters/index.html.erb
Normal file
1
app/views/admin/newsletters/index.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
<%= link_to 'users', users_admin_newsletters_path %>
|
||||
Reference in New Issue
Block a user