class GgradesController < ApplicationController
  # GET /ggrades
  # GET /ggrades.xml
  def index
    @ggrades = Ggrade.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @ggrades }
    end
  end

  # GET /ggrades/1
  # GET /ggrades/1.xml
  def show
    @ggrade = Ggrade.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @ggrade }
    end
  end

  # GET /ggrades/new
  # GET /ggrades/new.xml
  def new
    @ggrade = Ggrade.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @ggrade }
    end
  end

  # GET /ggrades/1/edit
  def edit
    @ggrade = Ggrade.find(params[:id])
  end

  # POST /ggrades
  # POST /ggrades.xml
  def create
    @ggrade = Ggrade.new(params[:ggrade])

    respond_to do |format|
      if @ggrade.save
        flash[:notice] = 'Ggrade was successfully created.'
        format.html { redirect_to(@ggrade) }
        format.xml  { render :xml => @ggrade, :status => :created, :location => @ggrade }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @ggrade.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /ggrades/1
  # PUT /ggrades/1.xml
  def update
    @ggrade = Ggrade.find(params[:id])

    respond_to do |format|
      if @ggrade.update_attributes(params[:ggrade])
        flash[:notice] = 'Ggrade was successfully updated.'
        format.html { redirect_to(@ggrade) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @ggrade.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /ggrades/1
  # DELETE /ggrades/1.xml
  def destroy
    @ggrade = Ggrade.find(params[:id])
    @ggrade.destroy

    respond_to do |format|
      format.html { redirect_to(ggrades_url) }
      format.xml  { head :ok }
    end
  end
end
