Skip to content
Browse files

Add a simple employee resource and views. Use flutie css to pretty it…

… up.
  • Loading branch information...
1 parent e8361c6 commit cccca16e8230d49433af313db7008ad516f7543c @metaskills metaskills committed Jun 23, 2011
View
9 README.md
@@ -23,6 +23,15 @@ export ADVENTUREWORKS_HOST='vm2008'
Note, we have copies in tmp directory, will LT version work? Comment on this above.
+
+class JobCandidate < ActiveRecord::Base
+ set_table_name '[HumanResources].[JobCandidate]'
+ set_primary_key 'JobCandidateID'
+ ...
+end
+
+
+
# Noteworthy
We created a config/initializers/activerecord.rb file that holds two optional configurations. One for the table name prefix to match our default schema. This way we can keep our table name configurations to a minimal in our models. We also added a configuration option for the SQL Server adapter to enable newly created string columns as unicode/national types. This only affects newly created columns via migrations. So if you specify a :string type, you will get nvarchar(255) vs varchar(255).
View
BIN app/assets/images/rails.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
9 app/assets/javascripts/application.js
@@ -0,0 +1,9 @@
+// This is a manifest file that'll be compiled into including all the files listed below.
+// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
+// be included in the compiled file accessible from http://example.com/assets/application.js
+// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
+// the compiled file.
+//
+//= require jquery
+//= require jquery_ujs
+//= require_tree .
View
10 app/assets/stylesheets/application.css
@@ -0,0 +1,10 @@
+/*
+ * This is a manifest file that'll automatically include all the stylesheets available in this directory
+ * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
+ * the top of the compiled file, but it's generally better to create a new file per style scope.
+ *= require_self
+ *= require_tree .
+*/
+
+#scallfold_body { padding: 20px; }
+
View
587 app/assets/stylesheets/flutie.css
@@ -0,0 +1,587 @@
+
+/*
+ html5doctor.com Reset Stylesheet (Eric Meyer's Reset Reloaded + HTML5 baseline)
+ v1.4 2009-07-27 | Authors: Eric Meyer & Richard Clark
+ html5doctor.com/html-5-reset-stylesheet/
+
+ https://github.com/thoughtbot/flutie
+*/
+
+html, body, div, span, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+abbr, address, cite, code,
+del, dfn, em, img, ins, kbd, q, samp,
+small, strong, sub, sup, var,
+b, i,
+dl, dt, dd, ol, ul, li,
+fieldset, form, label, legend,
+table, caption, tbody, tfoot, thead, tr, th, td,
+article, aside, canvas, details, figcaption, figure,
+footer, header, hgroup, menu, nav, section, summary,
+time, mark, audio, video {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ outline: 0;
+ font-size: 100%;
+ vertical-align: baseline;
+ background: transparent; }
+
+article, aside, details, figcaption, figure,
+footer, header, hgroup, menu, nav, section {
+ display: block; }
+
+nav ul {
+ list-style: none; }
+
+blockquote, q {
+ quotes: none; }
+
+blockquote:before, blockquote:after,
+q:before, q:after {
+ content: '';
+ content: none; }
+
+a {
+ margin: 0;
+ padding: 0;
+ font-size: 100%;
+ vertical-align: baseline;
+ background: transparent; }
+
+ins {
+ background-color: #ff9;
+ color: #000;
+ text-decoration: none; }
+
+mark {
+ background-color: #ff9;
+ color: #000;
+ font-style: italic;
+ font-weight: bold; }
+
+del {
+ text-decoration: line-through; }
+
+abbr[title], dfn[title] {
+ cursor: help; }
+
+/* tables still need cellspacing="0" in the markup */
+table {
+ border-collapse: collapse;
+ border-spacing: 0; }
+
+hr {
+ display: block;
+ height: 1px;
+ border: 0;
+ border-top: 1px solid #ccc;
+ margin: 1em 0;
+ padding: 0; }
+
+input, select {
+ vertical-align: middle; }
+
+/* this hack is courtesy of gbbowers on github
+ https://gist.github.com/601810 */
+/* Useful with form inputs and textareas */
+/* Legacy support for inline-block in IE7 (maybe IE6) */
+body {
+ color: #222;
+ font-size: 13px;
+ font-family: "helvetica neue", arial, helvetica, "lucida grande", sans-serif; }
+
+h1, h2, h3, h4, h5, h6 {
+ color: #111;
+ font-family: "helvetica neue", Helvetica, arial, sans-serif; }
+
+/* Success, error & notice boxes for messages and errors. */
+div.error, div.notice, div.success,
+#flash_failure, #flash_success, #flash_notice {
+ -moz-border-radius: 8px;
+ -webkit-border-radius: 8px;
+ border: 1px solid #ddd;
+ margin-bottom: 1em;
+ padding: 0.8em; }
+
+div.error,
+#flash_failure {
+ background: #FBE3E4;
+ border-color: #FBC2C4;
+ color: #D12F19; }
+
+div.error a,
+#flash_failure a {
+ color: #D12F19; }
+
+div.notice,
+#flash_notice {
+ background: #FFF6BF;
+ border-color: #FFD324;
+ color: #817134; }
+
+div.notice a,
+#flash_notice a {
+ color: #817134; }
+
+div.success,
+#flash_success {
+ background: #E6EFC2;
+ border-color: #C6D880;
+ color: #529214; }
+
+div.success a,
+#flash_success a {
+ color: #529214; }
+
+/* Misc classes and elements */
+/* Use a .box to create a padded box inside a column. */
+.box {
+ background: #eee;
+ margin-bottom: 1.5em;
+ padding: 1.5em; }
+
+/* Use this to create a horizontal ruler across a column. */
+hr {
+ background: #ddd;
+ border: none;
+ clear: both;
+ color: #ddd;
+ float: none;
+ height: 1px;
+ margin: 0 0 1.4em;
+ width: 100%; }
+
+hr.space {
+ background: #fff;
+ color: #fff; }
+
+/* for image replacement */
+.ir {
+ background-repeat: no-repeat;
+ direction: ltr;
+ display: block;
+ overflow: hidden;
+ text-align: left;
+ text-indent: -999em; }
+
+/* Hide for both screenreaders and browsers
+ css-discuss.incutio.com/wiki/Screenreader_Visibility */
+.hidden {
+ display: none;
+ visibility: hidden; }
+
+/* Hide only visually, but have it available for screenreaders
+ www.webaim.org/techniques/css/invisiblecontent/ & j.mp/visuallyhidden */
+.visuallyhidden {
+ clip: rect(1px 1px 1px 1px);
+ /* IE6, IE7 */
+ clip: rect(1px, 1px, 1px, 1px);
+ position: absolute !important; }
+
+/* Hide visually and from screenreaders, but maintain layout */
+.invisible {
+ visibility: hidden; }
+
+/* >> The Magnificent CLEARFIX: Updated to prevent margin-collapsing on child elements << j.mp/bestclearfix */
+.clearfix:before,
+.clearfix:after {
+ content: "\0020";
+ display: block;
+ height: 0;
+ visibility: hidden; }
+
+.clearfix:after {
+ clear: both; }
+
+/* Fix clearfix: blueprintcss.lighthouseapp.com/projects/15318/tickets/5-extra-margin-padding-bottom-of-page */
+.clearfix {
+ zoom: 1; }
+
+.ie7 img {
+ -ms-interpolation-mode: bicubic; }
+
+@media print {
+ * {
+ background: transparent !important;
+ color: #444 !important;
+ text-shadow: none !important; }
+
+ a, a:visited {
+ color: #444 !important;
+ text-decoration: underline; }
+
+ a:after {
+ content: " (" attr(href) ")"; }
+
+ abbr:after {
+ content: " (" attr(title) ")"; }
+
+ .ir a:after {
+ content: ""; }
+
+ /* Don't show links for images */
+ pre, blockquote {
+ border: 1px solid #999;
+ page-break-inside: avoid; }
+
+ thead {
+ display: table-header-group; }
+
+ /* css-discuss.incutio.com/wiki/Printing_Tables */
+ tr, img {
+ page-break-inside: avoid; }
+
+ @page {
+ margin: 0.5cm; }
+
+ p, h2, h3 {
+ orphans: 3;
+ widows: 3; }
+
+ h2, h3 {
+ page-break-after: avoid; } }
+
+/* Headings */
+h1, h2, h3, h4, h5, h6 {
+ font-weight: bold; }
+
+h1 {
+ font-size: 2.2em;
+ line-height: 1;
+ margin-bottom: 0.25em; }
+
+h2 {
+ font-size: 1.6em;
+ line-height: 1.1;
+ margin-bottom: 0.25em; }
+
+h3 {
+ font-size: 1.3em;
+ line-height: 1;
+ margin-bottom: 0.25em; }
+
+h4 {
+ font-size: 1.1em;
+ line-height: 1.25;
+ margin-bottom: 0.25em; }
+
+h5 {
+ font-size: 1em;
+ margin-bottom: 0.25em; }
+
+h6 {
+ font-size: 1em;
+ margin-bottom: 0.25em; }
+
+/* Text elements */
+p {
+ margin-bottom: 0.5em; }
+
+p.last {
+ margin-bottom: 0; }
+
+p img {
+ float: left;
+ margin: 1.5em 1.5em 1.5em 0;
+ padding: 0; }
+
+/* Use this if the image is at the top of the <p>. */
+p img.top {
+ margin-top: 0; }
+
+img {
+ margin: 0 0 1.5em; }
+
+abbr, acronym {
+ border-bottom: 1px dotted #666;
+ cursor: help; }
+
+address {
+ font-style: italic;
+ margin-top: 1.5em; }
+
+del {
+ color: #666; }
+
+a, a:link {
+ color: #1a4882;
+ text-decoration: underline; }
+
+a:visited {
+ color: #1a4882; }
+
+a:hover {
+ color: #052246; }
+
+a:active,
+a:focus {
+ color: #1a4882; }
+
+blockquote {
+ border-left: 4px solid #d1d1d1;
+ color: #666;
+ font-style: italic;
+ margin: 1.5em 0;
+ padding-left: 1em; }
+
+strong {
+ font-weight: bold; }
+
+em,
+dfn {
+ font-style: italic; }
+
+dfn {
+ font-weight: bold; }
+
+pre, code {
+ margin: 1.5em 0;
+ white-space: pre;
+ /* CSS2 */
+ white-space: pre-wrap;
+ /* CSS 2.1 */
+ word-wrap: break-word;
+ /* IE */ }
+
+pre, code, tt {
+ font: 1em 'andale mono', 'monotype.com', 'lucida console', monospace;
+ line-height: 1.5; }
+
+pre.code {
+ background: #000;
+ color: #fff;
+ padding: 20px; }
+
+tt {
+ display: block;
+ line-height: 1.5;
+ margin: 1.5em 0; }
+
+/* Forms */
+/*removes dotted outline on submit buttons when clicking in firefox */
+input[type="submit"]::-moz-focus-inner {
+ border: none; }
+
+form ol {
+ list-style: none;
+ margin: 0 0 1em 0; }
+
+form ol ol {
+ margin-left: 0; }
+
+form ol li {
+ list-style-position: outside;
+ margin: 0 0 1em 0; }
+
+/*list-style-position fixes IE label margin bug*/
+form ol ol li {
+ list-style-position: outside;
+ margin: 0 0 .25em 0; }
+
+form ol li.error input {
+ background: #FBE3E4; }
+
+p.inline-errors {
+ color: #D12F19; }
+
+form ol li.file {
+ background: #e1e1e1;
+ border: 1px solid #c8c8c8;
+ padding: 10px; }
+
+form abbr {
+ border-bottom: 0; }
+
+label {
+ display: block; }
+
+.required label {
+ font-weight: bold; }
+
+.checkbox_field label,
+.radio_field label {
+ font-weight: normal; }
+
+a.cancel {
+ color: #7d0d0d; }
+
+.inline-hints {
+ color: #666;
+ font-size: 0.8em;
+ margin-bottom: 0.25em; }
+
+/* Fieldsets */
+fieldset {
+ background: #f1f1f1;
+ border: 1px solid #e3e3e3;
+ margin: 0 0 1.5em 0;
+ padding: 1.5em 1.5em 1em 1.5em; }
+
+fieldset fieldset,
+fieldset fieldset fieldset {
+ border: 0;
+ padding: 0; }
+
+legend {
+ font-weight: bold; }
+
+.ie6 legend, .ie7 legend {
+ margin-left: -7px; }
+
+fieldset.buttons {
+ background: inherit;
+ border: 0;
+ padding: 0; }
+
+fieldset.buttons li {
+ display: inline; }
+
+.radio fieldset {
+ margin: 0;
+ padding: 0; }
+
+/* Text fields */
+input[type="color"],
+input[type="date"],
+input[type="datetime"],
+input[type="datetime-local"],
+input[type="email"],
+input[type="month"],
+input[type="number"],
+input[type="password"],
+input[type="range"],
+input[type="search"],
+input[type="tel"],
+input[type="text"],
+input[type="time"],
+input[type="url"],
+input[type="week"] {
+ font-size: inherit;
+ padding: 3px 2px;
+ width: 300px; }
+
+.ie6 input {
+ vertical-align: text-bottom; }
+
+input[disabled='disabled'] {
+ background-color: #fcfcfc;
+ cursor: default; }
+
+input[type="checkbox"] {
+ margin: 0 3px 0 0;
+ position: relative;
+ top: -2px;
+ vertical-align: middle; }
+
+.ie7 input[type="checkbox"] {
+ vertical-align: baseline; }
+
+input[type="radio"] {
+ margin: 0 3px 0 0;
+ position: relative;
+ top: -2px;
+ vertical-align: middle; }
+
+.check_boxes label {
+ display: inline;
+ padding: 0;
+ vertical-align: middle; }
+
+.radio label {
+ padding: 0; }
+
+/* Textareas */
+textarea {
+ font-size: inherit;
+ height: 200px;
+ margin: 0 0.5em 0.5em 0;
+ padding: 5px;
+ width: 440px;
+ overflow: auto; }
+
+/* Select fields */
+fieldset .select select {
+ width: 200px;
+ font-size: 0.9em; }
+
+optgroup {
+ margin: 0 0 .5em 0; }
+
+/* Date & Time */
+form ol li.date ol li,
+form ol li.time ol li {
+ display: inline; }
+
+form ol li.datetime ol li {
+ display: inline-block; }
+
+form ol li.datetime select,
+form ol li.date select,
+form ol li.time select {
+ display: inline;
+ width: auto; }
+
+form ol li.date label,
+form ol li.time label {
+ display: none; }
+
+/* Tables */
+table {
+ margin-bottom: 2em;
+ width: 100%; }
+
+th {
+ border-bottom: 2px solid #ccc;
+ font-weight: bold;
+ text-align: left; }
+
+td {
+ border-bottom: 1px solid #ddd; }
+
+caption, th, td {
+ padding: 4px 10px 4px 0; }
+
+caption {
+ background: #f1f1f1;
+ margin-bottom: 1em;
+ padding: 10px 0; }
+
+tr, td, th {
+ vertical-align: middle; }
+
+/* Use this if you use span-x classes on th/td. */
+table .last {
+ padding-right: 0; }
+
+/* Lists */
+ul, ol {
+ list-style-position: inside;
+ margin-bottom: 1.5em; }
+
+ul {
+ list-style-type: disc; }
+
+ol {
+ list-style-type: decimal; }
+
+dl {
+ line-height: 1.4;
+ margin-bottom: 1.5em; }
+
+dl dt {
+ font-weight: bold;
+ margin-top: 0.5em; }
+
+dl dd {
+ margin-bottom: 0em; }
+
+dd {
+ margin-left: 0.5em; }
+
+li {
+ line-height: 1.4; }
+
+ol ol, ol ul, ul ul, ul ol {
+ margin-left: 1em; }
+
View
43 app/controllers/employees_controller.rb
@@ -0,0 +1,43 @@
+class EmployeesController < ApplicationController
+
+ def index
+ @employees = Employee.all
+ end
+
+ def show
+ @employee = Employee.find(params[:id])
+ end
+
+ def new
+ @employee = Employee.new
+ end
+
+ def edit
+ @employee = Employee.find(params[:id])
+ end
+
+ def create
+ @employee = Employee.new(params[:employee])
+ if @employee.save
+ redirect_to @employee, :notice => 'Employee was successfully created.'
+ else
+ render :action => 'new'
+ end
+ end
+
+ def update
+ @employee = Employee.find(params[:id])
+ if @employee.update_attributes(params[:employee])
+ redirect_to @employee, :notice => 'Employee was successfully updated.'
+ else
+ render :action => 'edit'
+ end
+ end
+
+ def destroy
+ @employee = Employee.find(params[:id])
+ redirect_to employees_url
+ end
+
+
+end
View
1 app/models/employee.rb
@@ -1,5 +1,6 @@
class Employee < ActiveRecord::Base
+ validates_presence_of :national_id_number
end
View
6 app/models/job_candidate.rb
@@ -0,0 +1,6 @@
+class JobCandidate < ActiveRecord::Base
+
+ belongs_to :employee
+
+
+end
View
4 app/models/shift.rb
@@ -0,0 +1,4 @@
+class Shift < ActiveRecord::Base
+
+
+end
View
30 app/views/employees/_form.html.erb
@@ -0,0 +1,30 @@
+
+<%= form_for(@employee) do |f| %>
+ <% if @employee.errors.any? %>
+ <div class="error">
+ <h2><%= pluralize(@employee.errors.count, "error") %> prohibited this employee from being saved:</h2>
+ <ul>
+ <% @employee.errors.full_messages.each do |msg| %>
+ <li><%= msg %></li>
+ <% end %>
+ </ul>
+ </div>
+ <% end %>
+ <ol>
+ <li>
+ <%= f.label :national_id_number, 'National ID', :class => 'required' %>
+ <%= f.text_field :national_id_number %>
+ </li>
+ <li>
+ <%= f.label :title, 'Title', :class => 'required' %>
+ <%= f.text_field :title %>
+ </li>
+ <li>
+ <%= f.label :login_id, 'Login ID', :class => 'required' %>
+ <%= f.text_field :login_id %>
+ </li>
+ </ol>
+ <fieldset class="buttons">
+ <%= f.submit %>
+ </fieldset>
+<% end %>
View
6 app/views/employees/edit.html.erb
@@ -0,0 +1,6 @@
+<h1>Editing Employee</h1>
+
+<%= render 'form' %>
+
+<%= link_to 'Show', @employee %> |
+<%= link_to 'Back', employees_path %>
View
28 app/views/employees/index.html.erb
@@ -0,0 +1,28 @@
+<h1>Listing Employees</h1>
+
+<table>
+ <tr>
+ <th>National ID</th>
+ <th>Name</th>
+ <th>Title</th>
+ <th>Login ID</th>
+ <th>Actions</th>
+ </tr>
+ <% @employees.each do |employee| %>
+ <tr>
+ <td><%= employee.national_id_number %></td>
+ <td>TODO</td>
+ <td><%= employee.title %></td>
+ <td><%= employee.login_id %></td>
+ <td>
+ <%= link_to 'Show', employee %>
+ <%= link_to 'Edit', edit_employee_path(employee) %>
+ <%= link_to 'Destroy', employee, confirm: 'Are you sure?', method: :delete %>
+ </td>
+ </tr>
+ <% end %>
+</table>
+
+<br />
+
+<%= link_to 'New Employee', new_employee_path %>
View
5 app/views/employees/new.html.erb
@@ -0,0 +1,5 @@
+<h1>New employee</h1>
+
+<%= render 'form' %>
+
+<%= link_to 'Back', employees_path %>
View
5 app/views/employees/show.html.erb
@@ -0,0 +1,5 @@
+<p id="notice"><%= notice %></p>
+
+
+<%= link_to 'Edit', edit_employee_path(@employee) %> |
+<%= link_to 'Back', employees_path %>
View
14 app/views/layouts/application.html.erb
@@ -1,14 +1,14 @@
<!DOCTYPE html>
<html>
<head>
- <title>AdventureWorks</title>
- <%= stylesheet_link_tag :all %>
- <%= javascript_include_tag :defaults %>
- <%= csrf_meta_tag %>
+ <title>AdventureWorks.Ruby</title>
+ <%= stylesheet_link_tag "application" %>
+ <%= javascript_include_tag "application" %>
+ <%= csrf_meta_tags %>
</head>
<body>
-
-<%= yield %>
-
+ <div id="scallfold_body">
+ <%= yield %>
+ </div>
</body>
</html>
View
59 config/routes.rb
@@ -1,58 +1,9 @@
AdventureWorks::Application.routes.draw do
- # The priority is based upon order of creation:
- # first created -> highest priority.
+
+ resources :employees do
+
+ end
- # Sample of regular route:
- # match 'products/:id' => 'catalog#view'
- # Keep in mind you can assign values other than :controller and :action
+ root :to => 'employees#index'
- # Sample of named route:
- # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
- # This route can be invoked with purchase_url(:id => product.id)
-
- # Sample resource route (maps HTTP verbs to controller actions automatically):
- # resources :products
-
- # Sample resource route with options:
- # resources :products do
- # member do
- # get 'short'
- # post 'toggle'
- # end
- #
- # collection do
- # get 'sold'
- # end
- # end
-
- # Sample resource route with sub-resources:
- # resources :products do
- # resources :comments, :sales
- # resource :seller
- # end
-
- # Sample resource route with more complex sub-resources
- # resources :products do
- # resources :comments
- # resources :sales do
- # get 'recent', :on => :collection
- # end
- # end
-
- # Sample resource route within a namespace:
- # namespace :admin do
- # # Directs /admin/products/* to Admin::ProductsController
- # # (app/controllers/admin/products_controller.rb)
- # resources :products
- # end
-
- # You can have the root of your site routed with "root"
- # just remember to delete public/index.html.
- # root :to => 'welcome#index'
-
- # See how all your routes lay out with "rake routes"
-
- # This is a legacy wild controller route that's not recommended for RESTful applications.
- # Note: This route will make all actions in every controller accessible via GET requests.
- # match ':controller(/:action(/:id(.:format)))'
end
View
6 db/migrate/20110215024229_create_views.rb
@@ -8,6 +8,8 @@ def self.up
create_view :employees_addresses
create_view :employee_department_histories
create_view :employee_pay_histories
+ create_view :job_candidates
+ create_view :shifts
end
def self.down
@@ -16,6 +18,8 @@ def self.down
drop_view :employees_addresses
drop_view :employee_department_histories
drop_view :employee_pay_histories
+ drop_view :job_candidates
+ drop_view :shifts
end
@@ -28,7 +32,7 @@ def self.create_view(name)
end
def self.drop_view(name)
- execute "IF EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[HumanResources].[#{name}]'))
+ execute "IF EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[HumanResources].[#{name}]'))
DROP VIEW [HumanResources].[#{name}]"
end
View
9 db/views/job_candidates.sql
@@ -0,0 +1,9 @@
+
+CREATE VIEW [HumanResources].[job_candidates]
+AS
+SELECT
+jc.[JobCandidateID] AS [id],
+jc.[EmployeeID] AS [employee_id],
+jc.[Resume] AS [resume],
+jc.[ModifiedDate] AS [updated_at]
+FROM [HumanResources].[JobCandidate] jc;
View
10 db/views/shifts.sql
@@ -0,0 +1,10 @@
+
+CREATE VIEW [HumanResources].[shifts]
+AS
+SELECT
+s.[ShiftID] AS [id],
+s.[Name] AS [name],
+s.[StartTime] AS [start_at],
+s.[EndTime] AS [end_at],
+s.[ModifiedDate] AS [updated_at]
+FROM [HumanResources].[Shift] s;
View
241 public/index.html
@@ -1,241 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Ruby on Rails: Welcome aboard</title>
- <style type="text/css" media="screen">
- body {
- margin: 0;
- margin-bottom: 25px;
- padding: 0;
- background-color: #f0f0f0;
- font-family: "Lucida Grande", "Bitstream Vera Sans", "Verdana";
- font-size: 13px;
- color: #333;
- }
-
- h1 {
- font-size: 28px;
- color: #000;
- }
-
- a {color: #03c}
- a:hover {
- background-color: #03c;
- color: white;
- text-decoration: none;
- }
-
-
- #page {
- background-color: #f0f0f0;
- width: 750px;
- margin: 0;
- margin-left: auto;
- margin-right: auto;
- }
-
- #content {
- float: left;
- background-color: white;
- border: 3px solid #aaa;
- border-top: none;
- padding: 25px;
- width: 500px;
- }
-
- #sidebar {
- float: right;
- width: 175px;
- }
-
- #footer {
- clear: both;
- }
-
- #header, #about, #getting-started {
- padding-left: 75px;
- padding-right: 30px;
- }
-
-
- #header {
- background-image: url("/assets/rails.png");
- background-repeat: no-repeat;
- background-position: top left;
- height: 64px;
- }
- #header h1, #header h2 {margin: 0}
- #header h2 {
- color: #888;
- font-weight: normal;
- font-size: 16px;
- }
-
-
- #about h3 {
- margin: 0;
- margin-bottom: 10px;
- font-size: 14px;
- }
-
- #about-content {
- background-color: #ffd;
- border: 1px solid #fc0;
- margin-left: -55px;
- margin-right: -10px;
- }
- #about-content table {
- margin-top: 10px;
- margin-bottom: 10px;
- font-size: 11px;
- border-collapse: collapse;
- }
- #about-content td {
- padding: 10px;
- padding-top: 3px;
- padding-bottom: 3px;
- }
- #about-content td.name {color: #555}
- #about-content td.value {color: #000}
-
- #about-content ul {
- padding: 0;
- list-style-type: none;
- }
-
- #about-content.failure {
- background-color: #fcc;
- border: 1px solid #f00;
- }
- #about-content.failure p {
- margin: 0;
- padding: 10px;
- }
-
-
- #getting-started {
- border-top: 1px solid #ccc;
- margin-top: 25px;
- padding-top: 15px;
- }
- #getting-started h1 {
- margin: 0;
- font-size: 20px;
- }
- #getting-started h2 {
- margin: 0;
- font-size: 14px;
- font-weight: normal;
- color: #333;
- margin-bottom: 25px;
- }
- #getting-started ol {
- margin-left: 0;
- padding-left: 0;
- }
- #getting-started li {
- font-size: 18px;
- color: #888;
- margin-bottom: 25px;
- }
- #getting-started li h2 {
- margin: 0;
- font-weight: normal;
- font-size: 18px;
- color: #333;
- }
- #getting-started li p {
- color: #555;
- font-size: 13px;
- }
-
-
- #sidebar ul {
- margin-left: 0;
- padding-left: 0;
- }
- #sidebar ul h3 {
- margin-top: 25px;
- font-size: 16px;
- padding-bottom: 10px;
- border-bottom: 1px solid #ccc;
- }
- #sidebar li {
- list-style-type: none;
- }
- #sidebar ul.links li {
- margin-bottom: 5px;
- }
-
- .filename {
- font-style: italic;
- }
- </style>
- <script type="text/javascript">
- function about() {
- info = document.getElementById('about-content');
- if (window.XMLHttpRequest)
- { xhr = new XMLHttpRequest(); }
- else
- { xhr = new ActiveXObject("Microsoft.XMLHTTP"); }
- xhr.open("GET","rails/info/properties",false);
- xhr.send("");
- info.innerHTML = xhr.responseText;
- info.style.display = 'block'
- }
- </script>
- </head>
- <body>
- <div id="page">
- <div id="sidebar">
- <ul id="sidebar-items">
- <li>
- <h3>Browse the documentation</h3>
- <ul class="links">
- <li><a href="http://guides.rubyonrails.org/">Rails Guides</a></li>
- <li><a href="http://api.rubyonrails.org/">Rails API</a></li>
- <li><a href="http://www.ruby-doc.org/core/">Ruby core</a></li>
- <li><a href="http://www.ruby-doc.org/stdlib/">Ruby standard library</a></li>
- </ul>
- </li>
- </ul>
- </div>
-
- <div id="content">
- <div id="header">
- <h1>Welcome aboard</h1>
- <h2>You&rsquo;re riding Ruby on Rails!</h2>
- </div>
-
- <div id="about">
- <h3><a href="rails/info/properties" onclick="about(); return false">About your application&rsquo;s environment</a></h3>
- <div id="about-content" style="display: none"></div>
- </div>
-
- <div id="getting-started">
- <h1>Getting started</h1>
- <h2>Here&rsquo;s how to get rolling:</h2>
-
- <ol>
- <li>
- <h2>Use <code>rails generate</code> to create your models and controllers</h2>
- <p>To see all available options, run it without parameters.</p>
- </li>
-
- <li>
- <h2>Set up a default route and remove <span class="filename">public/index.html</span></h2>
- <p>Routes are set up in <span class="filename">config/routes.rb</span>.</p>
- </li>
-
- <li>
- <h2>Create your database</h2>
- <p>Run <code>rake db:create</code> to create your database. If you're not using SQLite (the default), edit <span class="filename">config/database.yml</span> with your username and password.</p>
- </li>
- </ol>
- </div>
- </div>
-
- <div id="footer">&nbsp;</div>
- </div>
- </body>
-</html>
View
11 test/fixtures/employees.yml
@@ -1,11 +0,0 @@
-# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
-
-# This model initially had no columns defined. If you add columns to the
-# model remove the '{}' from the fixture names and add the columns immediately
-# below each fixture, per the syntax in the comments below
-#
-one: {}
-# column: value
-#
-two: {}
-# column: value
View
5 test/functional/employees_controller_test.rb
@@ -0,0 +1,5 @@
+require 'test_helper'
+
+class EmployeesControllerTest < ActionController::TestCase
+
+end

0 comments on commit cccca16

Please sign in to comment.
Something went wrong with that request. Please try again.