rails_admin_pdf 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,20 @@
1
+ RailsAdminPdf Gem (Engine)
2
+ ========
3
+
4
+ PDF Builder for RailsAdmin.
5
+
6
+ Installation
7
+ ========
8
+
9
+ * Add to Gemfile and bundle install:
10
+
11
+ gem "rails_admin_pdf", :git => "git://github.com/stephskardal/rails_admin_pdf.git"
12
+
13
+ * Add prawn to your main application, and create "#{class}Report" for every class that you would like to export.
14
+
15
+ * If applicable, add right to :pdf action in CanCan ability class
16
+
17
+ Copyright
18
+ ========
19
+
20
+ Copyright (c) 2012 End Point & Steph Skardal.
@@ -0,0 +1,11 @@
1
+
2
+ en:
3
+ admin:
4
+ actions:
5
+ pdf:
6
+ title: "Pdf"
7
+ menu: "Download (PDF)"
8
+ breadcrumb: "Pdf"
9
+ link: "Pdf"
10
+ bulk_link: "Download (PDF)"
11
+ done: "Pdfed"
@@ -0,0 +1,32 @@
1
+ require "rails_admin_pdf/engine"
2
+
3
+ module RailsAdminPdf
4
+ end
5
+
6
+ require 'rails_admin/config/actions'
7
+
8
+ module RailsAdmin
9
+ module Config
10
+ module Actions
11
+ class Pdf < Base
12
+ RailsAdmin::Config::Actions.register(self)
13
+
14
+ register_instance_option :member do
15
+ true
16
+ end
17
+
18
+ register_instance_option :controller do
19
+ Proc.new do
20
+ report = "#{@object.class.to_s.demodulize}Report".constantize.new
21
+ send_data report.to_pdf(@object), :filename => "#{@object.class.to_s.demodulize}_#{@object.id}.pdf", :type => "application/pdf"
22
+ end
23
+ end
24
+
25
+ register_instance_option :link_icon do
26
+ 'icon-folder-open'
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
32
+
@@ -0,0 +1,4 @@
1
+ module RailsAdminPdf
2
+ class Engine < Rails::Engine
3
+ end
4
+ end
@@ -0,0 +1,3 @@
1
+ module RailsAdminPdf
2
+ VERSION = "0.0.1"
3
+ end
metadata ADDED
@@ -0,0 +1,50 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rails_admin_pdf
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Steph Skardal
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-07-13 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description:
15
+ email: steph@endpoint.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files:
19
+ - README.md
20
+ files:
21
+ - config/locales/pdf.en.yml
22
+ - lib/rails_admin_pdf.rb
23
+ - lib/rails_admin_pdf/engine.rb
24
+ - lib/rails_admin_pdf/version.rb
25
+ - README.md
26
+ homepage:
27
+ licenses: []
28
+ post_install_message:
29
+ rdoc_options: []
30
+ require_paths:
31
+ - lib
32
+ required_ruby_version: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ required_rubygems_version: !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ requirements: []
45
+ rubyforge_project:
46
+ rubygems_version: 1.8.11
47
+ signing_key:
48
+ specification_version: 3
49
+ summary: PDF functionality for rails admin
50
+ test_files: []