Skip to content

Commit

Permalink
added Job_Approval scaffold and Jobs link
Browse files Browse the repository at this point in the history
  • Loading branch information
wanyinwai committed Jul 29, 2015
1 parent 8de52a7 commit 4d02f0c
Show file tree
Hide file tree
Showing 14 changed files with 75 additions and 12 deletions.
3 changes: 3 additions & 0 deletions app/assets/javascripts/job_approval.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/job_approval.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the Job_Approval controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
2 changes: 2 additions & 0 deletions app/controllers/job_approval_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class JobApprovalController < ApplicationController
end
9 changes: 9 additions & 0 deletions app/controllers/welcome_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class WelcomeController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception

def index
end

end
2 changes: 2 additions & 0 deletions app/helpers/job_approval_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module JobApprovalHelper
end
2 changes: 2 additions & 0 deletions app/models/job_approval.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class JobApproval < ActiveRecord::Base
end
5 changes: 3 additions & 2 deletions app/views/jobs/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<h1>New Job</h1>

<b> Please fill in job details in the form below. </b>
<%= render 'form' %>

<%= link_to 'Back', jobs_path %>
<%= link_to 'Back', jobs_path %> |
<%= link_to 'Home', root_url %>
5 changes: 4 additions & 1 deletion app/views/landing_page/home.html.erb
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
<h1>This is the home page</h1>
<h1>This is the home page </h1>

<h4>suppose when user first signed up, the will first see their profile (wireframe)</h4>
<h4>then when user logged in (existing user), they will see home page (joblist page) </h4>
3 changes: 2 additions & 1 deletion app/views/layouts/_menu.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
<p class="navbar-text pull-right">
<% if user_signed_in? %>
Logged in as <strong><%= current_user.email %></strong>.
<%= link_to 'Edit profile', edit_user_registration_path, :class => 'navbar-link' %> |
<%= link_to 'Create Job', new_job_path, :class => 'navbar-link' %> |
<%= link_to 'Edit Profile', edit_user_registration_path, :class => 'navbar-link' %> |
<%= link_to "Logout", destroy_user_session_path, method: :delete, :class => 'navbar-link' %>
<% else %>
<%= link_to "Sign up", new_user_registration_path, :class => 'navbar-link' %> |
Expand Down
11 changes: 11 additions & 0 deletions db/migrate/20150728140053_create_job_approvals.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class CreateJobApprovals < ActiveRecord::Migration
def change
create_table :job_approvals do |t|
t.integer :user_id
t.integer :job_id
t.string :status

t.timestamps null: false
end
end
end
17 changes: 9 additions & 8 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,19 @@
#
# It's strongly recommended that you check this file into your version control system.

<<<<<<< HEAD
ActiveRecord::Schema.define(version: 20150728122551) do
=======
ActiveRecord::Schema.define(version: 20150728061128) do
>>>>>>> master
ActiveRecord::Schema.define(version: 20150728140053) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"

<<<<<<< HEAD
create_table "job_approvals", force: :cascade do |t|
t.integer "user_id"
t.integer "job_id"
t.string "status"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

create_table "jobs", force: :cascade do |t|
t.string "title"
t.string "duration"
Expand All @@ -33,7 +36,6 @@
t.datetime "updated_at", null: false
end

=======
create_table "users", force: :cascade do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
Expand All @@ -55,5 +57,4 @@
add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree
add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree

>>>>>>> master
end
7 changes: 7 additions & 0 deletions test/controllers/job_approval_controller_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'test_helper'

class JobApprovalControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
end
11 changes: 11 additions & 0 deletions test/fixtures/job_approvals.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html

one:
user_id: 1
job_id: 1
status: MyString

two:
user_id: 1
job_id: 1
status: MyString
7 changes: 7 additions & 0 deletions test/models/job_approval_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'test_helper'

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

0 comments on commit 4d02f0c

Please sign in to comment.