# -*- encoding : utf-8 -*-
class Admin::NotesController < ApplicationController

  def show
    @note = Note.find(params[:id])

   
  end


  def new
    @note = Note.new(:topic_id => params[:topic_id])

   
  end


  def edit
    @note = Note.find(params[:id])
  end

  def create
    @note = Note.new(params[:note])
    @note.admin = current_admin

    if @note.save
      
    else
      render :action => :new
    end
      
  end


  def update
    @note = Note.find(params[:id])


    if @note.update_attributes(params[:note])
       
    else
      render :action => :edit
    end

  end

  def destroy
    @note = Note.find(params[:id])
    @note.destroy

  end
end
