Commit 42d5a8a8 authored by Michael Rivera's avatar Michael Rivera

Updated

parents 7c62bce2 31487f38
...@@ -23,9 +23,12 @@ gem 'jbuilder', '~> 2.0' ...@@ -23,9 +23,12 @@ gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api. # bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc gem 'sdoc', '~> 0.4.0', group: :doc
<<<<<<< HEAD
gem 'bootstrap-sass' gem 'bootstrap-sass'
gem 'simple_form' gem 'simple_form'
=======
>>>>>>> 31487f3860b4c5fb8aabcdba7239972453f2ba56
# Use ActiveModel has_secure_password # Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7' # gem 'bcrypt', '~> 3.1.7'
...@@ -38,7 +41,10 @@ gem 'simple_form' ...@@ -38,7 +41,10 @@ gem 'simple_form'
group :development, :test do group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console # Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug' gem 'byebug'
<<<<<<< HEAD
gem 'better_errors' gem 'better_errors'
=======
>>>>>>> 31487f3860b4c5fb8aabcdba7239972453f2ba56
end end
group :development do group :development do
......
...@@ -37,6 +37,7 @@ GEM ...@@ -37,6 +37,7 @@ GEM
thread_safe (~> 0.3, >= 0.3.4) thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1) tzinfo (~> 1.1)
arel (6.0.3) arel (6.0.3)
<<<<<<< HEAD
autoprefixer-rails (6.3.6.2) autoprefixer-rails (6.3.6.2)
execjs execjs
better_errors (2.1.1) better_errors (2.1.1)
...@@ -51,6 +52,12 @@ GEM ...@@ -51,6 +52,12 @@ GEM
builder (3.2.2) builder (3.2.2)
byebug (9.0.5) byebug (9.0.5)
coderay (1.1.1) coderay (1.1.1)
=======
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
builder (3.2.2)
byebug (9.0.5)
>>>>>>> 31487f3860b4c5fb8aabcdba7239972453f2ba56
coffee-rails (4.1.1) coffee-rails (4.1.1)
coffee-script (>= 2.2.0) coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.1.x) railties (>= 4.0.0, < 5.1.x)
...@@ -127,9 +134,12 @@ GEM ...@@ -127,9 +134,12 @@ GEM
sdoc (0.4.1) sdoc (0.4.1)
json (~> 1.7, >= 1.7.7) json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0) rdoc (~> 4.0)
<<<<<<< HEAD
simple_form (3.2.1) simple_form (3.2.1)
actionpack (> 4, < 5.1) actionpack (> 4, < 5.1)
activemodel (> 4, < 5.1) activemodel (> 4, < 5.1)
=======
>>>>>>> 31487f3860b4c5fb8aabcdba7239972453f2ba56
sprockets (3.6.3) sprockets (3.6.3)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
rack (> 1, < 3) rack (> 1, < 3)
...@@ -160,8 +170,11 @@ PLATFORMS ...@@ -160,8 +170,11 @@ PLATFORMS
x86-mingw32 x86-mingw32
DEPENDENCIES DEPENDENCIES
<<<<<<< HEAD
better_errors better_errors
bootstrap-sass bootstrap-sass
=======
>>>>>>> 31487f3860b4c5fb8aabcdba7239972453f2ba56
byebug byebug
coffee-rails (~> 4.1.0) coffee-rails (~> 4.1.0)
jbuilder (~> 2.0) jbuilder (~> 2.0)
...@@ -169,7 +182,10 @@ DEPENDENCIES ...@@ -169,7 +182,10 @@ DEPENDENCIES
rails (= 4.2.5.1) rails (= 4.2.5.1)
sass-rails (~> 5.0) sass-rails (~> 5.0)
sdoc (~> 0.4.0) sdoc (~> 0.4.0)
<<<<<<< HEAD
simple_form simple_form
=======
>>>>>>> 31487f3860b4c5fb8aabcdba7239972453f2ba56
sqlite3 sqlite3
turbolinks turbolinks
tzinfo-data tzinfo-data
......
<<<<<<< HEAD
= require bootstrap-sprockets;// This is a manifest file that'll be compiled into application.js, which will include all the files = require bootstrap-sprockets;// This is a manifest file that'll be compiled into application.js, which will include all the files
=======
// This is a manifest file that'll be compiled into application.js, which will include all the files
>>>>>>> 31487f3860b4c5fb8aabcdba7239972453f2ba56
// listed below. // listed below.
// //
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
......
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any styles
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
* file per style scope.
*
*= require_tree .
*= require_self
*/
class CarLogsController < ApplicationController class CarLogsController < ApplicationController
<<<<<<< HEAD
def index def index
@carlogs = CarLog.all @carlogs = CarLog.all
...@@ -32,4 +33,36 @@ private ...@@ -32,4 +33,36 @@ private
params.require(:car_log).permit! params.require(:car_log).permit!
end end
end end
\ No newline at end of file =======
def index #displays all users
@cars = CarLog.all
end
def show
@car = CarLog.find(params[:id])#displays one user at a time based on user id
end
def new #instantiates a new user objects does not create the actual user record
@car = CarLog.new
end
def create #creates a new user record in the database
@car = CarLog.new(CarLog_params)
if @car.save
#redirect ot the page where it shows the usser created
redirect_to show_CarLog_path(@CarLog), notice: "User was successfully created!"
else
end
end
private
#contains the data from the user form
def user_params
params.require(:car).permit!
end
end
>>>>>>> 31487f3860b4c5fb8aabcdba7239972453f2ba56
class CarLog < ActiveRecord::Base class CarLog < ActiveRecord::Base
<<<<<<< HEAD
end end
=======
end
>>>>>>> 31487f3860b4c5fb8aabcdba7239972453f2ba56
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<<<<<<< HEAD
<title>ParkingLot</title> <title>ParkingLot</title>
=======
<title>Parkinglot</title>
>>>>>>> 31487f3860b4c5fb8aabcdba7239972453f2ba56
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %> <%= csrf_meta_tags %>
</head> </head>
<body> <body>
<<<<<<< HEAD
<nav class="navbar navbar-light bg-faded"> <nav class="navbar navbar-light bg-faded">
<a class="navbar-brand" href="#">Navbar</a> <a class="navbar-brand" href="#">Navbar</a>
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
...@@ -22,6 +27,9 @@ ...@@ -22,6 +27,9 @@
</ul> </ul>
</nav> </nav>
=======
>>>>>>> 31487f3860b4c5fb8aabcdba7239972453f2ba56
<%= yield %> <%= yield %>
</body> </body>
......
<h1>New Car</h1>
<%= form_for(@user) do |u| %>
<p>
<%= u.label "First Name: " %>
<%= u.text_field :first_name %>
</p>
<p>
<%= u.label "Last Name: " %>
<%= u.text_field :last_name %>
</p>
<p>
<%= u.label "Email: " %>
<%= u.text_field :email %>
</p>
<p>
<%= u.label "Password: " %>
<%= u.password_field :password %>
</p>
<p>
<%= u.label "Birthdate: " %>
<%= u.date_select :birthdate %>
</p>
<%= u.submit %>
<% end %>
<%= link_to 'Back', users_path %>
\ No newline at end of file
...@@ -6,7 +6,11 @@ require 'rails/all' ...@@ -6,7 +6,11 @@ require 'rails/all'
# you've limited to :test, :development, or :production. # you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups) Bundler.require(*Rails.groups)
<<<<<<< HEAD
module ParkingLot module ParkingLot
=======
module Parkinglot
>>>>>>> 31487f3860b4c5fb8aabcdba7239972453f2ba56
class Application < Rails::Application class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here. # Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers # Application configuration should go into files in config/initializers
......
# Be sure to restart your server when you modify this file. # Be sure to restart your server when you modify this file.
<<<<<<< HEAD
Rails.application.config.session_store :cookie_store, key: '_ParkingLot_session' Rails.application.config.session_store :cookie_store, key: '_ParkingLot_session'
=======
Rails.application.config.session_store :cookie_store, key: '_parkinglot_session'
>>>>>>> 31487f3860b4c5fb8aabcdba7239972453f2ba56
Rails.application.routes.draw do Rails.application.routes.draw do
<<<<<<< HEAD
resources :car_logs resources :car_logs
root 'pages#banner' root 'pages#banner'
...@@ -7,4 +8,8 @@ get '/carlogs/new', to: 'car_logs#new', as: :new ...@@ -7,4 +8,8 @@ get '/carlogs/new', to: 'car_logs#new', as: :new
post '/carlogs', to: 'car_logs#create', as: :carlog post '/carlogs', to: 'car_logs#create', as: :carlog
get '/carlogs/destroy/:id', to: 'car_logs#destroy', as: :destroy get '/carlogs/destroy/:id', to: 'car_logs#destroy', as: :destroy
=======
get '/carlog', to:'carlog#index', as: :index
get '/carlog/new', to:'carlog#new', as: :new_car
>>>>>>> 31487f3860b4c5fb8aabcdba7239972453f2ba56
end end
...@@ -11,10 +11,17 @@ ...@@ -11,10 +11,17 @@
# if you're sharing your code publicly. # if you're sharing your code publicly.
development: development:
<<<<<<< HEAD
secret_key_base: 432413f4af96bb0b3c65050aebdff42d599b804c662ca85cb709a5dfa2daeb05c5347c3af18bd3b5c31b79dbeb9b997adacb88f4310c569f6bc3582a8a891691 secret_key_base: 432413f4af96bb0b3c65050aebdff42d599b804c662ca85cb709a5dfa2daeb05c5347c3af18bd3b5c31b79dbeb9b997adacb88f4310c569f6bc3582a8a891691
test: test:
secret_key_base: 12086b1276b8673f452f1519f6ea55000296dfea85e99cc17873230e09dd5b3d843bf41e9e3ef65ef827f37d3f10e16b5d0d788bd27d38ed38ce60b0c7db2949 secret_key_base: 12086b1276b8673f452f1519f6ea55000296dfea85e99cc17873230e09dd5b3d843bf41e9e3ef65ef827f37d3f10e16b5d0d788bd27d38ed38ce60b0c7db2949
=======
secret_key_base: ad10c978d4bb7bf50b16b325b234527a8d97c5d826c25ae6fb981dc64919628db45bf7287f9f2c2bfc97ea69770fac675847afd2e9a55f4957f252d0586cc684
test:
secret_key_base: ef4454dd79ea270108f8d4730d6e929263084207dbcc9182043ff3f6562683e8397b783c3b0b1ac30f7e9a5c6bdf75a5ab1e42b698213197de9d87cb9cb337b4
>>>>>>> 31487f3860b4c5fb8aabcdba7239972453f2ba56
# Do not keep production secrets in the repository, # Do not keep production secrets in the repository,
# instead read values from the environment. # instead read values from the environment.
......
class CreateCarLogs < ActiveRecord::Migration
def change
create_table :car_logs do |t|
t.string :plate_number
t.string :brand
t.string :slot_number
t.boolean :is_taken
t.timestamps null: false
end
end
end
...@@ -11,7 +11,11 @@ ...@@ -11,7 +11,11 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
<<<<<<< HEAD
ActiveRecord::Schema.define(version: 20160705060810) do ActiveRecord::Schema.define(version: 20160705060810) do
=======
ActiveRecord::Schema.define(version: 20160705031745) do
>>>>>>> 31487f3860b4c5fb8aabcdba7239972453f2ba56
create_table "car_logs", force: :cascade do |t| create_table "car_logs", force: :cascade do |t|
t.string "plate_number" t.string "plate_number"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment