class UzivatelsController < ApplicationController
  # GET /uzivatels
  # GET /uzivatels.json
  def index
    @uzivatels = Uzivatel.all

    respond_to do |format|
      format.html # index.html.erb
      format.json { render json: @uzivatels }
    end
  end

  # GET /uzivatels/1
  # GET /uzivatels/1.json
  def show
    @uzivatel = Uzivatel.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.json { render json: @uzivatel }
    end
  end

  # GET /uzivatels/new
  # GET /uzivatels/new.json
  def new
    @uzivatel = Uzivatel.new

    respond_to do |format|
      format.html # new.html.erb
      format.json { render json: @uzivatel }
    end
  end

  # GET /uzivatels/1/edit
  def edit
    @uzivatel = Uzivatel.find(params[:id])
  end

  # POST /uzivatels
  # POST /uzivatels.json
  def create
    @uzivatel = Uzivatel.new(params[:uzivatel])

    respond_to do |format|
      if @uzivatel.save
        format.html { redirect_to @uzivatel, notice: 'Uzivatel was successfully created.' }
        format.json { render json: @uzivatel, status: :created, location: @uzivatel }
      else
        format.html { render action: "new" }
        format.json { render json: @uzivatel.errors, status: :unprocessable_entity }
      end
    end
  end

  # PUT /uzivatels/1
  # PUT /uzivatels/1.json
  def update
    @uzivatel = Uzivatel.find(params[:id])

    respond_to do |format|
      if @uzivatel.update_attributes(params[:uzivatel])
        format.html { redirect_to @uzivatel, notice: 'Uzivatel was successfully updated.' }
        format.json { head :no_content }
      else
        format.html { render action: "edit" }
        format.json { render json: @uzivatel.errors, status: :unprocessable_entity }
      end
    end
  end

  # DELETE /uzivatels/1
  # DELETE /uzivatels/1.json
  def destroy
    @uzivatel = Uzivatel.find(params[:id])
    @uzivatel.destroy

    respond_to do |format|
      format.html { redirect_to uzivatels_url }
      format.json { head :no_content }
    end
  end
end
