class Forum::ForumCategoriesController < ApplicationController
  layout "forum"
  
  before_filter :auth_fuser
  


  def show
    @category = ForumCategory.find(params[:id])

  end


  def new
    @category = ForumCategory.new(:forum_id => params[:forum_id])
  
  end

  def edit
    @category = ForumCategory.find(params[:id])
  
  end

  def create
  	@category = ForumCategory.new(params[:forum_category])
    
    if @category.save
      redirect_to forum_forum_path(@category.forum)
          
  	else
  		render :action => "new" 
  	end
  end

  def update
  	@category = ForumCategory.find(params[:id])
    
    if @category.update_attributes(params[:forum_category])
      redirect_to forum_forum_path(@category.forum)
          
  	else
  		render :action => "edit" 
  	end
    
  end
  		


  def destroy
  	@category = ForumCategory.find(params[:id])
	  @category.destroy
    redirect_to forum_forum_path(@category.forum)

  end



end
