class GrabadosController < ApplicationController
  before_action :set_grabado, only: %i[ show edit update destroy ]

  # GET /grabados or /grabados.json
  def index
    @grabados = Grabado.all
  end

  # GET /grabados/1 or /grabados/1.json
  def show
  end

  ## GET /grabados/new
  #def new
  #  @grabado = Grabado.new
  #end

  ## GET /grabados/1/edit
  #def edit
  #end

  ## POST /grabados or /grabados.json
  #def create
  #  @grabado = Grabado.new(grabado_params)

  #  respond_to do |format|
  #    if @grabado.save
  #      format.html { redirect_to grabado_url(@grabado), notice: "Grabado was successfully created." }
  #      format.json { render :show, status: :created, location: @grabado }
  #    else
  #      format.html { render :new, status: :unprocessable_entity }
  #      format.json { render json: @grabado.errors, status: :unprocessable_entity }
  #    end
  #  end
  #end

  ## PATCH/PUT /grabados/1 or /grabados/1.json
  #def update
  #  respond_to do |format|
  #    if @grabado.update(grabado_params)
  #      format.html { redirect_to grabado_url(@grabado), notice: "Grabado was successfully updated." }
  #      format.json { render :show, status: :ok, location: @grabado }
  #    else
  #      format.html { render :edit, status: :unprocessable_entity }
  #      format.json { render json: @grabado.errors, status: :unprocessable_entity }
  #    end
  #  end
  #end

  ## DELETE /grabados/1 or /grabados/1.json
  #def destroy
  #  @grabado.destroy

  #  respond_to do |format|
  #    format.html { redirect_to grabados_url, notice: "Grabado was successfully destroyed." }
  #    format.json { head :no_content }
  #  end
  #end

  private
    # Use callbacks to share common setup or constraints between actions.
    def set_grabado
      @grabado = Grabado.find(params[:id])
    end

    # Only allow a list of trusted parameters through.
    def grabado_params
      params.require(:grabado).permit(:name, :style_es, :style_en, :paperw, :paperh, :platew, :plateh, :year, :state, :image, :artist_id, :collection_id)
    end
end
