Skip to content

Commit

Permalink
made controller
Browse files Browse the repository at this point in the history
  • Loading branch information
antoshNikolak committed Feb 1, 2023
1 parent 6beae90 commit 6b4a1f4
Show file tree
Hide file tree
Showing 12 changed files with 86 additions and 311 deletions.
316 changes: 5 additions & 311 deletions .idea/CrudPraticeRails.iml

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]
# Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", require: false

#MY OWN ADDITIONS
# ---------------------

#bulma CSS
gem 'bulma-rails', '~> 0.8.0'

#makes writing forms easier
gem 'simple_form', '~> 5.1'

#-----------------------

# Use Sass to process CSS
# gem "sassc-rails"

Expand Down
10 changes: 10 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ GEM
bootsnap (1.16.0)
msgpack (~> 1.2)
builder (3.2.4)
bulma-rails (0.8.2)
sassc (~> 2.0)
capybara (3.38.0)
addressable
matrix
Expand All @@ -88,6 +90,7 @@ GEM
irb (>= 1.5.0)
reline (>= 0.3.1)
erubi (1.12.0)
ffi (1.15.5-x64-mingw-ucrt)
globalid (1.1.0)
activesupport (>= 5.0)
i18n (1.12.0)
Expand Down Expand Up @@ -166,10 +169,15 @@ GEM
io-console (~> 0.5)
rexml (3.2.5)
rubyzip (2.3.2)
sassc (2.4.0)
ffi (~> 1.9)
selenium-webdriver (4.8.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
simple_form (5.1.0)
actionpack (>= 5.2)
activemodel (>= 5.2)
sprockets (4.2.0)
concurrent-ruby (~> 1.0)
rack (>= 2.2.4, < 4)
Expand Down Expand Up @@ -212,13 +220,15 @@ PLATFORMS

DEPENDENCIES
bootsnap
bulma-rails (~> 0.8.0)
capybara
debug
importmap-rails
jbuilder
puma (~> 5.0)
rails (~> 7.0.4, >= 7.0.4.2)
selenium-webdriver
simple_form (~> 5.1)
sprockets-rails
sqlite3 (~> 1.4)
stimulus-rails
Expand Down
4 changes: 4 additions & 0 deletions app/controllers/accounts_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class AccountsController < ApplicationController
def index
end
end
2 changes: 2 additions & 0 deletions app/helpers/accounts_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module AccountsHelper
end
2 changes: 2 additions & 0 deletions app/models/account.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Account < ApplicationRecord
end
2 changes: 2 additions & 0 deletions app/views/accounts/index.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h1>Accounts#index</h1>
<p>Find me in app/views/accounts/index.html.erb</p>
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Rails.application.routes.draw do
get 'accounts/index'
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html

# Defines the root path route ("/")
Expand Down
15 changes: 15 additions & 0 deletions db/migrate/20230201170612_create_accounts.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class CreateAccounts < ActiveRecord::Migration[7.0]
def change
create_table :accounts do |t|
t.string :username
t.string :password
t.string :first_name
t.string :last_name
t.string :location
t.string :email
t.string :phone

t.timestamps
end
end
end
8 changes: 8 additions & 0 deletions test/controllers/accounts_controller_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require "test_helper"

class AccountsControllerTest < ActionDispatch::IntegrationTest
test "should get index" do
get accounts_index_url
assert_response :success
end
end
19 changes: 19 additions & 0 deletions test/fixtures/accounts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html

one:
username: MyString
password: MyString
first_name: MyString
last_name: MyString
location: MyString
email: MyString
phone: MyString

two:
username: MyString
password: MyString
first_name: MyString
last_name: MyString
location: MyString
email: MyString
phone: MyString
7 changes: 7 additions & 0 deletions test/models/account_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require "test_helper"

class AccountTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

0 comments on commit 6b4a1f4

Please sign in to comment.