Skip to content

Commit

Permalink
Merge 395316e into 67f117f
Browse files Browse the repository at this point in the history
  • Loading branch information
anitagraham committed Aug 28, 2019
2 parents 67f117f + 395316e commit d381736
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Expand Up @@ -10,6 +10,7 @@
.delete_section_icon {@include icon('minus-circle', $icon_delete_colour);}

.download_icon {@include icon('download');}
.duplicate_icon {@include icon('copy');}
.edit_email_icon {@include icon('envelope-o');}
.edit_icon {@include icon('edit', $icon_edit_colour);}
.email_icon {@include icon('envelope-o');}
Expand Down
1 change: 1 addition & 0 deletions core/config/locales/en.yml
Expand Up @@ -17,6 +17,7 @@ en:
updated: '%{what} was successfully updated.'
destroyed: '%{what} was successfully removed.'
not_destroyed: '%{what} was not removed.'
duplicated: '%{what} was duplicated.'
site_bar:
log_out: Log out
switch_to_your_website: Switch to your website
Expand Down
8 changes: 7 additions & 1 deletion core/lib/refinery/crud.rb
Expand Up @@ -59,7 +59,7 @@ def self.crudify_options
end
prepend_before_action :find_#{singular_name},
:only => [:update, :destroy, :edit, :show]
:only => [:update, :destroy, :edit, :show, :duplicate]
prepend_before_action :merge_position_into_params!, :only => :create
def new
Expand All @@ -83,6 +83,12 @@ def create
def edit
# object gets found by find_#{singular_name} function
end
def duplicate
@#{singular_name} = @#{singular_name}.dup
@#{singular_name}.title << ' Copy'
render 'edit'
end
def update
if @#{singular_name}.update_attributes(#{singular_name}_params)
Expand Down

0 comments on commit d381736

Please sign in to comment.