class RecenziesController < ApplicationController
  # GET /recenzies
  # GET /recenzies.json
  def index
    @recenzies = Recenzie.all

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

  # GET /recenzies/1
  # GET /recenzies/1.json
  def show
    @recenzy = Recenzie.find(params[:id])

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

  # GET /recenzies/new
  # GET /recenzies/new.json
  def new
    @recenzy = Recenzie.new

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

  # GET /recenzies/1/edit
  def edit
    @recenzy = Recenzie.find(params[:id])
  end

  # POST /recenzies
  # POST /recenzies.json
  def create
    @recenzy = Recenzie.new(params[:recenzy])

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

  # PUT /recenzies/1
  # PUT /recenzies/1.json
  def update
    @recenzy = Recenzie.find(params[:id])

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

  # DELETE /recenzies/1
  # DELETE /recenzies/1.json
  def destroy
    @recenzy = Recenzie.find(params[:id])
    @recenzy.destroy

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