class CStavVstupenieksController < ApplicationController
  # GET /c_stav_vstupenieks
  # GET /c_stav_vstupenieks.json
  def index
    @c_stav_vstupenieks = CStavVstupeniek.all

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

  # GET /c_stav_vstupenieks/1
  # GET /c_stav_vstupenieks/1.json
  def show
    @c_stav_vstupeniek = CStavVstupeniek.find(params[:id])

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

  # GET /c_stav_vstupenieks/new
  # GET /c_stav_vstupenieks/new.json
  def new
    @c_stav_vstupeniek = CStavVstupeniek.new

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

  # GET /c_stav_vstupenieks/1/edit
  def edit
    @c_stav_vstupeniek = CStavVstupeniek.find(params[:id])
  end

  # POST /c_stav_vstupenieks
  # POST /c_stav_vstupenieks.json
  def create
    @c_stav_vstupeniek = CStavVstupeniek.new(params[:c_stav_vstupeniek])

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

  # PUT /c_stav_vstupenieks/1
  # PUT /c_stav_vstupenieks/1.json
  def update
    @c_stav_vstupeniek = CStavVstupeniek.find(params[:id])

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

  # DELETE /c_stav_vstupenieks/1
  # DELETE /c_stav_vstupenieks/1.json
  def destroy
    @c_stav_vstupeniek = CStavVstupeniek.find(params[:id])
    @c_stav_vstupeniek.destroy

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