-
-
Notifications
You must be signed in to change notification settings - Fork 318
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract archive rendering related controller code
In admin attachments and admin elements controllers we use the same code to handle the archive rendering. Either in an overlay dialog (if a content_id is available) or as normal html index view.
- Loading branch information
Showing
4 changed files
with
23 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
module Alchemy | ||
module Admin | ||
module ArchiveOverlay | ||
private | ||
|
||
def in_overlay? | ||
params[:content_id].present? | ||
end | ||
|
||
def archive_overlay | ||
@content = Content.find_by(id: params[:content_id]) | ||
|
||
respond_to do |format| | ||
format.html { render partial: 'archive_overlay' } | ||
format.js { render action: 'archive_overlay' } | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters