added route, controller, model, sidebar link, and basic index page for the work info section so that we can render user data
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
class WorkInfoController < ApplicationController
|
||||||
|
|
||||||
|
def index
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
module WorkInfoHelper
|
||||||
|
end
|
||||||
@@ -12,6 +12,7 @@ class User < ActiveRecord::Base
|
|||||||
before_save :assign_user_id, :on => :create
|
before_save :assign_user_id, :on => :create
|
||||||
has_one :retirement, :foreign_key => :user_id, :primary_key => :user_id
|
has_one :retirement, :foreign_key => :user_id, :primary_key => :user_id
|
||||||
has_one :paid_time_off, :foreign_key => :user_id, :primary_key => :user_id
|
has_one :paid_time_off, :foreign_key => :user_id, :primary_key => :user_id
|
||||||
|
has_one :work_info, :foreign_key => :user_id, :primary_key => :user_id
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
class WorkInfo < ActiveRecord::Base
|
||||||
|
attr_accessible :DoB, :SSN, :bonuses, :income, :user_id, :years_worked
|
||||||
|
belongs_to :user
|
||||||
|
end
|
||||||
@@ -43,12 +43,12 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="#">
|
<%= link_to user_work_info_index_path(:user_id => current_user.user_id) do %>
|
||||||
<div class="icon">
|
<div class="icon">
|
||||||
<span class="fs1" aria-hidden="true" data-icon=""></span>
|
<span class="fs1" aria-hidden="true" data-icon=""></span>
|
||||||
</div>
|
</div>
|
||||||
Work Info
|
Work Info
|
||||||
</a>
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="#">
|
<a href="#">
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ resources :users do
|
|||||||
|
|
||||||
resources :paid_time_off do
|
resources :paid_time_off do
|
||||||
end
|
end
|
||||||
|
|
||||||
|
resources :work_info do
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
class CreateWorkInfos < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
create_table :work_infos do |t|
|
||||||
|
t.integer :user_id
|
||||||
|
t.string :income
|
||||||
|
t.string :bonuses
|
||||||
|
t.integer :years_worked
|
||||||
|
t.string :SSN
|
||||||
|
t.date :DoB
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
Vendored
+17
@@ -0,0 +1,17 @@
|
|||||||
|
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
|
||||||
|
|
||||||
|
one:
|
||||||
|
user_id: 1
|
||||||
|
income: MyString
|
||||||
|
bonuses: MyString
|
||||||
|
years_worked: 1
|
||||||
|
SSN: MyString
|
||||||
|
DoB: 2013-05-31
|
||||||
|
|
||||||
|
two:
|
||||||
|
user_id: 1
|
||||||
|
income: MyString
|
||||||
|
bonuses: MyString
|
||||||
|
years_worked: 1
|
||||||
|
SSN: MyString
|
||||||
|
DoB: 2013-05-31
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class WorkInfoControllerTest < ActionController::TestCase
|
||||||
|
# test "the truth" do
|
||||||
|
# assert true
|
||||||
|
# end
|
||||||
|
end
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class WorkInfoHelperTest < ActionView::TestCase
|
||||||
|
end
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class WorkInfoTest < ActiveSupport::TestCase
|
||||||
|
# test "the truth" do
|
||||||
|
# assert true
|
||||||
|
# end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user