Skip to content

Instantly share code, notes, and snippets.

@gramos
Created July 3, 2019 17:46
Show Gist options
  • Save gramos/720d067e756980997522f25588aaa6ef to your computer and use it in GitHub Desktop.
Save gramos/720d067e756980997522f25588aaa6ef to your computer and use it in GitHub Desktop.
class BorramesController < ApplicationController
before_action :set_borrame, only: [:show, :edit, :update, :destroy]
# GET /borrames
# GET /borrames.json
def index
@borrames = Borrame.all
end
# GET /borrames/1
# GET /borrames/1.json
def show
end
# GET /borrames/new
def new
@borrame = Borrame.new
end
# GET /borrames/1/edit
def edit
end
# POST /borrames
# POST /borrames.json
def create
@borrame = Borrame.new(borrame_params)
respond_to do |format|
if @borrame.save
format.html { redirect_to @borrame, notice: 'Borrame was successfully created.' }
format.json { render :show, status: :created, location: @borrame }
else
format.html { render :new }
format.json { render json: @borrame.errors, status: :unprocessable_entity }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment