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

Version Path
trusty-cms-4.1.2 app/controllers/admin/page_attachments_controller.rb
trusty-cms-4.1.1 app/controllers/admin/page_attachments_controller.rb
trusty-cms-4.1.0 app/controllers/admin/page_attachments_controller.rb
trusty-cms-4.0.2 app/controllers/admin/page_attachments_controller.rb
trusty-cms-3.9.7 app/controllers/admin/page_attachments_controller.rb
trusty-cms-3.9.6 app/controllers/admin/page_attachments_controller.rb
trusty-cms-3.9.5 app/controllers/admin/page_attachments_controller.rb
trusty-cms-4.0.1 app/controllers/admin/page_attachments_controller.rb
trusty-cms-3.9.4 app/controllers/admin/page_attachments_controller.rb
trusty-cms-3.9.3 app/controllers/admin/page_attachments_controller.rb
trusty-cms-3.9.2 app/controllers/admin/page_attachments_controller.rb
trusty-cms-4.0.0 app/controllers/admin/page_attachments_controller.rb
trusty-cms-3.9.1 app/controllers/admin/page_attachments_controller.rb
trusty-cms-3.9.0 app/controllers/admin/page_attachments_controller.rb
trusty-cms-3.8.4 app/controllers/admin/page_attachments_controller.rb
trusty-cms-3.8.3 app/controllers/admin/page_attachments_controller.rb
trusty-cms-3.8.2 app/controllers/admin/page_attachments_controller.rb
trusty-cms-3.8.1 app/controllers/admin/page_attachments_controller.rb
trusty-cms-3.8.0 app/controllers/admin/page_attachments_controller.rb
trusty-cms-3.7.1 app/controllers/admin/page_attachments_controller.rb