active_scaffold_duplicate 1.3.0 → 2.1.0
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.
- checksums.yaml +4 -4
- data/README.md +149 -0
- data/app/assets/javascripts/active_scaffold_duplicate.js +39 -0
- data/lib/active_scaffold/actions/duplicate.rb +11 -0
- data/lib/active_scaffold/helpers/duplicate_helpers.rb +24 -0
- data/lib/active_scaffold_duplicate/engine.rb +3 -0
- data/lib/active_scaffold_duplicate/subform.rb +19 -0
- data/lib/active_scaffold_duplicate/version.rb +2 -2
- data/lib/active_scaffold_duplicate.rb +3 -0
- metadata +9 -10
- data/README.textile +0 -111
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f5f1c4cf45f2d3b19627b5455855e465444dda860be61435783d4bf0343bc370
|
|
4
|
+
data.tar.gz: 1d38a8e4e5e7a9463308c23f4c0f7327acc5264b8318211c84381fd48f78ed84
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz: '
|
|
6
|
+
metadata.gz: de1f1f6928cc3e14d9582c3965f4d5494c683429a69e738c230ca8edd3684a68490c500f9df8219eab6a35eea864ac81f0a048c78d8c316611ec28b78c8510f9
|
|
7
|
+
data.tar.gz: '09bb16ccb13496eef1d29a5c035fb6f769f5ec4075283a9db5964df63be60713f5478a82441aeb6bf43d752f705c84ce2b9331477eb8e6d41a7b7aa979e22698'
|
data/README.md
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# Duplicate Action for ActiveScaffold
|
|
2
|
+
|
|
3
|
+
Currently, this gem is compatible with ActiveScaffold >= 4.4.0.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This gem adds an action to clone records. By default will only set attributes and belongs_to associations. You must override `initialize_dup` in your model or define a method to clone the record and set in `conf.duplicate.method`.
|
|
8
|
+
|
|
9
|
+
Also, adds support to duplicate rows in a subform, setting the `:duplicate` setting in the column's options, or `form_ui_options`.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
You'll need ActiveScaffold 4.4.0 or newer.
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
gem install active_scaffold_duplicate
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
#### Step 1
|
|
22
|
+
|
|
23
|
+
Override `initialize_dup` in the model to set some attributes or copy associations:
|
|
24
|
+
|
|
25
|
+
```ruby
|
|
26
|
+
# app/models/bill.rb
|
|
27
|
+
class Bill < ActiveRecord::Base
|
|
28
|
+
belongs_to :customer
|
|
29
|
+
has_many :items
|
|
30
|
+
|
|
31
|
+
def initialize_dup(other)
|
|
32
|
+
super
|
|
33
|
+
self.items = other.items.map(&:dup)
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
#### Step 2
|
|
39
|
+
|
|
40
|
+
Add duplicate action.
|
|
41
|
+
|
|
42
|
+
```ruby
|
|
43
|
+
class BillsController < ApplicationController
|
|
44
|
+
active_scaffold do |conf|
|
|
45
|
+
conf.actions << :duplicate
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
#### Step 3
|
|
51
|
+
|
|
52
|
+
Change method to `:get` in link if you want to display create form instead of cloning record. Set position to `:replace` or `:after` for inline display, or enable page rendering.
|
|
53
|
+
|
|
54
|
+
```ruby
|
|
55
|
+
class BillsController < ApplicationController
|
|
56
|
+
active_scaffold do |conf|
|
|
57
|
+
conf.duplicate.link.method = :get
|
|
58
|
+
conf.duplicate.link.position = :after
|
|
59
|
+
#conf.duplicate.link.page = true # for new page rendering
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Also you can change it globally.
|
|
65
|
+
|
|
66
|
+
```ruby
|
|
67
|
+
class ApplicationController < ActionController::Base
|
|
68
|
+
active_scaffold.set_defaults do |conf|
|
|
69
|
+
conf.duplicate.link.method = :get
|
|
70
|
+
conf.duplicate.link.position = :after
|
|
71
|
+
#conf.duplicate.link.page = true # for new page rendering
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
You can access to record which is being duplicated in your form overrides with `@old_record` variable.
|
|
77
|
+
|
|
78
|
+
If you use `:post` method, you can enable `refresh_list` to refresh the list instead of only adding new record at top, or set `action_after_clone` to open edit form for example:
|
|
79
|
+
|
|
80
|
+
```ruby
|
|
81
|
+
conf.duplicate.refresh_list = true
|
|
82
|
+
conf.duplicate.action_after_clone = :edit
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Before/after controller methods
|
|
86
|
+
|
|
87
|
+
It's possible to define some methods to add some custom code which require access to session or request params:
|
|
88
|
+
|
|
89
|
+
* For `:post` method, `before_duplicate_save(record)` and `after_duplicate_save(record)` can be defined, which will be called before and after saving the record respectively.
|
|
90
|
+
* For `:new` method, `before_duplicate_new(record)` can be defined, which will be called before rendering.
|
|
91
|
+
|
|
92
|
+
## Duplicate record in subforms
|
|
93
|
+
|
|
94
|
+
Set the `:duplicate` setting in the column's options, or `form_ui_options`.
|
|
95
|
+
|
|
96
|
+
```ruby
|
|
97
|
+
conf.columns[:lines].form_ui = nil, {duplicate: true} # set in the options for form_ui only, leaving UI as nil so subform is used
|
|
98
|
+
conf.columns[:lines].options = {duplicate: true} # set in the column options, would be available to other UI (list, show, search), although won't affect probably
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Cloning the record will send a request to `edit_associated` action in the parent controller, same as adding a new record.
|
|
102
|
+
|
|
103
|
+
### UI adapter support
|
|
104
|
+
|
|
105
|
+
The duplicate link rendered for a subform row exposes the
|
|
106
|
+
`subform_record_duplicate` UI element. UI framework adapters can add or replace
|
|
107
|
+
its HTML attributes without overriding the helper:
|
|
108
|
+
|
|
109
|
+
```ruby
|
|
110
|
+
ActiveScaffold.add_element_attributes :subform_record_duplicate,
|
|
111
|
+
class: 'btn btn-sm btn-secondary'
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
The plugin keeps the `dup` class used by its JavaScript and merges it with
|
|
115
|
+
classes supplied by the adapter.
|
|
116
|
+
|
|
117
|
+
If you want to make changes to the cloned record before added to the subform, you can override `duplicate_subform_record` method in your controller, call `super` to leave active_scaffold_duplicate to copy the submitted attributes, and then make your changes. You can check what subform was called for with `@column` variable:
|
|
118
|
+
|
|
119
|
+
```ruby
|
|
120
|
+
def duplicate_subform_row(record, ...)
|
|
121
|
+
super
|
|
122
|
+
if @column == :travel_line_items
|
|
123
|
+
record.financial_month = nil # don't copy financial month
|
|
124
|
+
record.compute_totals
|
|
125
|
+
end
|
|
126
|
+
end
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Support
|
|
130
|
+
|
|
131
|
+
If you have issues installing the gem, search / post to the [Active Scaffold](http://groups.google.com/group/activescaffold) forum or [Create an issue](http://github.com/activescaffold/active_scaffold_duplicate/issues)
|
|
132
|
+
|
|
133
|
+
## Contributing
|
|
134
|
+
|
|
135
|
+
Fork, hack, push, and request a pull:
|
|
136
|
+
|
|
137
|
+
<http://github.com/activescaffold/active_scaffold_duplicate/>
|
|
138
|
+
|
|
139
|
+
## License
|
|
140
|
+
|
|
141
|
+
Released under the MIT license (included).
|
|
142
|
+
|
|
143
|
+
## Author
|
|
144
|
+
|
|
145
|
+
Contact me:
|
|
146
|
+
|
|
147
|
+
```ruby
|
|
148
|
+
Sergio Cambra - irb(main):001:0> ( 'sergioATenpijama._see_s'.gsub('_see_', 'e').gsub('AT', '@') )
|
|
149
|
+
```
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
(function() {
|
|
2
|
+
jQuery(document).ready(function () {
|
|
3
|
+
jQuery(document).on('ajax:beforeSend', '.sub-form-record .actions .dup', function (e, xhr, settings) {
|
|
4
|
+
if (e.detail && !xhr) {
|
|
5
|
+
xhr = e.detail[0];
|
|
6
|
+
settings = e.detail[1];
|
|
7
|
+
}
|
|
8
|
+
var link = jQuery(e.target), row = link.closest('.sub-form-record'), subform = row.closest('.sub-form'),
|
|
9
|
+
url = subform.find('.as_create_another:last').attr('href');
|
|
10
|
+
if (url) {
|
|
11
|
+
var params = {};
|
|
12
|
+
row.find(':input[name]').serializeArray().forEach(function(item) {
|
|
13
|
+
var newName = item.name.replace(/^record\[/, 'dup[');
|
|
14
|
+
params[newName] = item.value;
|
|
15
|
+
});
|
|
16
|
+
var paramString = jQuery.param(params);
|
|
17
|
+
// If URL already has ?, append with & otherwise with ?
|
|
18
|
+
settings.url = url + (url.indexOf('?') !== -1 ? '&' : '?') + paramString;
|
|
19
|
+
} else {
|
|
20
|
+
e.preventDefault();
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
ActiveScaffold.setup_callbacks.push(function(container) {
|
|
26
|
+
var container = jQuery(container), new_row_subform;
|
|
27
|
+
if (container.is('.sub-form-record')) { // adding a new row to a subform
|
|
28
|
+
new_row_subform = container.closest('.sub-form');
|
|
29
|
+
if (!new_row_subform.is(':has(.as_create_another)')) return;
|
|
30
|
+
}
|
|
31
|
+
jQuery('.sub-form:has(.as_create_another)', container).add(new_row_subform).each(function () {
|
|
32
|
+
var subform = this;
|
|
33
|
+
jQuery('.sub-form-record .actions .dup', this).filter(function () {
|
|
34
|
+
return $(this).closest('.sub-form').is(subform);
|
|
35
|
+
}).show();
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
})();
|
|
@@ -27,6 +27,17 @@ module ActiveScaffold::Actions
|
|
|
27
27
|
def duplicate_authorized?(record = nil)
|
|
28
28
|
(record || self).authorized_for?(crud_type: :create, action: :duplicate, reason: true)
|
|
29
29
|
end
|
|
30
|
+
|
|
31
|
+
def do_edit_associated
|
|
32
|
+
super
|
|
33
|
+
if params[:dup]
|
|
34
|
+
attributes = params.delete(:dup)
|
|
35
|
+
@scope&.slice(1..-2)&.split('][')&.each { |scope| attributes = attributes[scope] }
|
|
36
|
+
attributes = attributes[@column.name].values
|
|
37
|
+
cfg = active_scaffold_config_for(@record.class)
|
|
38
|
+
update_record_from_params(@record, cfg.subform.columns, attributes, true)
|
|
39
|
+
end
|
|
40
|
+
end
|
|
30
41
|
|
|
31
42
|
def duplicate_respond_to_html
|
|
32
43
|
if successful?
|
|
@@ -9,6 +9,30 @@ module ActiveScaffold
|
|
|
9
9
|
columns
|
|
10
10
|
end
|
|
11
11
|
end
|
|
12
|
+
|
|
13
|
+
def active_scaffold_subform_record_actions(association_column, record, locked, scope)
|
|
14
|
+
actions = super
|
|
15
|
+
return actions if association_column.nil?
|
|
16
|
+
return actions unless association_column.association.collection?
|
|
17
|
+
return actions unless (association_column.form_ui_options || association_column.options)[:duplicate]
|
|
18
|
+
|
|
19
|
+
safe_join(
|
|
20
|
+
[
|
|
21
|
+
link_to(
|
|
22
|
+
as_(:duplicate),
|
|
23
|
+
'#',
|
|
24
|
+
as_element_attributes(
|
|
25
|
+
:subform_record_duplicate,
|
|
26
|
+
class: 'dup',
|
|
27
|
+
style: 'display: none;',
|
|
28
|
+
remote: true,
|
|
29
|
+
data: {scope: scope}
|
|
30
|
+
)
|
|
31
|
+
),
|
|
32
|
+
actions
|
|
33
|
+
]
|
|
34
|
+
)
|
|
35
|
+
end
|
|
12
36
|
end
|
|
13
37
|
end
|
|
14
38
|
end
|
|
@@ -10,5 +10,8 @@ module ActiveScaffoldDuplicate
|
|
|
10
10
|
self::ACTIVE_SCAFFOLD_CORE_ROUTING[:member][:duplicate] = [:post, :get]
|
|
11
11
|
end
|
|
12
12
|
end
|
|
13
|
+
initializer 'active_scaffold_duplicate.extensions' do
|
|
14
|
+
ActiveScaffold::Actions::Subform.prepend ActiveScaffoldDuplicate::Subform
|
|
15
|
+
end
|
|
13
16
|
end
|
|
14
17
|
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
module ActiveScaffoldDuplicate
|
|
2
|
+
module Subform
|
|
3
|
+
protected
|
|
4
|
+
def do_edit_associated
|
|
5
|
+
super
|
|
6
|
+
if params[:dup]
|
|
7
|
+
attributes = params.delete(:dup)
|
|
8
|
+
@scope&.slice(1..-2)&.split('][')&.each { |scope| attributes = attributes[scope] }
|
|
9
|
+
attributes = attributes[@column.name].values[0]
|
|
10
|
+
duplicate_subform_row(@record, attributes)
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def duplicate_subform_row(record, attributes, columns = nil)
|
|
15
|
+
cfg = active_scaffold_config_for(record.class) unless columns
|
|
16
|
+
update_record_from_params(record, columns || cfg.subform.columns, attributes, true)
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -4,6 +4,7 @@ module ActiveScaffoldDuplicate
|
|
|
4
4
|
def self.root
|
|
5
5
|
File.dirname(__FILE__) + "/.."
|
|
6
6
|
end
|
|
7
|
+
autoload :Subform, 'active_scaffold_duplicate/subform'
|
|
7
8
|
end
|
|
8
9
|
|
|
9
10
|
module ActiveScaffold
|
|
@@ -19,3 +20,5 @@ module ActiveScaffold
|
|
|
19
20
|
ActiveScaffold.autoload_subdir('helpers', self, File.dirname(__FILE__))
|
|
20
21
|
end
|
|
21
22
|
end
|
|
23
|
+
|
|
24
|
+
ActiveScaffold.javascripts << 'active_scaffold_duplicate'
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: active_scaffold_duplicate
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 2.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sergio Cambra
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: active_scaffold
|
|
@@ -16,24 +15,25 @@ dependencies:
|
|
|
16
15
|
requirements:
|
|
17
16
|
- - ">="
|
|
18
17
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 4.
|
|
18
|
+
version: 4.4.0
|
|
20
19
|
type: :runtime
|
|
21
20
|
prerelease: false
|
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
22
|
requirements:
|
|
24
23
|
- - ">="
|
|
25
24
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: 4.
|
|
25
|
+
version: 4.4.0
|
|
27
26
|
description: Clone records using a method from model in ActiveScaffold
|
|
28
27
|
email: activescaffold@googlegroups.com
|
|
29
28
|
executables: []
|
|
30
29
|
extensions: []
|
|
31
30
|
extra_rdoc_files:
|
|
32
31
|
- LICENSE.txt
|
|
33
|
-
- README.
|
|
32
|
+
- README.md
|
|
34
33
|
files:
|
|
35
34
|
- LICENSE.txt
|
|
36
|
-
- README.
|
|
35
|
+
- README.md
|
|
36
|
+
- app/assets/javascripts/active_scaffold_duplicate.js
|
|
37
37
|
- app/views/active_scaffold_overrides/duplicate.js.erb
|
|
38
38
|
- config/locales/en.yml
|
|
39
39
|
- config/locales/es.yml
|
|
@@ -42,12 +42,12 @@ files:
|
|
|
42
42
|
- lib/active_scaffold/helpers/duplicate_helpers.rb
|
|
43
43
|
- lib/active_scaffold_duplicate.rb
|
|
44
44
|
- lib/active_scaffold_duplicate/engine.rb
|
|
45
|
+
- lib/active_scaffold_duplicate/subform.rb
|
|
45
46
|
- lib/active_scaffold_duplicate/version.rb
|
|
46
47
|
homepage: http://github.com/activescaffold/active_scaffold_duplicate
|
|
47
48
|
licenses:
|
|
48
49
|
- MIT
|
|
49
50
|
metadata: {}
|
|
50
|
-
post_install_message:
|
|
51
51
|
rdoc_options: []
|
|
52
52
|
require_paths:
|
|
53
53
|
- lib
|
|
@@ -62,8 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
62
62
|
- !ruby/object:Gem::Version
|
|
63
63
|
version: '0'
|
|
64
64
|
requirements: []
|
|
65
|
-
rubygems_version: 3.
|
|
66
|
-
signing_key:
|
|
65
|
+
rubygems_version: 3.6.9
|
|
67
66
|
specification_version: 4
|
|
68
67
|
summary: Clone record gem for Activescaffold
|
|
69
68
|
test_files: []
|
data/README.textile
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
h1. Duplicate Action for ActiveScaffold
|
|
2
|
-
|
|
3
|
-
Currently, this gem is compatible with ActiveScaffold >= 3.3.x gems and rails >= 4.0.
|
|
4
|
-
Use 1.0.x for rails >= 3.x versions.
|
|
5
|
-
|
|
6
|
-
h2. Overview
|
|
7
|
-
|
|
8
|
-
This gem adds an action to clone records. By default will only set attributes and belongs_to associations. You must override initialize_dup in your model or define a method to clone the record and set in conf.duplicate.method.
|
|
9
|
-
|
|
10
|
-
h2. Installation
|
|
11
|
-
|
|
12
|
-
You'll need at least ActiveScaffold 3.3.x to use this, and rails 3.x
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<pre>
|
|
16
|
-
gem install active_scaffold_duplicate
|
|
17
|
-
</pre>
|
|
18
|
-
|
|
19
|
-
h2. Usage
|
|
20
|
-
|
|
21
|
-
h4. Step 1
|
|
22
|
-
|
|
23
|
-
Override initialize_dup in the model to set some attributes or copy associations:
|
|
24
|
-
|
|
25
|
-
<pre>
|
|
26
|
-
# app/models/bill.rb
|
|
27
|
-
class Bill < ActiveRecord::Base
|
|
28
|
-
belongs_to :customer
|
|
29
|
-
has_many :items
|
|
30
|
-
|
|
31
|
-
def initialize_dup(other)
|
|
32
|
-
super
|
|
33
|
-
self.items = other.items.map(&:dup)
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
</pre>
|
|
37
|
-
|
|
38
|
-
h4. Step 2
|
|
39
|
-
|
|
40
|
-
Add duplicate action.
|
|
41
|
-
|
|
42
|
-
<pre>
|
|
43
|
-
class BillsController < ApplicationController
|
|
44
|
-
active_scaffold do |conf|
|
|
45
|
-
conf.actions << :duplicate
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
</pre>
|
|
49
|
-
|
|
50
|
-
h4. Step 3
|
|
51
|
-
|
|
52
|
-
Change method to :get in link if you want to display create form instead of cloning record. Set position to :replace or :after for inline display, or enable page rendering.
|
|
53
|
-
|
|
54
|
-
<pre>
|
|
55
|
-
class BillsController < ApplicationController
|
|
56
|
-
active_scaffold do |conf|
|
|
57
|
-
conf.duplicate.link.method = :get
|
|
58
|
-
conf.duplicate.link.position = :after
|
|
59
|
-
#conf.duplicate.link.page = true # for new page rendering
|
|
60
|
-
end
|
|
61
|
-
end
|
|
62
|
-
</pre>
|
|
63
|
-
|
|
64
|
-
Also you can change it globally.
|
|
65
|
-
|
|
66
|
-
<pre>
|
|
67
|
-
class ApplicationController < ActionController::Base
|
|
68
|
-
active_scaffold.set_defaults do |conf|
|
|
69
|
-
conf.duplicate.link.method = :get
|
|
70
|
-
conf.duplicate.link.position = :after
|
|
71
|
-
#conf.duplicate.link.page = true # for new page rendering
|
|
72
|
-
end
|
|
73
|
-
end
|
|
74
|
-
</pre>
|
|
75
|
-
|
|
76
|
-
You can access to record which is being duplicated in your form overrides with @old_record variable.
|
|
77
|
-
|
|
78
|
-
If you use :post method, you can enable refresh_list to refresh the list instead of only adding new record at top, or set action_after_clone to open edit form for example:
|
|
79
|
-
|
|
80
|
-
<pre>
|
|
81
|
-
conf.duplicate.refresh_list = true
|
|
82
|
-
conf.duplicate.action_after_clone = :edit
|
|
83
|
-
</pre>
|
|
84
|
-
|
|
85
|
-
h2. Before/after controller methods
|
|
86
|
-
|
|
87
|
-
It's possible to define some methods to add some custom code which require access to session or request params:
|
|
88
|
-
|
|
89
|
-
* For :post method, before_duplicate_save(record) and after_duplicate_save(record) can be defined, which will be called before and after saving the record respectively.
|
|
90
|
-
* For :new method, before_duplicate_new(record) can be defined, which will be called before rendering.
|
|
91
|
-
|
|
92
|
-
h2. Support
|
|
93
|
-
|
|
94
|
-
If you have issues installing the gem, search / post to the "Active Scaffold":http://groups.google.com/group/activescaffold forum or "Create an issue":http://github.com/activescaffold/active_scaffold_duplicate/issues
|
|
95
|
-
|
|
96
|
-
h2. Contributing
|
|
97
|
-
|
|
98
|
-
Fork, hack, push, and request a pull:
|
|
99
|
-
|
|
100
|
-
http://github.com/activescaffold/active_scaffold_duplicate/
|
|
101
|
-
|
|
102
|
-
h2. License
|
|
103
|
-
|
|
104
|
-
Released under the MIT license (included).
|
|
105
|
-
|
|
106
|
-
h2. Author
|
|
107
|
-
|
|
108
|
-
Contact me:
|
|
109
|
-
<pre>
|
|
110
|
-
Sergio Cambra - irb(main):001:0> ( 'sergioATprogramatica._see_s'.gsub('_see_', 'e').gsub('AT', '@') )
|
|
111
|
-
</pre>
|