Sha256: b98b0ca64179319d3e535fa248ea634ddcc6196ce6c4fff71aea3660d093ea5d
Contents?: true
Size: 612 Bytes
Versions: 45
Compression:
Stored size: 612 Bytes
Contents
class Admin::PageAttachmentsController < Admin::ResourceController helper 'admin/assets' def new render :partial => 'attachment', :object => model end def load_model begin @asset = Asset.find(params[:asset_id]) @page = page_attachment_params[:page_id].blank? ? Page.new : Page.find_by_id(page_attachment_params[:page_id]) rescue ActiveRecord::RecordNotFound render :nothing => true, :layout => false end self.model = PageAttachment.new(:asset => @asset, :page => @page) end private def page_attachment_params params.permit(:asset_id, :page_id) end end
Version data entries
45 entries across 45 versions & 2 rubygems