class CStavPodujatiaController < ApplicationController
  # GET /c_stav_podujatia
  # GET /c_stav_podujatia.json
  def index
    @c_stav_podujatia = CStavPodujatium.all

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

  # GET /c_stav_podujatia/1
  # GET /c_stav_podujatia/1.json
  def show
    @c_stav_podujatium = CStavPodujatium.find(params[:id])

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

  # GET /c_stav_podujatia/new
  # GET /c_stav_podujatia/new.json
  def new
    @c_stav_podujatium = CStavPodujatium.new

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

  # GET /c_stav_podujatia/1/edit
  def edit
    @c_stav_podujatium = CStavPodujatium.find(params[:id])
  end

  # POST /c_stav_podujatia
  # POST /c_stav_podujatia.json
  def create
    @c_stav_podujatium = CStavPodujatium.new(params[:c_stav_podujatium])

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

  # PUT /c_stav_podujatia/1
  # PUT /c_stav_podujatia/1.json
  def update
    @c_stav_podujatium = CStavPodujatium.find(params[:id])

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

  # DELETE /c_stav_podujatia/1
  # DELETE /c_stav_podujatia/1.json
  def destroy
    @c_stav_podujatium = CStavPodujatium.find(params[:id])
    @c_stav_podujatium.destroy

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