rails_admin_pdf 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +20 -0
- data/config/locales/pdf.en.yml +11 -0
- data/lib/rails_admin_pdf.rb +32 -0
- data/lib/rails_admin_pdf/engine.rb +4 -0
- data/lib/rails_admin_pdf/version.rb +3 -0
- metadata +50 -0
data/README.md
ADDED
@@ -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,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
|
+
|
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: []
|