Sha256: a066bc775aefce3e13701e8c4a165797c74fa3657da1e839320ef9b6bdaca327

Contents?: true

Size: 749 Bytes

Versions: 1

Compression:

Stored size: 749 Bytes

Contents

class WysihatFilesController < ApplicationController
  def index
    @wysihat_file, @wysihat_files = WysihatFile.new, WysihatFile.all
    render :layout => false
  end

  def create
    @wysihat_file = WysihatFile.new(:file => params[:wysihat_file][:file])

    responds_to_parent do
      render :update do |page|
        if(@wysihat_file.save)
          page.insert_html :bottom, :wysihat_files, :partial => 'wysihat_file', :object => @wysihat_file
        end
      end
    end
  end

  def destroy
    @wysihat_file = WysihatFile.find(params[:id])
    respond_to do |wants|
      wants.js {
        render :update do |page|
          page.remove "wysihat_file_#{@wysihat_file.id}"
        end
      }
    end
    @wysihat_file.destroy
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wysihat-engine-0.1.13 app/controllers/wysihat_files_controller.rb