class KontaktneOsobiesController < ApplicationController
  # GET /kontaktne_osobies
  # GET /kontaktne_osobies.json
  def index
    @kontaktne_osobies = KontaktneOsoby.all

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

  # GET /kontaktne_osobies/1
  # GET /kontaktne_osobies/1.json
  def show
    @kontaktne_osoby = KontaktneOsoby.find(params[:id])

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

  # GET /kontaktne_osobies/new
  # GET /kontaktne_osobies/new.json
  def new
    @kontaktne_osoby = KontaktneOsoby.new

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

  # GET /kontaktne_osobies/1/edit
  def edit
    @kontaktne_osoby = KontaktneOsoby.find(params[:id])
  end

  # POST /kontaktne_osobies
  # POST /kontaktne_osobies.json
  def create
    @kontaktne_osoby = KontaktneOsoby.new(params[:kontaktne_osoby])

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

  # PUT /kontaktne_osobies/1
  # PUT /kontaktne_osobies/1.json
  def update
    @kontaktne_osoby = KontaktneOsoby.find(params[:id])

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

  # DELETE /kontaktne_osobies/1
  # DELETE /kontaktne_osobies/1.json
  def destroy
    @kontaktne_osoby = KontaktneOsoby.find(params[:id])
    @kontaktne_osoby.destroy

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