class PodujatiaController < ApplicationController
  # GET /podujatia
  # GET /podujatia.json
  def index
    @podujatia = Podujatium.all

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

  # GET /podujatia/1
  # GET /podujatia/1.json
  def show
    @podujatium = Podujatium.find(params[:id])

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

  # GET /podujatia/new
  # GET /podujatia/new.json
  def new
    @podujatium = Podujatium.new

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

  # GET /podujatia/1/edit
  def edit
    @podujatium = Podujatium.find(params[:id])
  end

  # POST /podujatia
  # POST /podujatia.json
  def create
    @podujatium = Podujatium.new(params[:podujatium])

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

  # PUT /podujatia/1
  # PUT /podujatia/1.json
  def update
    @podujatium = Podujatium.find(params[:id])

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

  # DELETE /podujatia/1
  # DELETE /podujatia/1.json
  def destroy
    @podujatium = Podujatium.find(params[:id])
    @podujatium.destroy

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