class Panel::Announcement::BackEnd::BulletinLinksController < ApplicationController
  
  layout 'back_end'
  
  def index
    @bulletin_links = BulletinLink.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_link = BulletinLink.new(params[:bulletin_link])
	# @bulletin_link.bulletin_id = params[:bulletin_link][:bulletin_id]

    respond_to do |format|
      if @bulletin_link.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_link = BulletinLink.find(params[:id])

    respond_to do |format|
      if @bulletin_link.update_attributes(params[:bulletin_link])
        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
