Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: nkroll/resbot
base: bd45f66f1f
...
head fork: nkroll/resbot
compare: 95d6ecd5f9
  • 2 commits
  • 66 files changed
  • 0 commit comments
  • 1 contributor
Showing with 1,303 additions and 28 deletions.
  1. +3 −0  app/assets/javascripts/edu_details.js.coffee
  2. +3 −0  app/assets/javascripts/educations.js.coffee
  3. +3 −0  app/assets/javascripts/exp_details.js.coffee
  4. +3 −0  app/assets/javascripts/experiences.js.coffee
  5. +3 −0  app/assets/stylesheets/edu_details.css.scss
  6. +3 −0  app/assets/stylesheets/educations.css.scss
  7. +3 −0  app/assets/stylesheets/exp_details.css.scss
  8. +3 −0  app/assets/stylesheets/experiences.css.scss
  9. +56 −0 app/assets/stylesheets/scaffolds.css.scss
  10. +83 −0 app/controllers/edu_details_controller.rb
  11. +83 −0 app/controllers/educations_controller.rb
  12. +83 −0 app/controllers/exp_details_controller.rb
  13. +83 −0 app/controllers/experiences_controller.rb
  14. +3 −0  app/controllers/users_controller.rb
  15. +2 −0  app/helpers/edu_details_helper.rb
  16. +2 −0  app/helpers/educations_helper.rb
  17. +2 −0  app/helpers/exp_details_helper.rb
  18. +2 −0  app/helpers/experiences_helper.rb
  19. +5 −0 app/models/edu_detail.rb
  20. +8 −0 app/models/education.rb
  21. +5 −0 app/models/exp_detail.rb
  22. +8 −0 app/models/experience.rb
  23. +6 −0 app/models/user.rb
  24. +29 −0 app/views/edu_details/_form.html.erb
  25. +6 −0 app/views/edu_details/edit.html.erb
  26. +27 −0 app/views/edu_details/index.html.erb
  27. +5 −0 app/views/edu_details/new.html.erb
  28. +20 −0 app/views/edu_details/show.html.erb
  29. +41 −0 app/views/educations/_form.html.erb
  30. +6 −0 app/views/educations/edit.html.erb
  31. +33 −0 app/views/educations/index.html.erb
  32. +5 −0 app/views/educations/new.html.erb
  33. +35 −0 app/views/educations/show.html.erb
  34. +29 −0 app/views/exp_details/_form.html.erb
  35. +6 −0 app/views/exp_details/edit.html.erb
  36. +27 −0 app/views/exp_details/index.html.erb
  37. +5 −0 app/views/exp_details/new.html.erb
  38. +20 −0 app/views/exp_details/show.html.erb
  39. +41 −0 app/views/experiences/_form.html.erb
  40. +6 −0 app/views/experiences/edit.html.erb
  41. +33 −0 app/views/experiences/index.html.erb
  42. +5 −0 app/views/experiences/new.html.erb
  43. +35 −0 app/views/experiences/show.html.erb
  44. +32 −27 app/views/users/show.html.erb
  45. +8 −0 config/routes.rb
  46. +14 −0 db/migrate/20120419113123_create_experiences.rb
  47. +11 −0 db/migrate/20120419122636_create_exp_details.rb
  48. +14 −0 db/migrate/20120419130258_create_educations.rb
  49. +11 −0 db/migrate/20120419130408_create_edu_details.rb
  50. +48 −1 db/schema.rb
  51. +11 −0 test/fixtures/edu_details.yml
  52. +17 −0 test/fixtures/educations.yml
  53. +11 −0 test/fixtures/exp_details.yml
  54. +17 −0 test/fixtures/experiences.yml
  55. +49 −0 test/functional/edu_details_controller_test.rb
  56. +49 −0 test/functional/educations_controller_test.rb
  57. +49 −0 test/functional/exp_details_controller_test.rb
  58. +49 −0 test/functional/experiences_controller_test.rb
  59. +7 −0 test/unit/edu_detail_test.rb
  60. +7 −0 test/unit/education_test.rb
  61. +7 −0 test/unit/exp_detail_test.rb
  62. +7 −0 test/unit/experience_test.rb
  63. +4 −0 test/unit/helpers/edu_details_helper_test.rb
  64. +4 −0 test/unit/helpers/educations_helper_test.rb
  65. +4 −0 test/unit/helpers/exp_details_helper_test.rb
  66. +4 −0 test/unit/helpers/experiences_helper_test.rb
View
3  app/assets/javascripts/edu_details.js.coffee
@@ -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://jashkenas.github.com/coffee-script/
View
3  app/assets/javascripts/educations.js.coffee
@@ -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://jashkenas.github.com/coffee-script/
View
3  app/assets/javascripts/exp_details.js.coffee
@@ -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://jashkenas.github.com/coffee-script/
View
3  app/assets/javascripts/experiences.js.coffee
@@ -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://jashkenas.github.com/coffee-script/
View
3  app/assets/stylesheets/edu_details.css.scss
@@ -0,0 +1,3 @@
+// Place all the styles related to the EduDetails controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
View
3  app/assets/stylesheets/educations.css.scss
@@ -0,0 +1,3 @@
+// Place all the styles related to the Educations controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
View
3  app/assets/stylesheets/exp_details.css.scss
@@ -0,0 +1,3 @@
+// Place all the styles related to the ExpDetails controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
View
3  app/assets/stylesheets/experiences.css.scss
@@ -0,0 +1,3 @@
+// Place all the styles related to the Experiences controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
View
56 app/assets/stylesheets/scaffolds.css.scss
@@ -0,0 +1,56 @@
+body {
+ background-color: #fff;
+ color: #333;
+ font-family: verdana, arial, helvetica, sans-serif;
+ font-size: 13px;
+ line-height: 18px; }
+
+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;
+ &:visited {
+ color: #666; }
+ &:hover {
+ color: #fff;
+ background-color: #000; } }
+
+div {
+ &.field, &.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;
+ padding-bottom: 0;
+ margin-bottom: 20px;
+ background-color: #f0f0f0;
+ h2 {
+ text-align: left;
+ font-weight: bold;
+ padding: 5px 5px 5px 15px;
+ font-size: 12px;
+ margin: -7px;
+ margin-bottom: 0px;
+ background-color: #c00;
+ color: #fff; }
+ ul li {
+ font-size: 12px;
+ list-style: square; } }
View
83 app/controllers/edu_details_controller.rb
@@ -0,0 +1,83 @@
+class EduDetailsController < ApplicationController
+ # GET /edu_details
+ # GET /edu_details.json
+ def index
+ @edu_details = EduDetail.all
+
+ respond_to do |format|
+ format.html # index.html.erb
+ format.json { render json: @edu_details }
+ end
+ end
+
+ # GET /edu_details/1
+ # GET /edu_details/1.json
+ def show
+ @edu_detail = EduDetail.find(params[:id])
+
+ respond_to do |format|
+ format.html # show.html.erb
+ format.json { render json: @edu_detail }
+ end
+ end
+
+ # GET /edu_details/new
+ # GET /edu_details/new.json
+ def new
+ @edu_detail = EduDetail.new
+
+ respond_to do |format|
+ format.html # new.html.erb
+ format.json { render json: @edu_detail }
+ end
+ end
+
+ # GET /edu_details/1/edit
+ def edit
+ @edu_detail = EduDetail.find(params[:id])
+ end
+
+ # POST /edu_details
+ # POST /edu_details.json
+ def create
+ @edu_detail = EduDetail.new(params[:edu_detail])
+
+ respond_to do |format|
+ if @edu_detail.save
+ format.html { redirect_to @edu_detail, notice: 'Edu detail was successfully created.' }
+ format.json { render json: @edu_detail, status: :created, location: @edu_detail }
+ else
+ format.html { render action: "new" }
+ format.json { render json: @edu_detail.errors, status: :unprocessable_entity }
+ end
+ end
+ end
+
+ # PUT /edu_details/1
+ # PUT /edu_details/1.json
+ def update
+ @edu_detail = EduDetail.find(params[:id])
+
+ respond_to do |format|
+ if @edu_detail.update_attributes(params[:edu_detail])
+ format.html { redirect_to @edu_detail, notice: 'Edu detail was successfully updated.' }
+ format.json { head :no_content }
+ else
+ format.html { render action: "edit" }
+ format.json { render json: @edu_detail.errors, status: :unprocessable_entity }
+ end
+ end
+ end
+
+ # DELETE /edu_details/1
+ # DELETE /edu_details/1.json
+ def destroy
+ @edu_detail = EduDetail.find(params[:id])
+ @edu_detail.destroy
+
+ respond_to do |format|
+ format.html { redirect_to edu_details_url }
+ format.json { head :no_content }
+ end
+ end
+end
View
83 app/controllers/educations_controller.rb
@@ -0,0 +1,83 @@
+class EducationsController < ApplicationController
+ # GET /educations
+ # GET /educations.json
+ def index
+ @educations = Education.all
+
+ respond_to do |format|
+ format.html # index.html.erb
+ format.json { render json: @educations }
+ end
+ end
+
+ # GET /educations/1
+ # GET /educations/1.json
+ def show
+ @education = Education.find(params[:id])
+
+ respond_to do |format|
+ format.html # show.html.erb
+ format.json { render json: @education }
+ end
+ end
+
+ # GET /educations/new
+ # GET /educations/new.json
+ def new
+ @education = Education.new
+
+ respond_to do |format|
+ format.html # new.html.erb
+ format.json { render json: @education }
+ end
+ end
+
+ # GET /educations/1/edit
+ def edit
+ @education = Education.find(params[:id])
+ end
+
+ # POST /educations
+ # POST /educations.json
+ def create
+ @education = Education.new(params[:education])
+
+ respond_to do |format|
+ if @education.save
+ format.html { redirect_to @education, notice: 'Education was successfully created.' }
+ format.json { render json: @education, status: :created, location: @education }
+ else
+ format.html { render action: "new" }
+ format.json { render json: @education.errors, status: :unprocessable_entity }
+ end
+ end
+ end
+
+ # PUT /educations/1
+ # PUT /educations/1.json
+ def update
+ @education = Education.find(params[:id])
+
+ respond_to do |format|
+ if @education.update_attributes(params[:education])
+ format.html { redirect_to @education, notice: 'Education was successfully updated.' }
+ format.json { head :no_content }
+ else
+ format.html { render action: "edit" }
+ format.json { render json: @education.errors, status: :unprocessable_entity }
+ end
+ end
+ end
+
+ # DELETE /educations/1
+ # DELETE /educations/1.json
+ def destroy
+ @education = Education.find(params[:id])
+ @education.destroy
+
+ respond_to do |format|
+ format.html { redirect_to educations_url }
+ format.json { head :no_content }
+ end
+ end
+end
View
83 app/controllers/exp_details_controller.rb
@@ -0,0 +1,83 @@
+class ExpDetailsController < ApplicationController
+ # GET /exp_details
+ # GET /exp_details.json
+ def index
+ @exp_details = ExpDetail.all
+
+ respond_to do |format|
+ format.html # index.html.erb
+ format.json { render json: @exp_details }
+ end
+ end
+
+ # GET /exp_details/1
+ # GET /exp_details/1.json
+ def show
+ @exp_detail = ExpDetail.find(params[:id])
+
+ respond_to do |format|
+ format.html # show.html.erb
+ format.json { render json: @exp_detail }
+ end
+ end
+
+ # GET /exp_details/new
+ # GET /exp_details/new.json
+ def new
+ @exp_detail = ExpDetail.new
+
+ respond_to do |format|
+ format.html # new.html.erb
+ format.json { render json: @exp_detail }
+ end
+ end
+
+ # GET /exp_details/1/edit
+ def edit
+ @exp_detail = ExpDetail.find(params[:id])
+ end
+
+ # POST /exp_details
+ # POST /exp_details.json
+ def create
+ @exp_detail = ExpDetail.new(params[:exp_detail])
+
+ respond_to do |format|
+ if @exp_detail.save
+ format.html { redirect_to @exp_detail, notice: 'Exp detail was successfully created.' }
+ format.json { render json: @exp_detail, status: :created, location: @exp_detail }
+ else
+ format.html { render action: "new" }
+ format.json { render json: @exp_detail.errors, status: :unprocessable_entity }
+ end
+ end
+ end
+
+ # PUT /exp_details/1
+ # PUT /exp_details/1.json
+ def update
+ @exp_detail = ExpDetail.find(params[:id])
+
+ respond_to do |format|
+ if @exp_detail.update_attributes(params[:exp_detail])
+ format.html { redirect_to @exp_detail, notice: 'Exp detail was successfully updated.' }
+ format.json { head :no_content }
+ else
+ format.html { render action: "edit" }
+ format.json { render json: @exp_detail.errors, status: :unprocessable_entity }
+ end
+ end
+ end
+
+ # DELETE /exp_details/1
+ # DELETE /exp_details/1.json
+ def destroy
+ @exp_detail = ExpDetail.find(params[:id])
+ @exp_detail.destroy
+
+ respond_to do |format|
+ format.html { redirect_to exp_details_url }
+ format.json { head :no_content }
+ end
+ end
+end
View
83 app/controllers/experiences_controller.rb
@@ -0,0 +1,83 @@
+class ExperiencesController < ApplicationController
+ # GET /experiences
+ # GET /experiences.json
+ def index
+ @experiences = Experience.all
+
+ respond_to do |format|
+ format.html # index.html.erb
+ format.json { render json: @experiences }
+ end
+ end
+
+ # GET /experiences/1
+ # GET /experiences/1.json
+ def show
+ @experience = Experience.find(params[:id])
+
+ respond_to do |format|
+ format.html # show.html.erb
+ format.json { render json: @experience }
+ end
+ end
+
+ # GET /experiences/new
+ # GET /experiences/new.json
+ def new
+ @experience = Experience.new
+
+ respond_to do |format|
+ format.html # new.html.erb
+ format.json { render json: @experience }
+ end
+ end
+
+ # GET /experiences/1/edit
+ def edit
+ @experience = Experience.find(params[:id])
+ end
+
+ # POST /experiences
+ # POST /experiences.json
+ def create
+ @experience = Experience.new(params[:experience])
+
+ respond_to do |format|
+ if @experience.save
+ format.html { redirect_to @experience, notice: 'Experience was successfully created.' }
+ format.json { render json: @experience, status: :created, location: @experience }
+ else
+ format.html { render action: "new" }
+ format.json { render json: @experience.errors, status: :unprocessable_entity }
+ end
+ end
+ end
+
+ # PUT /experiences/1
+ # PUT /experiences/1.json
+ def update
+ @experience = Experience.find(params[:id])
+
+ respond_to do |format|
+ if @experience.update_attributes(params[:experience])
+ format.html { redirect_to @experience, notice: 'Experience was successfully updated.' }
+ format.json { head :no_content }
+ else
+ format.html { render action: "edit" }
+ format.json { render json: @experience.errors, status: :unprocessable_entity }
+ end
+ end
+ end
+
+ # DELETE /experiences/1
+ # DELETE /experiences/1.json
+ def destroy
+ @experience = Experience.find(params[:id])
+ @experience.destroy
+
+ respond_to do |format|
+ format.html { redirect_to experiences_url }
+ format.json { head :no_content }
+ end
+ end
+end
View
3  app/controllers/users_controller.rb
@@ -14,6 +14,9 @@ def index
# GET /users/1.json
def show
@user = User.find(params[:id])
+ @experiences = @user.experiences
+ @educations = @user.educations
+
respond_to do |format|
format.html # show.html.erb
View
2  app/helpers/edu_details_helper.rb
@@ -0,0 +1,2 @@
+module EduDetailsHelper
+end
View
2  app/helpers/educations_helper.rb
@@ -0,0 +1,2 @@
+module EducationsHelper
+end
View
2  app/helpers/exp_details_helper.rb
@@ -0,0 +1,2 @@
+module ExpDetailsHelper
+end
View
2  app/helpers/experiences_helper.rb
@@ -0,0 +1,2 @@
+module ExperiencesHelper
+end
View
5 app/models/edu_detail.rb
@@ -0,0 +1,5 @@
+class EduDetail < ActiveRecord::Base
+ attr_accessible :detail, :detail_order, :education_id
+
+ belongs_to :education
+end
View
8 app/models/education.rb
@@ -0,0 +1,8 @@
+class Education < ActiveRecord::Base
+ attr_accessible :graduation, :institution, :institution_url, :list_order, :study, :user_id
+
+ belongs_to :user
+
+ has_many :edu_details
+
+end
View
5 app/models/exp_detail.rb
@@ -0,0 +1,5 @@
+class ExpDetail < ActiveRecord::Base
+ attr_accessible :detail, :detail_order, :experience_id
+
+ belongs_to :experience
+end
View
8 app/models/experience.rb
@@ -0,0 +1,8 @@
+class Experience < ActiveRecord::Base
+ attr_accessible :company, :company_url, :date, :list_order, :title, :user_id
+
+ belongs_to :user
+
+ has_many :exp_details
+
+end
View
6 app/models/user.rb
@@ -1,3 +1,9 @@
class User < ActiveRecord::Base
attr_accessible :city, :description, :email, :emailshow, :facebook_url, :facebookshow, :headshot_url, :linkedin_url, :linkedinshow, :name, :phone, :tagline, :twitter_url, :twittershow
+
+ has_many :experiences
+ has_many :educations
+ has_many :exp_details, :through => :experiences
+ has_many :edu_details, :through => :educations
+
end
View
29 app/views/edu_details/_form.html.erb
@@ -0,0 +1,29 @@
+<%= form_for(@edu_detail) do |f| %>
+ <% if @edu_detail.errors.any? %>
+ <div id="error_explanation">
+ <h2><%= pluralize(@edu_detail.errors.count, "error") %> prohibited this edu_detail from being saved:</h2>
+
+ <ul>
+ <% @edu_detail.errors.full_messages.each do |msg| %>
+ <li><%= msg %></li>
+ <% end %>
+ </ul>
+ </div>
+ <% end %>
+
+ <div class="field">
+ <%= f.label :education_id %><br />
+ <%= f.number_field :education_id %>
+ </div>
+ <div class="field">
+ <%= f.label :detail %><br />
+ <%= f.text_field :detail %>
+ </div>
+ <div class="field">
+ <%= f.label :detail_order %><br />
+ <%= f.number_field :detail_order %>
+ </div>
+ <div class="actions">
+ <%= f.submit %>
+ </div>
+<% end %>
View
6 app/views/edu_details/edit.html.erb
@@ -0,0 +1,6 @@
+<h1>Editing edu_detail</h1>
+
+<%= render 'form' %>
+
+<%= link_to 'Show', @edu_detail %> |
+<%= link_to 'Back', edu_details_path %>
View
27 app/views/edu_details/index.html.erb
@@ -0,0 +1,27 @@
+<h1>Listing edu_details</h1>
+
+<table>
+ <tr>
+ <th>Education</th>
+ <th>Detail</th>
+ <th>Detail order</th>
+ <th></th>
+ <th></th>
+ <th></th>
+ </tr>
+
+<% @edu_details.each do |edu_detail| %>
+ <tr>
+ <td><%= edu_detail.education_id %></td>
+ <td><%= edu_detail.detail %></td>
+ <td><%= edu_detail.detail_order %></td>
+ <td><%= link_to 'Show', edu_detail %></td>
+ <td><%= link_to 'Edit', edit_edu_detail_path(edu_detail) %></td>
+ <td><%= link_to 'Destroy', edu_detail, confirm: 'Are you sure?', method: :delete %></td>
+ </tr>
+<% end %>
+</table>
+
+<br />
+
+<%= link_to 'New Edu detail', new_edu_detail_path %>
View
5 app/views/edu_details/new.html.erb
@@ -0,0 +1,5 @@
+<h1>New edu_detail</h1>
+
+<%= render 'form' %>
+
+<%= link_to 'Back', edu_details_path %>
View
20 app/views/edu_details/show.html.erb
@@ -0,0 +1,20 @@
+<p id="notice"><%= notice %></p>
+
+<p>
+ <b>Education:</b>
+ <%= @edu_detail.education_id %>
+</p>
+
+<p>
+ <b>Detail:</b>
+ <%= @edu_detail.detail %>
+</p>
+
+<p>
+ <b>Detail order:</b>
+ <%= @edu_detail.detail_order %>
+</p>
+
+
+<%= link_to 'Edit', edit_edu_detail_path(@edu_detail) %> |
+<%= link_to 'Back', edu_details_path %>
View
41 app/views/educations/_form.html.erb
@@ -0,0 +1,41 @@
+<%= form_for(@education) do |f| %>
+ <% if @education.errors.any? %>
+ <div id="error_explanation">
+ <h2><%= pluralize(@education.errors.count, "error") %> prohibited this education from being saved:</h2>
+
+ <ul>
+ <% @education.errors.full_messages.each do |msg| %>
+ <li><%= msg %></li>
+ <% end %>
+ </ul>
+ </div>
+ <% end %>
+
+ <div class="field">
+ <%= f.label :user_id %><br />
+ <%= f.number_field :user_id %>
+ </div>
+ <div class="field">
+ <%= f.label :study %><br />
+ <%= f.text_field :study %>
+ </div>
+ <div class="field">
+ <%= f.label :institution %><br />
+ <%= f.text_field :institution %>
+ </div>
+ <div class="field">
+ <%= f.label :institution_url %><br />
+ <%= f.text_field :institution_url %>
+ </div>
+ <div class="field">
+ <%= f.label :graduation %><br />
+ <%= f.text_field :graduation %>
+ </div>
+ <div class="field">
+ <%= f.label :list_order %><br />
+ <%= f.number_field :list_order %>
+ </div>
+ <div class="actions">
+ <%= f.submit %>
+ </div>
+<% end %>
View
6 app/views/educations/edit.html.erb
@@ -0,0 +1,6 @@
+<h1>Editing education</h1>
+
+<%= render 'form' %>
+
+<%= link_to 'Show', @education %> |
+<%= link_to 'Back', educations_path %>
View
33 app/views/educations/index.html.erb
@@ -0,0 +1,33 @@
+<h1>Listing educations</h1>
+
+<table>
+ <tr>
+ <th>User</th>
+ <th>Study</th>
+ <th>Institution</th>
+ <th>Institution url</th>
+ <th>Graduation</th>
+ <th>List order</th>
+ <th></th>
+ <th></th>
+ <th></th>
+ </tr>
+
+<% @educations.each do |education| %>
+ <tr>
+ <td><%= education.user_id %></td>
+ <td><%= education.study %></td>
+ <td><%= education.institution %></td>
+ <td><%= education.institution_url %></td>
+ <td><%= education.graduation %></td>
+ <td><%= education.list_order %></td>
+ <td><%= link_to 'Show', education %></td>
+ <td><%= link_to 'Edit', edit_education_path(education) %></td>
+ <td><%= link_to 'Destroy', education, confirm: 'Are you sure?', method: :delete %></td>
+ </tr>
+<% end %>
+</table>
+
+<br />
+
+<%= link_to 'New Education', new_education_path %>
View
5 app/views/educations/new.html.erb
@@ -0,0 +1,5 @@
+<h1>New education</h1>
+
+<%= render 'form' %>
+
+<%= link_to 'Back', educations_path %>
View
35 app/views/educations/show.html.erb
@@ -0,0 +1,35 @@
+<p id="notice"><%= notice %></p>
+
+<p>
+ <b>User:</b>
+ <%= @education.user_id %>
+</p>
+
+<p>
+ <b>Study:</b>
+ <%= @education.study %>
+</p>
+
+<p>
+ <b>Institution:</b>
+ <%= @education.institution %>
+</p>
+
+<p>
+ <b>Institution url:</b>
+ <%= @education.institution_url %>
+</p>
+
+<p>
+ <b>Graduation:</b>
+ <%= @education.graduation %>
+</p>
+
+<p>
+ <b>List order:</b>
+ <%= @education.list_order %>
+</p>
+
+
+<%= link_to 'Edit', edit_education_path(@education) %> |
+<%= link_to 'Back', educations_path %>
View
29 app/views/exp_details/_form.html.erb
@@ -0,0 +1,29 @@
+<%= form_for(@exp_detail) do |f| %>
+ <% if @exp_detail.errors.any? %>
+ <div id="error_explanation">
+ <h2><%= pluralize(@exp_detail.errors.count, "error") %> prohibited this exp_detail from being saved:</h2>
+
+ <ul>
+ <% @exp_detail.errors.full_messages.each do |msg| %>
+ <li><%= msg %></li>
+ <% end %>
+ </ul>
+ </div>
+ <% end %>
+
+ <div class="field">
+ <%= f.label :experience_id %><br />
+ <%= f.number_field :experience_id %>
+ </div>
+ <div class="field">
+ <%= f.label :detail %><br />
+ <%= f.text_field :detail %>
+ </div>
+ <div class="field">
+ <%= f.label :detail_order %><br />
+ <%= f.number_field :detail_order %>
+ </div>
+ <div class="actions">
+ <%= f.submit %>
+ </div>
+<% end %>
View
6 app/views/exp_details/edit.html.erb
@@ -0,0 +1,6 @@
+<h1>Editing exp_detail</h1>
+
+<%= render 'form' %>
+
+<%= link_to 'Show', @exp_detail %> |
+<%= link_to 'Back', exp_details_path %>
View
27 app/views/exp_details/index.html.erb
@@ -0,0 +1,27 @@
+<h1>Listing exp_details</h1>
+
+<table>
+ <tr>
+ <th>Experience</th>
+ <th>Detail</th>
+ <th>Detail order</th>
+ <th></th>
+ <th></th>
+ <th></th>
+ </tr>
+
+<% @exp_details.each do |exp_detail| %>
+ <tr>
+ <td><%= exp_detail.experience_id %></td>
+ <td><%= exp_detail.detail %></td>
+ <td><%= exp_detail.detail_order %></td>
+ <td><%= link_to 'Show', exp_detail %></td>
+ <td><%= link_to 'Edit', edit_exp_detail_path(exp_detail) %></td>
+ <td><%= link_to 'Destroy', exp_detail, confirm: 'Are you sure?', method: :delete %></td>
+ </tr>
+<% end %>
+</table>
+
+<br />
+
+<%= link_to 'New Exp detail', new_exp_detail_path %>
View
5 app/views/exp_details/new.html.erb
@@ -0,0 +1,5 @@
+<h1>New exp_detail</h1>
+
+<%= render 'form' %>
+
+<%= link_to 'Back', exp_details_path %>
View
20 app/views/exp_details/show.html.erb
@@ -0,0 +1,20 @@
+<p id="notice"><%= notice %></p>
+
+<p>
+ <b>Experience:</b>
+ <%= @exp_detail.experience_id %>
+</p>
+
+<p>
+ <b>Detail:</b>
+ <%= @exp_detail.detail %>
+</p>
+
+<p>
+ <b>Detail order:</b>
+ <%= @exp_detail.detail_order %>
+</p>
+
+
+<%= link_to 'Edit', edit_exp_detail_path(@exp_detail) %> |
+<%= link_to 'Back', exp_details_path %>
View
41 app/views/experiences/_form.html.erb
@@ -0,0 +1,41 @@
+<%= form_for(@experience) do |f| %>
+ <% if @experience.errors.any? %>
+ <div id="error_explanation">
+ <h2><%= pluralize(@experience.errors.count, "error") %> prohibited this experience from being saved:</h2>
+
+ <ul>
+ <% @experience.errors.full_messages.each do |msg| %>
+ <li><%= msg %></li>
+ <% end %>
+ </ul>
+ </div>
+ <% end %>
+
+ <div class="field">
+ <%= f.label :user_id %><br />
+ <%= f.number_field :user_id %>
+ </div>
+ <div class="field">
+ <%= f.label :title %><br />
+ <%= f.text_field :title %>
+ </div>
+ <div class="field">
+ <%= f.label :company %><br />
+ <%= f.text_field :company %>
+ </div>
+ <div class="field">
+ <%= f.label :company_url %><br />
+ <%= f.text_field :company_url %>
+ </div>
+ <div class="field">
+ <%= f.label :date %><br />
+ <%= f.text_field :date %>
+ </div>
+ <div class="field">
+ <%= f.label :list_order %><br />
+ <%= f.number_field :list_order %>
+ </div>
+ <div class="actions">
+ <%= f.submit %>
+ </div>
+<% end %>
View
6 app/views/experiences/edit.html.erb
@@ -0,0 +1,6 @@
+<h1>Editing experience</h1>
+
+<%= render 'form' %>
+
+<%= link_to 'Show', @experience %> |
+<%= link_to 'Back', experiences_path %>
View
33 app/views/experiences/index.html.erb
@@ -0,0 +1,33 @@
+<h1>Listing experiences</h1>
+
+<table>
+ <tr>
+ <th>User</th>
+ <th>Title</th>
+ <th>Company</th>
+ <th>Company url</th>
+ <th>Date</th>
+ <th>List order</th>
+ <th></th>
+ <th></th>
+ <th></th>
+ </tr>
+
+<% @experiences.each do |experience| %>
+ <tr>
+ <td><%= experience.user_id %></td>
+ <td><%= experience.title %></td>
+ <td><%= experience.company %></td>
+ <td><%= experience.company_url %></td>
+ <td><%= experience.date %></td>
+ <td><%= experience.list_order %></td>
+ <td><%= link_to 'Show', experience %></td>
+ <td><%= link_to 'Edit', edit_experience_path(experience) %></td>
+ <td><%= link_to 'Destroy', experience, confirm: 'Are you sure?', method: :delete %></td>
+ </tr>
+<% end %>
+</table>
+
+<br />
+
+<%= link_to 'New Experience', new_experience_path %>
View
5 app/views/experiences/new.html.erb
@@ -0,0 +1,5 @@
+<h1>New experience</h1>
+
+<%= render 'form' %>
+
+<%= link_to 'Back', experiences_path %>
View
35 app/views/experiences/show.html.erb
@@ -0,0 +1,35 @@
+<p id="notice"><%= notice %></p>
+
+<p>
+ <b>User:</b>
+ <%= @experience.user_id %>
+</p>
+
+<p>
+ <b>Title:</b>
+ <%= @experience.title %>
+</p>
+
+<p>
+ <b>Company:</b>
+ <%= @experience.company %>
+</p>
+
+<p>
+ <b>Company url:</b>
+ <%= @experience.company_url %>
+</p>
+
+<p>
+ <b>Date:</b>
+ <%= @experience.date %>
+</p>
+
+<p>
+ <b>List order:</b>
+ <%= @experience.list_order %>
+</p>
+
+
+<%= link_to 'Edit', edit_experience_path(@experience) %> |
+<%= link_to 'Back', experiences_path %>
View
59 app/views/users/show.html.erb
@@ -70,30 +70,28 @@
<!-- Timeline for Employment -->
<h3 class="main-heading"><span>Experience</span></h3>
<ul class="timeline">
- <li>
-
+ <!-- Show User's Experience sorted by Experience.list_order -->
+ <% @experiences.order("list_order ASC").each do |work| %>
+ <li>
<div class="timelineUnit">
- <h4>Chief Maid<span class="timelineDate">2012 - Present</span></h4>
- <h5><a href="http://www.leasemaid.com">LeaseMaid.com</a></h5>
- <p>Working with <a href="http://redsquirrel.com/dave/">Dave Hoover</a> and <a href="http://www.doejo.com">Doejo</a> to launch as we speak.</p>
- </div>
- </li>
- <li>
-
- <div class="timelineUnit">
- <h4>Managing Partner<span class="timelineDate">2010 - Present</span></h4>
- <h5><a href="http://www.generationchicago">Generation Real Estate</a></h5>
- <p>Performed due diligence on over $125MM worth of mixed-used investment properties; Brokered over $10MM in rentals and sales to date.</p>
+ <h4><%= work.title %><span class="timelineDate"><%= work.date %></span></h4>
+ <h5><a href="<%= work.company_url %>"><%= work.company %></a></h5>
+ <% work.exp_details.order("detail_order ASC").each do |descrip| %>
+ <p><%= descrip.detail %></p>
+ <% end %>
</div>
</li>
+ <% end %>
+ <!-- End Experiences Loop -->
+
+ <!--
<li>
-
<div class="timelineUnit">
<h4>Credit and Treasury Analyst<span class="timelineDate">2006 - 2010</span></h4>
<h5><a href="http://www.baml.com">Bank of America</a></h5>
<p><a href="https://docs.google.com/open?id=0BwQHWJtjFgvKYzQyYzI0ZDEtNzliNi00NWUwLTk1ZDItYzg1MWI3NWM2MzY5">Excelled in two interships</a> and graduated from a rotational Commercial training program after graduation.</p>
</div>
- </li>
+ </li> -->
<div class="clear"></div>
</ul>
<!-- /Timeline for Employment -->
@@ -101,22 +99,29 @@
<!-- Timeline for Education -->
<h3 class="main-heading"><span>Education</span></h3>
<ul class="timeline">
+ <!-- Show User's Education sorted by Education.list_order -->
+ <% @educations.order("list_order ASC").each do |educ| %>
+
<li>
<div class="timelineUnit">
- <h4>Web Development<span class="timelineDate">Winter 2012</span></h4>
- <h5><a href="http://www.CodeAcademy.org">CodeAcademy.org</a></h5>
- <p>Skills: HTML, CSS, Ruby, Rails, Wordpress, Databases</p>
- </div>
- </li>
- <li>
- <div class="timelineUnit">
- <h4>Real Estate Finance<span class="timelineDate">May 2009</span></h4>
- <h5><a href="http://kelley.iu.edu/">Indiana University, Kelley School of Business</a></h5>
- <p>Skills: Real Estate Investments, Developments, Valuations, Economics</p>
- <p>Awards: 1st Place, Benecki Case Competition (<a href="https://docs.google.com/open?id=0BwQHWJtjFgvKaDh3UldPWWRqcG8">See Bottom Page 6</a> )</p>
+ <h4><%= educ.study %><span class="timelineDate"><%= educ.graduation %></span></h4>
+ <h5><a href="<%= educ.institution_url %>"><%= educ.institution %></a></h5>
+ <% educ.edu_details.order("detail_order ASC").each do |descrip| %>
+ <p><%= descrip.detail %></p>
+ <% end %>
</div>
</li>
- <div class="clear"></div>
+ <% end %>
+
+ <!-- <li>
+ <div class="timelineUnit">
+ <h4>Real Estate Finance<span class="timelineDate">May 2009</span></h4>
+ <h5><a href="http://kelley.iu.edu/">Indiana University, Kelley School of Business</a></h5>
+ <p>Skills: Real Estate Investments, Developments, Valuations, Economics</p>
+ <p>Awards: 1st Place, Benecki Case Competition (<a href="https://docs.google.com/open?id=0BwQHWJtjFgvKaDh3UldPWWRqcG8">See Bottom Page 6</a> )</p>
+ </div>
+ </li> -->
+ <div class="clear"></div>
</ul>
<!-- /Timeline for Education -->
</div>
View
8 config/routes.rb
@@ -1,5 +1,13 @@
Resbot::Application.routes.draw do
+ resources :edu_details
+
+ resources :educations
+
+ resources :exp_details
+
+ resources :experiences
+
root :to => "pages#home"
resources :users
View
14 db/migrate/20120419113123_create_experiences.rb
@@ -0,0 +1,14 @@
+class CreateExperiences < ActiveRecord::Migration
+ def change
+ create_table :experiences do |t|
+ t.integer :user_id
+ t.string :title
+ t.string :company
+ t.string :company_url
+ t.string :date
+ t.integer :list_order
+
+ t.timestamps
+ end
+ end
+end
View
11 db/migrate/20120419122636_create_exp_details.rb
@@ -0,0 +1,11 @@
+class CreateExpDetails < ActiveRecord::Migration
+ def change
+ create_table :exp_details do |t|
+ t.integer :experience_id
+ t.string :detail
+ t.integer :detail_order
+
+ t.timestamps
+ end
+ end
+end
View
14 db/migrate/20120419130258_create_educations.rb
@@ -0,0 +1,14 @@
+class CreateEducations < ActiveRecord::Migration
+ def change
+ create_table :educations do |t|
+ t.integer :user_id
+ t.string :study
+ t.string :institution
+ t.string :institution_url
+ t.string :graduation
+ t.integer :list_order
+
+ t.timestamps
+ end
+ end
+end
View
11 db/migrate/20120419130408_create_edu_details.rb
@@ -0,0 +1,11 @@
+class CreateEduDetails < ActiveRecord::Migration
+ def change
+ create_table :edu_details do |t|
+ t.integer :education_id
+ t.string :detail
+ t.integer :detail_order
+
+ t.timestamps
+ end
+ end
+end
View
49 db/schema.rb
@@ -11,7 +11,54 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20120419094431) do
+ActiveRecord::Schema.define(:version => 20120419130408) do
+
+ create_table "details", :force => true do |t|
+ t.integer "exp_or_edu"
+ t.integer "e_id"
+ t.string "detail"
+ t.integer "detail_order"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "edu_details", :force => true do |t|
+ t.integer "education_id"
+ t.string "detail"
+ t.integer "detail_order"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "educations", :force => true do |t|
+ t.integer "user_id"
+ t.string "study"
+ t.string "institution"
+ t.string "institution_url"
+ t.string "graduation"
+ t.integer "list_order"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "exp_details", :force => true do |t|
+ t.integer "experience_id"
+ t.string "detail"
+ t.integer "detail_order"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "experiences", :force => true do |t|
+ t.integer "user_id"
+ t.string "title"
+ t.string "company"
+ t.string "company_url"
+ t.string "date"
+ t.integer "list_order"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
create_table "users", :force => true do |t|
t.string "name"
View
11 test/fixtures/edu_details.yml
@@ -0,0 +1,11 @@
+# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
+
+one:
+ education_id: 1
+ detail: MyString
+ detail_order: 1
+
+two:
+ education_id: 1
+ detail: MyString
+ detail_order: 1
View
17 test/fixtures/educations.yml
@@ -0,0 +1,17 @@
+# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
+
+one:
+ user_id: 1
+ study: MyString
+ institution: MyString
+ institution_url: MyString
+ graduation: MyString
+ list_order: 1
+
+two:
+ user_id: 1
+ study: MyString
+ institution: MyString
+ institution_url: MyString
+ graduation: MyString
+ list_order: 1
View
11 test/fixtures/exp_details.yml
@@ -0,0 +1,11 @@
+# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
+
+one:
+ experience_id: 1
+ detail: MyString
+ detail_order: 1
+
+two:
+ experience_id: 1
+ detail: MyString
+ detail_order: 1
View
17 test/fixtures/experiences.yml
@@ -0,0 +1,17 @@
+# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
+
+one:
+ user_id: 1
+ title: MyString
+ company: MyString
+ company_url: MyString
+ date: MyString
+ list_order: 1
+
+two:
+ user_id: 1
+ title: MyString
+ company: MyString
+ company_url: MyString
+ date: MyString
+ list_order: 1
View
49 test/functional/edu_details_controller_test.rb
@@ -0,0 +1,49 @@
+require 'test_helper'
+
+class EduDetailsControllerTest < ActionController::TestCase
+ setup do
+ @edu_detail = edu_details(:one)
+ end
+
+ test "should get index" do
+ get :index
+ assert_response :success
+ assert_not_nil assigns(:edu_details)
+ end
+
+ test "should get new" do
+ get :new
+ assert_response :success
+ end
+
+ test "should create edu_detail" do
+ assert_difference('EduDetail.count') do
+ post :create, edu_detail: { detail: @edu_detail.detail, detail_order: @edu_detail.detail_order, education_id: @edu_detail.education_id }
+ end
+
+ assert_redirected_to edu_detail_path(assigns(:edu_detail))
+ end
+
+ test "should show edu_detail" do
+ get :show, id: @edu_detail
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get :edit, id: @edu_detail
+ assert_response :success
+ end
+
+ test "should update edu_detail" do
+ put :update, id: @edu_detail, edu_detail: { detail: @edu_detail.detail, detail_order: @edu_detail.detail_order, education_id: @edu_detail.education_id }
+ assert_redirected_to edu_detail_path(assigns(:edu_detail))
+ end
+
+ test "should destroy edu_detail" do
+ assert_difference('EduDetail.count', -1) do
+ delete :destroy, id: @edu_detail
+ end
+
+ assert_redirected_to edu_details_path
+ end
+end
View
49 test/functional/educations_controller_test.rb
@@ -0,0 +1,49 @@
+require 'test_helper'
+
+class EducationsControllerTest < ActionController::TestCase
+ setup do
+ @education = educations(:one)
+ end
+
+ test "should get index" do
+ get :index
+ assert_response :success
+ assert_not_nil assigns(:educations)
+ end
+
+ test "should get new" do
+ get :new
+ assert_response :success
+ end
+
+ test "should create education" do
+ assert_difference('Education.count') do
+ post :create, education: { graduation: @education.graduation, institution: @education.institution, institution_url: @education.institution_url, list_order: @education.list_order, study: @education.study, user_id: @education.user_id }
+ end
+
+ assert_redirected_to education_path(assigns(:education))
+ end
+
+ test "should show education" do
+ get :show, id: @education
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get :edit, id: @education
+ assert_response :success
+ end
+
+ test "should update education" do
+ put :update, id: @education, education: { graduation: @education.graduation, institution: @education.institution, institution_url: @education.institution_url, list_order: @education.list_order, study: @education.study, user_id: @education.user_id }
+ assert_redirected_to education_path(assigns(:education))
+ end
+
+ test "should destroy education" do
+ assert_difference('Education.count', -1) do
+ delete :destroy, id: @education
+ end
+
+ assert_redirected_to educations_path
+ end
+end
View
49 test/functional/exp_details_controller_test.rb
@@ -0,0 +1,49 @@
+require 'test_helper'
+
+class ExpDetailsControllerTest < ActionController::TestCase
+ setup do
+ @exp_detail = exp_details(:one)
+ end
+
+ test "should get index" do
+ get :index
+ assert_response :success
+ assert_not_nil assigns(:exp_details)
+ end
+
+ test "should get new" do
+ get :new
+ assert_response :success
+ end
+
+ test "should create exp_detail" do
+ assert_difference('ExpDetail.count') do
+ post :create, exp_detail: { detail: @exp_detail.detail, detail_order: @exp_detail.detail_order, experience_id: @exp_detail.experience_id }
+ end
+
+ assert_redirected_to exp_detail_path(assigns(:exp_detail))
+ end
+
+ test "should show exp_detail" do
+ get :show, id: @exp_detail
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get :edit, id: @exp_detail
+ assert_response :success
+ end
+
+ test "should update exp_detail" do
+ put :update, id: @exp_detail, exp_detail: { detail: @exp_detail.detail, detail_order: @exp_detail.detail_order, experience_id: @exp_detail.experience_id }
+ assert_redirected_to exp_detail_path(assigns(:exp_detail))
+ end
+
+ test "should destroy exp_detail" do
+ assert_difference('ExpDetail.count', -1) do
+ delete :destroy, id: @exp_detail
+ end
+
+ assert_redirected_to exp_details_path
+ end
+end
View
49 test/functional/experiences_controller_test.rb
@@ -0,0 +1,49 @@
+require 'test_helper'
+
+class ExperiencesControllerTest < ActionController::TestCase
+ setup do
+ @experience = experiences(:one)
+ end
+
+ test "should get index" do
+ get :index
+ assert_response :success
+ assert_not_nil assigns(:experiences)
+ end
+
+ test "should get new" do
+ get :new
+ assert_response :success
+ end
+
+ test "should create experience" do
+ assert_difference('Experience.count') do
+ post :create, experience: { company: @experience.company, company_url: @experience.company_url, date: @experience.date, list_order: @experience.list_order, title: @experience.title, user_id: @experience.user_id }
+ end
+
+ assert_redirected_to experience_path(assigns(:experience))
+ end
+
+ test "should show experience" do
+ get :show, id: @experience
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get :edit, id: @experience
+ assert_response :success
+ end
+
+ test "should update experience" do
+ put :update, id: @experience, experience: { company: @experience.company, company_url: @experience.company_url, date: @experience.date, list_order: @experience.list_order, title: @experience.title, user_id: @experience.user_id }
+ assert_redirected_to experience_path(assigns(:experience))
+ end
+
+ test "should destroy experience" do
+ assert_difference('Experience.count', -1) do
+ delete :destroy, id: @experience
+ end
+
+ assert_redirected_to experiences_path
+ end
+end
View
7 test/unit/edu_detail_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class EduDetailTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
View
7 test/unit/education_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class EducationTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
View
7 test/unit/exp_detail_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class ExpDetailTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
View
7 test/unit/experience_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class ExperienceTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
View
4 test/unit/helpers/edu_details_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class EduDetailsHelperTest < ActionView::TestCase
+end
View
4 test/unit/helpers/educations_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class EducationsHelperTest < ActionView::TestCase
+end
View
4 test/unit/helpers/exp_details_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class ExpDetailsHelperTest < ActionView::TestCase
+end
View
4 test/unit/helpers/experiences_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class ExperiencesHelperTest < ActionView::TestCase
+end

No commit comments for this range

Something went wrong with that request. Please try again.