Sha256: 260a402378c538cafd7e754e06055591d8330f864d92e79aa7e45e73fd24c4d8

Contents?: true

Size: 1.04 KB

Versions: 3

Compression:

Stored size: 1.04 KB

Contents

class Admin::EssenceFilesController < AlchemyController

  filter_access_to :all

  def edit
    @content = Content.find(params[:id])
    @essence_file = @content.essence
    render :layout => false
  end

  def update
    @essence_file = EssenceFile.find(params[:id])
    @essence_file.update_attributes(params[:essence_file])
    render :update do |page|
      page << "Alchemy.closeCurrentWindow()"
      page << "Alchemy.reloadPreview()"
    end
  end

  def assign
    @content = Content.find_by_id(params[:id])
    @attachment = Attachment.find_by_id(params[:attachment_id])
    @content.essence.attachment = @attachment
    @content.essence.save
    @content.save
    render :update do |page|
      page.replace "#{@content.essence_type.underscore}_#{@content.id}", :partial => "essences/essence_file_editor", :locals => {:content => @content, :options => params[:options]}
      page << "Alchemy.closeCurrentWindow()"
      page << "Alchemy.reloadPreview()"
      page << "Alchemy.setElementDirty('#element_#{@content.element.id}')"
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
alchemy_cms-2.0.rc2 app/controllers/admin/essence_files_controller.rb
alchemy_cms-2.0.rc1 app/controllers/admin/essence_files_controller.rb
alchemy_cms-2.0.pre5 app/controllers/admin/essence_files_controller.rb