class IgradesController < ApplicationController
  # GET /igrades
  # GET /igrades.xml
  def index
    @igrades = Igrade.all

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

  # GET /igrades/1
  # GET /igrades/1.xml
  def show
    @igrade = Igrade.find(params[:id])

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

  # GET /igrades/new
  # GET /igrades/new.xml
  def new
    @igrade = Igrade.new

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

  # GET /igrades/1/edit
  def edit
    @igrade = Igrade.find(params[:id])
  end

  # POST /igrades
  # POST /igrades.xml
  def create
    @igrade = Igrade.new(params[:igrade])

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

  # PUT /igrades/1
  # PUT /igrades/1.xml
  def update
    @igrade = Igrade.find(params[:id])

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

  # DELETE /igrades/1
  # DELETE /igrades/1.xml
  def destroy
    @igrade = Igrade.find(params[:id])
    @igrade.destroy

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