Class: Admin::PageAttachmentsController
- Inherits:
-
ResourceController
- Object
- ResourceController
- Admin::PageAttachmentsController
- Defined in:
- app/controllers/admin/page_attachments_controller.rb
Instance Method Summary collapse
Instance Method Details
#load_model ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'app/controllers/admin/page_attachments_controller.rb', line 8 def load_model begin @asset = Asset.find(params[:asset_id]) @page = [:page_id].blank? ? Page.new : Page.find_by_id([:page_id]) rescue ActiveRecord::RecordNotFound render nothing: true, layout: false end self.model = PageAttachment.new(asset: @asset, page: @page) end |
#new ⇒ Object
4 5 6 |
# File 'app/controllers/admin/page_attachments_controller.rb', line 4 def new render partial: 'attachment', object: model end |