class Panel::News::BackEnd::NewsBulletinLinksController < ApplicationController
  
  layout 'new_admin'
  
  def index
    @news_bulletin_links = NewsBulletinLink.all
	
    respond_to do |format|
      format.html # index.html.erb
      # format.xml  { render :xml => @news_bulletins }
      format.js
    end
	
  end

  # POST /news_bulletins
  # POST /news_bulletins.xml
  def create
    @news_bulletin_link = NewsBulletinLink.new(params[:news_bulletin_link])
	# @news_bulletin_link.news_bulletin_id = params[:news_bulletin_link][:news_bulletin_id]

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

  # PUT /news_bulletins/1
  # PUT /news_bulletins/1.xml
  def update
    @news_bulletin_link = NewsBulletinLink.find(params[:id])

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