class SponzorskeDariesController < ApplicationController
  # GET /sponzorske_daries
  # GET /sponzorske_daries.json
  def index
    @sponzorske_daries = SponzorskeDary.all

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

  # GET /sponzorske_daries/1
  # GET /sponzorske_daries/1.json
  def show
    @sponzorske_dary = SponzorskeDary.find(params[:id])

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

  # GET /sponzorske_daries/new
  # GET /sponzorske_daries/new.json
  def new
    @sponzorske_dary = SponzorskeDary.new

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

  # GET /sponzorske_daries/1/edit
  def edit
    @sponzorske_dary = SponzorskeDary.find(params[:id])
  end

  # POST /sponzorske_daries
  # POST /sponzorske_daries.json
  def create
    @sponzorske_dary = SponzorskeDary.new(params[:sponzorske_dary])

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

  # PUT /sponzorske_daries/1
  # PUT /sponzorske_daries/1.json
  def update
    @sponzorske_dary = SponzorskeDary.find(params[:id])

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

  # DELETE /sponzorske_daries/1
  # DELETE /sponzorske_daries/1.json
  def destroy
    @sponzorske_dary = SponzorskeDary.find(params[:id])
    @sponzorske_dary.destroy

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