Skip to content
Browse files

Got all the titles working nicely on the site.

  • Loading branch information...
1 parent 25bb059 commit 6bbc7ed0ef39f3f1ffeca65ac3ad1c0ff99f0152 @tumes committed Apr 12, 2011
View
4 app/models/standard_amount.rb
@@ -1,5 +1,7 @@
class StandardAmount < ActiveRecord::Base
belongs_to :analytical_standard
+ attr_accessible :name, :amount, :batch, :analytical_standard_id
- validates_presence_of :name, :amount, :batch
+ validates_presence_of :name, :amount, :batch, :analytical_standard_id
+ validates_numericality_of :amount, :analytical_standard_id
end
View
2 app/views/analytical_standards/intro.html.haml
@@ -1,3 +1,5 @@
+- title "Start Standard"
+
- form_tag new_analytical_standard_path, :method => 'get' do
%p
= label_tag(:instrument, "Instrument")
View
2 app/views/analytical_standards/new.html.haml
@@ -1,3 +1,5 @@
+- title "New Standard"
+
= simple_form_for @analytical_standard do |f|
= f.hidden_field :analytical_method_id, :value => params[:method]
View
2 app/views/chromatographic_columns/edit.html.haml
@@ -1,3 +1,5 @@
+- title "Edit Column"
+
%h1 Edit column
= render :partial => 'chromatographic_columns/chromatographic_column_form'
View
2 app/views/chromatographic_columns/index.html.haml
@@ -1 +1,3 @@
+- title "Column Index"
+
= render @chromatographic_columns
View
2 app/views/chromatographic_columns/new.html.haml
@@ -1,3 +1,5 @@
+- title "New Column"
+
%h1 New column
= render :partial => 'chromatographic_columns/chromatographic_column_form'
View
2 app/views/devise/registrations/edit.html.haml
@@ -1,3 +1,5 @@
+- title "Edit user"
+
%h1
Edit #{resource_name.to_s.humanize}
= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f|
View
2 app/views/instruments/edit.html.haml
@@ -1,4 +1,4 @@
-- title "Edit instrument"
+- title "Edit Instrument"
%h1 Edit instrument #{@instrument.name}
= render :partial => 'instruments/instrument_form'
View
3 app/views/instruments/index.html.haml
@@ -1,2 +1,3 @@
-- title "Instrument index"
+- title "Instrument Index"
+
= render @instruments
View
2 app/views/instruments/new.html.haml
@@ -1,4 +1,4 @@
-- title "New instrument"
+- title "New Instrument"
%h1 New instrument
View
2 app/views/layouts/application.html.haml
@@ -2,7 +2,7 @@
%html
%head
%meta{ :name => 'viewport', :content => 'width=500'}
- %title Chromalog | #{ yield(:title) }
+ %title= content_for?(:title) ? "Chromalog | #{content_for(:title)}" : "Chromalog"
= render :partial => 'layouts/stylesheets'
= render :partial => 'layouts/javascript'
%body
View
2 app/views/maintenance_events/edit.html.haml
@@ -1,3 +1,5 @@
+- title "Edit Maintenance Event"
+
%h1 Edit maintenance event
= render :partial => 'maintenance_events/maintenance_event_form'
View
2 app/views/maintenance_events/index.html.haml
@@ -1 +1,3 @@
+- title "Maintenance Event Index"
+
= render @maintenance_events
View
2 app/views/maintenance_events/new.html.haml
@@ -1,3 +1,5 @@
+- title "New Maintenance Event"
+
%h1 Add a maintenance event
= render :partial => 'maintenance_events/maintenance_event_form'
View
2 app/views/pages/home.html.haml
@@ -1,5 +1,3 @@
-- title "Home"
-
- if anybody_signed_in?
%h1 Welcome to Chromalog
%h2
View
2 app/views/run_logs/index.html.haml
@@ -1 +1,3 @@
+- title "Run Log Index"
+
= render @run_logs
View
2 app/views/run_logs/intro.html.haml
@@ -1,3 +1,5 @@
+- title "Start Run Log"
+
- form_tag new_run_log_path, :method => 'get' do
%p
= label_tag(:instrument, "Instrument")
View
2 app/views/run_logs/new.html.haml
@@ -1,3 +1,5 @@
+- title "New Run Log"
+
%h1 Create a run log
= simple_form_for @run_log do |f|
View
4 db/migrate/20110301200135_create_run_logs.rb
@@ -5,8 +5,8 @@ def self.up
t.integer :analytical_method_id
t.integer :chromatographic_column_id
t.date :run_date
- t.float :pressure
- t.float :flow_rate
+ t.decimal :pressure, :precision => 12, :scale => 4
+ t.decimal :flow_rate, :precision => 12, :scale => 4
t.timestamps
end
View
2 db/migrate/20110301202016_create_calibration_levels.rb
@@ -2,7 +2,7 @@ class CreateCalibrationLevels < ActiveRecord::Migration
def self.up
create_table :calibration_levels do |t|
t.integer :run_log_id
- t.float :standard_conc
+ t.decimal :standard_conc, :precision => 12, :scale => 4
t.timestamps
end
View
2 db/migrate/20110301204015_create_area_counts.rb
@@ -2,7 +2,7 @@ class CreateAreaCounts < ActiveRecord::Migration
def self.up
create_table :area_counts do |t|
t.integer :calibration_level_id
- t.float :area
+ t.decimal :area, :precision => 12, :scale => 4
t.string :analyte
t.timestamps
View
2 db/migrate/20110404191717_create_analytical_standards.rb
@@ -4,7 +4,7 @@ def self.up
t.integer :analytical_method_id
t.integer :user_id
t.date :preparation_date
- t.float :volume
+ t.decimal :volume, :precision => 12, :scale => 4
t.text :notes
t.timestamps
View
2 db/migrate/20110405210850_create_standard_amounts.rb
@@ -2,7 +2,7 @@ class CreateStandardAmounts < ActiveRecord::Migration
def self.up
create_table :standard_amounts do |t|
t.string :name
- t.float :amount
+ t.decimal :amount, :precision => 12, :scale => 4
t.integer :analytical_standard_id
t.string :batch
View
12 db/schema.rb
@@ -30,23 +30,23 @@
t.integer "analytical_method_id"
t.integer "user_id"
t.date "preparation_date"
- t.float "volume"
+ t.decimal "volume", :precision => 12, :scale => 4
t.text "notes"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "area_counts", :force => true do |t|
t.integer "calibration_level_id"
- t.float "area"
+ t.decimal "area", :precision => 12, :scale => 4
t.string "analyte"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "calibration_levels", :force => true do |t|
t.integer "run_log_id"
- t.float "standard_conc"
+ t.decimal "standard_conc", :precision => 12, :scale => 4
t.datetime "created_at"
t.datetime "updated_at"
end
@@ -90,15 +90,15 @@
t.integer "analytical_method_id"
t.integer "chromatographic_column_id"
t.date "run_date"
- t.float "pressure"
- t.float "flow_rate"
+ t.decimal "pressure", :precision => 12, :scale => 4
+ t.decimal "flow_rate", :precision => 12, :scale => 4
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "standard_amounts", :force => true do |t|
t.string "name"
- t.float "amount"
+ t.decimal "amount", :precision => 12, :scale => 4
t.integer "analytical_standard_id"
t.string "batch"
t.datetime "created_at"
View
3 public/stylesheets/layout.css
@@ -442,7 +442,6 @@ input[type="text"], input[type="password"] {
border-style: solid;
border-color: black;
border-width: 2px;
- width: 98%;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
-moz-box-shadow: 2px 2px #999;
@@ -507,6 +506,8 @@ th {
width: 33%;
}
+
+
/*A container that looks like a polaroid for information snapshots. The proportions are even right(ish)!*/
.polaroid-border {
View
11 spec/models/standard_amount_spec.rb
@@ -2,7 +2,18 @@
describe StandardAmount do
it { should belong_to(:analytical_standard) }
+
+ it { should validate_presence_of(:analytical_standard_id) }
+ it { should validate_numericality_of(:analytical_standard_id) }
+ it { should allow_mass_assignment_of(:analytical_standard_id) }
+
it { should validate_presence_of(:name) }
+ it { should allow_mass_assignment_of(:name) }
+
it { should validate_presence_of(:amount) }
+ it { should validate_numericality_of(:amount) }
+ it { should allow_mass_assignment_of(:amount) }
+
it { should validate_presence_of(:batch) }
+ it { should allow_mass_assignment_of(:batch) }
end

0 comments on commit 6bbc7ed

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