class Panel::Announcement::BackEnd::BulletinFilesController < ApplicationController
  
  layout 'back_end'
  
  def index
    @bulletin_files = BulletinFile.all
	
    respond_to do |format|
      format.html # index.html.erb
      # format.xml  { render :xml => @bulletins }
      format.js
    end
	
  end

  # POST /bulletins
  # POST /bulletins.xml
  def create
    @bulletin_file = BulletinFile.new(params[:bulletin_file])

    respond_to do |format|
      if @bulletin_file.save
        format.html { redirect_to(panel_announcement_back_end_bulletins_url) }
        format.js
      else
        format.html { render :action => "new" }
        format.js { render action: "new" }
      end
    end
  end

  # PUT /bulletins/1
  # PUT /bulletins/1.xml
  def update
    @bulletin_file = BulletinFile.find(params[:id])

    respond_to do |format|
      if @bulletin_file.update_attributes(params[:bulletin_file])
        format.html { redirect_to(panel_announcement_back_end_bulletins_url) }
        format.js
      else
        format.html { render :action => "edit" }
        format.js { render :action => "edit" }
      end
    end
  end
	
end
