Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ GEM
byebug (11.1.3)
concurrent-ruby (1.1.9)
crass (1.0.6)
diff-lcs (1.4.4)
erubi (1.10.0)
ffi (1.15.4)
globalid (0.5.2)
Expand Down Expand Up @@ -133,6 +134,19 @@ GEM
rb-fsevent (0.11.0)
rb-inotify (0.10.1)
ffi (~> 1.0)
rspec (3.10.0)
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
rspec-mocks (~> 3.10.0)
rspec-core (3.10.1)
rspec-support (~> 3.10.0)
rspec-expectations (3.10.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-mocks (3.10.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-support (3.10.3)
sass-rails (6.0.0)
sassc-rails (~> 2.1, >= 2.1.1)
sassc (2.4.0)
Expand Down Expand Up @@ -186,6 +200,7 @@ DEPENDENCIES
puma (~> 5.0)
rack-mini-profiler (~> 2.0)
rails (~> 6.1.4, >= 6.1.4.1)
rspec
sass-rails (>= 6)
spring
sqlite3 (~> 1.4)
Expand Down
3 changes: 3 additions & 0 deletions app/assets/stylesheets/get_somes.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the get_somes controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: https://sass-lang.com/
65 changes: 65 additions & 0 deletions app/assets/stylesheets/scaffolds.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
body {
background-color: #fff;
color: #333;
margin: 33px; }

body, p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px; }

pre {
background-color: #eee;
padding: 10px;
font-size: 11px; }

a {
color: #000; }

a:visited {
color: #666; }

a:hover {
color: #fff;
background-color: #000; }

th {
padding-bottom: 5px; }

td {
padding: 0 5px 7px; }

div.field,
div.actions {
margin-bottom: 10px; }

#notice {
color: green; }

.field_with_errors {
padding: 2px;
background-color: red;
display: table; }

#error_explanation {
width: 450px;
border: 2px solid red;
padding: 7px 7px 0;
margin-bottom: 20px;
background-color: #f0f0f0; }

#error_explanation h2 {
text-align: left;
font-weight: bold;
padding: 5px 5px 5px 15px;
font-size: 12px;
margin: -7px -7px 0;
background-color: #c00;
color: #fff; }

#error_explanation ul li {
font-size: 12px;
list-style: square; }

label {
display: block; }
69 changes: 69 additions & 0 deletions app/controllers/get_somes_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
class GetSomesController < ApplicationController
before_action :set_get_some, only: %i[ show edit update destroy ]

# GET /get_somes or /get_somes.json
def index
@get_somes = GetSome.all
end

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

# GET /get_somes/new
def new
@get_some = GetSome.new
end

# GET /get_somes/1/edit
def edit
end

# POST /get_somes or /get_somes.json
def create
@get_some = GetSome.new(get_some_params)

respond_to do |format|
if @get_some.save
format.html { redirect_to @get_some, notice: "Get some was successfully created." }
format.json { render :show, status: :created, location: @get_some }
else
format.html { render :new, status: :unprocessable_entity }
format.json { render json: @get_some.errors, status: :unprocessable_entity }
end
end
end

# PATCH/PUT /get_somes/1 or /get_somes/1.json
def update
respond_to do |format|
if @get_some.update(get_some_params)
format.html { redirect_to @get_some, notice: "Get some was successfully updated." }
format.json { render :show, status: :ok, location: @get_some }
else
format.html { render :edit, status: :unprocessable_entity }
format.json { render json: @get_some.errors, status: :unprocessable_entity }
end
end
end

# DELETE /get_somes/1 or /get_somes/1.json
def destroy
@get_some.destroy
respond_to do |format|
format.html { redirect_to get_somes_url, notice: "Get some was successfully destroyed." }
format.json { head :no_content }
end
end

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

# Only allow a list of trusted parameters through.
def get_some_params
params.fetch(:get_some, {})
end
end
2 changes: 2 additions & 0 deletions app/helpers/get_somes_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module GetSomesHelper
end
2 changes: 2 additions & 0 deletions app/models/get_some.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class GetSome < ApplicationRecord
end
17 changes: 17 additions & 0 deletions app/views/get_somes/_form.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<%= form_with(model: get_some) do |form| %>
<% if get_some.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(get_some.errors.count, "error") %> prohibited this get_some from being saved:</h2>

<ul>
<% get_some.errors.each do |error| %>
<li><%= error.full_message %></li>
<% end %>
</ul>
</div>
<% end %>

<div class="actions">
<%= form.submit %>
</div>
<% end %>
2 changes: 2 additions & 0 deletions app/views/get_somes/_get_some.json.jbuilder
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
json.extract! get_some, :id, :created_at, :updated_at
json.url get_some_url(get_some, format: :json)
6 changes: 6 additions & 0 deletions app/views/get_somes/edit.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<h1>Editing Get Some</h1>

<%= render 'form', get_some: @get_some %>

<%= link_to 'Show', @get_some %> |
<%= link_to 'Back', get_somes_path %>
25 changes: 25 additions & 0 deletions app/views/get_somes/index.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<p id="notice"><%= notice %></p>

<h1>Get Somes</h1>

<table>
<thead>
<tr>
<th colspan="3"></th>
</tr>
</thead>

<tbody>
<% @get_somes.each do |get_some| %>
<tr>
<td><%= link_to 'Show', get_some %></td>
<td><%= link_to 'Edit', edit_get_some_path(get_some) %></td>
<td><%= link_to 'Destroy', get_some, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>

<br>

<%= link_to 'New Get Some', new_get_some_path %>
1 change: 1 addition & 0 deletions app/views/get_somes/index.json.jbuilder
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
json.array! @get_somes, partial: "get_somes/get_some", as: :get_some
5 changes: 5 additions & 0 deletions app/views/get_somes/new.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<h1>New Get Some</h1>

<%= render 'form', get_some: @get_some %>

<%= link_to 'Back', get_somes_path %>
4 changes: 4 additions & 0 deletions app/views/get_somes/show.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<p id="notice"><%= notice %></p>

<%= link_to 'Edit', edit_get_some_path(@get_some) %> |
<%= link_to 'Back', get_somes_path %>
1 change: 1 addition & 0 deletions app/views/get_somes/show.json.jbuilder
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
json.partial! "get_somes/get_some", get_some: @get_some
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Rails.application.routes.draw do
resources :get_somes
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
end
8 changes: 8 additions & 0 deletions db/migrate/20211123184142_create_get_somes.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class CreateGetSomes < ActiveRecord::Migration[6.1]
def change
create_table :get_somes do |t|

t.timestamps
end
end
end
20 changes: 20 additions & 0 deletions db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.