<% Grouping.valid_types.each do |grouping_type| %>
<%= link_to "#{humanized_type grouping_type} Groups", :type => grouping_type %>
@@ -26,9 +26,9 @@
-<%= new_link("#{humanized_type(@type).downcase} group", {:action => 'new', :type => @type}) %>
\ No newline at end of file
+<%= link_to_new("#{humanized_type(@type).downcase} group", {:action => 'new', :type => @type}) %>
diff --git a/app/views/groupings/show.html.erb b/app/views/groupings/show.html.erb
index 1cd0161..3363034 100644
--- a/app/views/groupings/show.html.erb
+++ b/app/views/groupings/show.html.erb
@@ -17,7 +17,7 @@
@@ -31,4 +31,4 @@
-<%= edit_link({:action => 'edit', :type => @type}) %>
\ No newline at end of file
+<%= link_to_edit({:action => 'edit', :type => @type}) %>
diff --git a/app/views/ingredients/edit.html.erb b/app/views/ingredients/edit.html.erb
index 6412040..88373d7 100644
--- a/app/views/ingredients/edit.html.erb
+++ b/app/views/ingredients/edit.html.erb
@@ -2,4 +2,4 @@
<%= render :partial => 'form' %>
-<%= show_link @ingredient %>
+<%= link_to_show @ingredient %>
diff --git a/app/views/ingredients/index.html.erb b/app/views/ingredients/index.html.erb
index 26c0269..4a11cb4 100644
--- a/app/views/ingredients/index.html.erb
+++ b/app/views/ingredients/index.html.erb
@@ -9,13 +9,13 @@
<% @ingredients.each do |ingredient| %>
<%= ingredient.name %>
- <%= show_link ingredient %>
- <%= edit_link edit_ingredient_path(ingredient) %>
- <%= destroy_link ingredient %>
+ <%= link_to_show ingredient %>
+ <%= link_to_edit edit_ingredient_path(ingredient) %>
+ <%= link_to_destroy ingredient %>
<% end %>
-<%= new_link 'ingredient', new_ingredient_path %>
+<%= link_to_new 'ingredient', new_ingredient_path %>
diff --git a/app/views/ingredients/show.html.erb b/app/views/ingredients/show.html.erb
index 3608670..bfd2496 100644
--- a/app/views/ingredients/show.html.erb
+++ b/app/views/ingredients/show.html.erb
@@ -3,4 +3,4 @@
<%= @ingredient.name %>
-<%= edit_link edit_ingredient_path(@ingredient) %>
+<%= link_to_edit edit_ingredient_path(@ingredient) %>
diff --git a/app/views/lab_tests/edit.html.erb b/app/views/lab_tests/edit.html.erb
index 2123773..8bf24cc 100644
--- a/app/views/lab_tests/edit.html.erb
+++ b/app/views/lab_tests/edit.html.erb
@@ -9,4 +9,4 @@
<% end %>
-<%= show_link test_subject_lab_test_path(@test_subject, @lab_test) %>
\ No newline at end of file
+<%= link_to_show test_subject_lab_test_path(@test_subject, @lab_test) %>
diff --git a/app/views/lab_tests/index.html.erb b/app/views/lab_tests/index.html.erb
index cc787c9..7094c08 100644
--- a/app/views/lab_tests/index.html.erb
+++ b/app/views/lab_tests/index.html.erb
@@ -22,12 +22,12 @@
<% end %>
<%= lab_test.collected_at %>
- <%= show_link test_subject_lab_test_path(@test_subject, lab_test) %>
- <%= edit_link edit_test_subject_lab_test_path(@test_subject, lab_test) %>
- <%= destroy_link test_subject_lab_test_path(@test_subject, lab_test) %>
+ <%= link_to_show test_subject_lab_test_path(@test_subject, lab_test) %>
+ <%= link_to_edit edit_test_subject_lab_test_path(@test_subject, lab_test) %>
+ <%= link_to_destroy test_subject_lab_test_path(@test_subject, lab_test) %>
<% end %>
-<%= new_link 'lab test', new_test_subject_lab_test_path(@test_subject) %>
+<%= link_to_new 'lab test', new_test_subject_lab_test_path(@test_subject) %>
diff --git a/app/views/lab_tests/show.html.erb b/app/views/lab_tests/show.html.erb
index a61c809..0e8aa1b 100644
--- a/app/views/lab_tests/show.html.erb
+++ b/app/views/lab_tests/show.html.erb
@@ -12,7 +12,7 @@
<% for test in tests(@lab_test, true) %>
-
+
<% name = test.gsub('_', ' ').capitalize() %>
<% if not @lab_test.send("#{test}_value").nil? %>
@@ -24,4 +24,4 @@
<% end %>
-<%= edit_link edit_test_subject_lab_test_path(@test_subject, @lab_test) %>
\ No newline at end of file
+<%= link_to_edit edit_test_subject_lab_test_path(@test_subject, @lab_test) %>
diff --git a/app/views/layouts/_client_menu.html.erb b/app/views/layouts/_client_menu.html.erb
deleted file mode 100644
index 767b051..0000000
--- a/app/views/layouts/_client_menu.html.erb
+++ /dev/null
@@ -1,18 +0,0 @@
-
\ No newline at end of file
diff --git a/app/views/layouts/_flash.html.erb b/app/views/layouts/_flash.html.erb
deleted file mode 100644
index 3aefd54..0000000
--- a/app/views/layouts/_flash.html.erb
+++ /dev/null
@@ -1,6 +0,0 @@
-<% if notice.present? || alert.present? %>
-
- <% if notice.present? %>
<%= notice %>
<% end %>
- <% if alert.present? %>
<%= alert %>
<% end %>
-
-<% end -%>
\ No newline at end of file
diff --git a/app/views/layouts/lims/_messages.html.slim b/app/views/layouts/_flash.html.slim
similarity index 100%
rename from app/views/layouts/lims/_messages.html.slim
rename to app/views/layouts/_flash.html.slim
diff --git a/app/views/layouts/_public_menu.html.erb b/app/views/layouts/_public_menu.html.erb
deleted file mode 100644
index 2dc75cf..0000000
--- a/app/views/layouts/_public_menu.html.erb
+++ /dev/null
@@ -1,18 +0,0 @@
-
\ No newline at end of file
diff --git a/app/views/layouts/client.html.erb b/app/views/layouts/client.html.erb
deleted file mode 100644
index 83e1d20..0000000
--- a/app/views/layouts/client.html.erb
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
- <% title = yield(:title) %>
- <%= title.present? ? "Metaboflo: #{title}" : 'Metaboflo' %>
-
- <%= stylesheet_link_tag "application", 'clients' %>
- <%= javascript_include_tag "application" %>
-
- <%= yield :css %>
- <%= yield :javascript %>
-
-
-
- <%= csrf_meta_tag %>
-
-
-
-
-
-
- <%= render :partial => "layouts/client_menu" if client_signed_in? %>
-
-
-
-
-
- <% if content_for?(:sidebar) %>
-
- <% end -%>
-
-
-
-
- <%= render :partial => "layouts/flash" %>
- <%= yield %>
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/views/layouts/client.html.slim b/app/views/layouts/client.html.slim
new file mode 100644
index 0000000..e55cfea
--- /dev/null
+++ b/app/views/layouts/client.html.slim
@@ -0,0 +1,25 @@
+doctype html
+html
+ head
+ meta name="viewport" content="width=device-width, initial-scale=1.0"
+ meta content="text/html; charset=UTF-8" http-equiv="Content-Type"
+ == content_for(:meta_tags)
+ title = content_for?(:title) ? yield(:title) : 'Metaboflo'
+ == stylesheet_link_tag 'client', media: 'all',
+ "data-turbolinks-track" => true
+ == javascript_include_tag 'application', media: 'all',
+ "data-turbolinks-track" => true
+ == yield :css
+ == yield :javascript
+
+ == csrf_meta_tags
+
+ body[class="#{params[:controller].parameterize.dasherize}-c
+ #{params[:action].parameterize}-a"]
+ header == render 'layouts/client/navigation'
+ main role="main"
+ .row
+ #main-content
+ == render '/layouts/flash'
+ == yield
+ footer
diff --git a/app/views/layouts/client/_navigation.html.slim b/app/views/layouts/client/_navigation.html.slim
new file mode 100644
index 0000000..90d1544
--- /dev/null
+++ b/app/views/layouts/client/_navigation.html.slim
@@ -0,0 +1,4 @@
+nav.navbar.navbar-dark.navbar-fixed-top.bg-inverse
+ a.navbar-brand href=client_root_path Metaboflo
+ ul.nav.navbar-nav
+ = render 'layouts/client/navigation_links'
diff --git a/app/views/layouts/client/_navigation_links.html.slim b/app/views/layouts/client/_navigation_links.html.slim
new file mode 100644
index 0000000..8422576
--- /dev/null
+++ b/app/views/layouts/client/_navigation_links.html.slim
@@ -0,0 +1,7 @@
+li.nav-item = link_to 'Submit New Sample', new_clients_sample_manifest_path, class: 'nav-link'
+li.nav-item = link_to 'My Manifests', clients_sample_manifests_path, class: 'nav-link'
+li.nav-item = link_to 'Order Tracking', clients_samples_path, class: 'nav-link'
+li.nav-item.dropdown
+ a.nav-link.dropdown-toggle href="#" data-toggle="dropdown" Account
+ div.dropdown-menu
+ = link_to 'Logout', destroy_client_session_path, method: 'delete', class: 'dropdown-item'
diff --git a/app/views/layouts/lims.html.slim b/app/views/layouts/lims.html.slim
index 2b187ef..743d9ab 100644
--- a/app/views/layouts/lims.html.slim
+++ b/app/views/layouts/lims.html.slim
@@ -24,17 +24,16 @@ html
= content_for :sidebar do
h2 #{TestSubject.title} Summary
#subject-tree data-source="#{tree_test_subject_path(@test_subject)}"
-
.row
- if content_for?(:sidebar)
#sidebar-content
#sidebar == yield :sidebar
#main-content.with-sidebar
- == render '/layouts/lims/messages'
+ == render '/layouts/flash'
== yield
- else
#main-content.without-sidebar
- == render '/layouts/lims/messages'
+ == render '/layouts/flash'
== yield
footer
diff --git a/app/views/layouts/lims.old.erb b/app/views/layouts/lims.old.erb
deleted file mode 100644
index e6f6929..0000000
--- a/app/views/layouts/lims.old.erb
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
- <% title = yield(:title) %>
- <%= title.present? ? "Metaboflo: #{title}" : 'Metaboflo' %>
-
- <%= stylesheet_link_tag "application", 'lims' %>
- <%= javascript_include_tag "application" %>
-
- <%= yield :css %>
- <%= yield :javascript %>
-
-
-
- <%= csrf_meta_tag %>
-
-
-
-
-
-
- <%= render :partial => "layouts/lims_menu" if user_signed_in? %>
-
-
-
-
-
- <% if defined?(@test_subject) && @test_subject.present? && !@test_subject.new_record? %>
- <%= content_for :sidebar do %>
-
<%= TestSubject.title %> Summary
-
- <% end -%>
- <% end -%>
-
- <% if content_for?(:sidebar) %>
-
- <% end -%>
-
-
-
-
- <%= render :partial => "layouts/flash" %>
- <%= yield %>
-
-
-
-
-
-
diff --git a/app/views/layouts/main.html.erb b/app/views/layouts/main.html.erb
deleted file mode 100644
index 6d68335..0000000
--- a/app/views/layouts/main.html.erb
+++ /dev/null
@@ -1,209 +0,0 @@
-
-
-
-
-
- Metaboflo: <%= yield(:title) %>
-
- <%= stylesheet_link_tag 'yui', 'menu', 'application', 'tree', 'jquery-ui-1.8.13.custom' %>
- <%= yield :css %>
-
- <%= javascript_include_tag :defaults %>
- <%= javascript_include_tag 'yahoo-dom-event', 'container_core', 'menu', 'tree', 'jquery-ui-1.8.13.custom.min' %>
-
-
- <%= javascript_include_tag 'overlay_patch', 'menu_patch' %>
-
- <%= yield :javascript %>
-
-
- <%= csrf_meta_tag %>
-
-
- <% sidebar = !@test_subject.nil? && !@test_subject.new_record? %>
-
- >
-
-
-
- <% if current_user %>
-
- <% end %>
-
-
-
- <% if current_user %>
-
- Logged in as <%= current_user.to_s %> | <%= link_to 'Logout', destroy_user_session_path %>
-
- <% elsif current_client %>
-
- Logged in as <%= current_client.to_s %> | <%= link_to 'Logout', destroy_client_session_path %>
-
- <% end -%>
-
-
-
- <% if sidebar -%>
-
- <% end %>
-
-
-
-
-
-
- <% if flash[:notice] %>
<%= flash[:notice] %>
<% end %>
- <% if flash[:error] %>
<%= flash[:error] %>
<% end %>
- <% if flash[:alert] %>
<%= flash[:alert] %>
<% end %>
-
- <%= yield %>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/views/layouts/public.html.erb b/app/views/layouts/public.html.erb
deleted file mode 100644
index 8581123..0000000
--- a/app/views/layouts/public.html.erb
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
- <% title = yield(:title) %>
- <%= title.present? ? "Metaboflo: #{title}" : 'Metaboflo' %>
-
- <%= stylesheet_link_tag "application", 'clients' %>
- <%= javascript_include_tag "application" %>
-
- <%= yield :css %>
- <%= yield :javascript %>
-
-
-
- <%= csrf_meta_tag %>
-
-
-
-
-
-
- <%= render :partial => "layouts/public_menu" %>
-
-
-
-
-
-
- <%= render :partial => "layouts/flash" %>
- <%= yield %>
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/views/layouts/public.html.slim b/app/views/layouts/public.html.slim
new file mode 100644
index 0000000..4dc0469
--- /dev/null
+++ b/app/views/layouts/public.html.slim
@@ -0,0 +1,25 @@
+doctype html
+html
+ head
+ meta name="viewport" content="width=device-width, initial-scale=1.0"
+ meta content="text/html; charset=UTF-8" http-equiv="Content-Type"
+ == content_for(:meta_tags)
+ title = content_for?(:title) ? yield(:title) : 'Metaboflo'
+ == stylesheet_link_tag 'public', media: 'all',
+ "data-turbolinks-track" => true
+ == javascript_include_tag "application", media: 'all',
+ "data-turbolinks-track" => true
+ == yield :css
+ == yield :javascript
+
+ == csrf_meta_tags
+
+ body[class="#{params[:controller].parameterize.dasherize}-c
+ #{params[:action].parameterize}-a"]
+ header == render 'layouts/public/navigation'
+ main role="main"
+ .row
+ #main-content
+ == render '/layouts/flash'
+ == yield
+ footer
diff --git a/app/views/layouts/public/_navigation.html.slim b/app/views/layouts/public/_navigation.html.slim
new file mode 100644
index 0000000..b31832d
--- /dev/null
+++ b/app/views/layouts/public/_navigation.html.slim
@@ -0,0 +1,4 @@
+nav.navbar.navbar-dark.navbar-fixed-top.bg-inverse
+ a.navbar-brand href=main_app.root_path Metaboflo
+ ul.nav.navbar-nav
+ = render 'layouts/public/navigation_links'
diff --git a/app/views/layouts/public/_navigation_links.html.slim b/app/views/layouts/public/_navigation_links.html.slim
new file mode 100644
index 0000000..9154b29
--- /dev/null
+++ b/app/views/layouts/public/_navigation_links.html.slim
@@ -0,0 +1,4 @@
+li.nav-item = link_to 'About', about_path, class: 'nav-link'
+li.nav-item = link_to 'Contact', contact_path, class: 'nav-link'
+li.nav-item = link_to 'Client Login', new_client_session_path, class: 'nav-link'
+li.nav-item = link_to 'LIMS Login', new_user_session_path, class: 'nav-link'
diff --git a/app/views/meals/edit.html.erb b/app/views/meals/edit.html.erb
index 7e75a70..63f889f 100644
--- a/app/views/meals/edit.html.erb
+++ b/app/views/meals/edit.html.erb
@@ -2,4 +2,4 @@
<%= render :partial => 'form' %>
-<%= show_link test_subject_meal_path(@test_subject, @meal) %>
\ No newline at end of file
+<%= link_to_show test_subject_meal_path(@test_subject, @meal) %>
diff --git a/app/views/meals/index.html.erb b/app/views/meals/index.html.erb
index bfe5a5b..dd6bc84 100644
--- a/app/views/meals/index.html.erb
+++ b/app/views/meals/index.html.erb
@@ -16,9 +16,9 @@
<%= meal.amount %>
<%= meal.consumed_during_period %>
<%= meal.consumed_on_day %>
- <%= show_link test_subject_meal_path(@test_subject, meal) %>
- <%= edit_link edit_test_subject_meal_path(@test_subject, meal) %>
- <%= destroy_link test_subject_meal_path(@test_subject, meal) %>
+ <%= link_to_show test_subject_meal_path(@test_subject, meal) %>
+ <%= link_to_edit edit_test_subject_meal_path(@test_subject, meal) %>
+ <%= link_to_destroy test_subject_meal_path(@test_subject, meal) %>
<% end %>
@@ -26,4 +26,4 @@
-<%= new_link "meal for #{TestSubject.title} #{@test_subject.code}", new_test_subject_meal_path(@test_subject) %>
\ No newline at end of file
+<%= link_to_new "meal for #{TestSubject.title} #{@test_subject.code}", new_test_subject_meal_path(@test_subject) %>
diff --git a/app/views/meals/show.html.erb b/app/views/meals/show.html.erb
index 0451a29..14e9acf 100644
--- a/app/views/meals/show.html.erb
+++ b/app/views/meals/show.html.erb
@@ -26,4 +26,4 @@
-<%= edit_link edit_test_subject_meal_path(@test_subject, @meal) %>
\ No newline at end of file
+<%= link_to_edit edit_test_subject_meal_path(@test_subject, @meal) %>
diff --git a/app/views/medications/edit.html.erb b/app/views/medications/edit.html.erb
index 8786f36..078d0ac 100644
--- a/app/views/medications/edit.html.erb
+++ b/app/views/medications/edit.html.erb
@@ -2,4 +2,4 @@
<%= render :partial => 'form' %>
-<%= show_link test_subject_medication_path(@test_subject, @medication) %>
\ No newline at end of file
+<%= link_to_show test_subject_medication_path(@test_subject, @medication) %>
diff --git a/app/views/medications/index.html.erb b/app/views/medications/index.html.erb
index 28b4c12..da3b60b 100644
--- a/app/views/medications/index.html.erb
+++ b/app/views/medications/index.html.erb
@@ -17,13 +17,13 @@
<%= medication.stopped_on %>
<%= boolean_to_english(medication.currently_taking) %>
<%= medication.drugbank_reference %>
- <%= show_link test_subject_medication_path(@test_subject, medication) %>
- <%= edit_link edit_test_subject_medication_path(@test_subject, medication) %>
- <%= destroy_link test_subject_medication_path(@test_subject, medication) %>
+ <%= link_to_show test_subject_medication_path(@test_subject, medication) %>
+ <%= link_to_edit edit_test_subject_medication_path(@test_subject, medication) %>
+ <%= link_to_destroy test_subject_medication_path(@test_subject, medication) %>
<% end %>
-<%= new_link 'medication', new_test_subject_medication_path(@test_subject) %>
+<%= link_to_new 'medication', new_test_subject_medication_path(@test_subject) %>
diff --git a/app/views/medications/show.html.erb b/app/views/medications/show.html.erb
index aa773ea..5a1daf3 100644
--- a/app/views/medications/show.html.erb
+++ b/app/views/medications/show.html.erb
@@ -29,4 +29,4 @@
-<%= edit_link edit_test_subject_medication_path(@test_subject, @medication) %>
\ No newline at end of file
+<%= link_to_edit edit_test_subject_medication_path(@test_subject, @medication) %>
diff --git a/app/views/metabolites/edit.html.erb b/app/views/metabolites/edit.html.erb
index d265d7d..f9c2785 100644
--- a/app/views/metabolites/edit.html.erb
+++ b/app/views/metabolites/edit.html.erb
@@ -2,5 +2,5 @@
<%= render :partial => 'form' %>
-<%= show_link @metabolite %> |
-<%= link_to 'Back', :back %>
\ No newline at end of file
+<%= link_to_show @metabolite %> |
+<%= link_to 'Back', :back %>
diff --git a/app/views/metabolites/index.html.erb b/app/views/metabolites/index.html.erb
index 9d5e933..48c5752 100644
--- a/app/views/metabolites/index.html.erb
+++ b/app/views/metabolites/index.html.erb
@@ -65,4 +65,4 @@
<%= render(:partial => "shared/paginate", :locals => { :collection => @metabolites }) if params[:query].nil? %>
-<%= new_link 'metabolite', new_metabolite_path %>
\ No newline at end of file
+<%= link_to_new 'metabolite', new_metabolite_path %>
diff --git a/app/views/nutrients/edit.html.erb b/app/views/nutrients/edit.html.erb
index c03c044..5b31fbb 100644
--- a/app/views/nutrients/edit.html.erb
+++ b/app/views/nutrients/edit.html.erb
@@ -2,4 +2,4 @@
<%= render :partial => 'form' %>
-<%= show_link @nutrient %>
+<%= link_to_show @nutrient %>
diff --git a/app/views/nutrients/index.html.erb b/app/views/nutrients/index.html.erb
index 26ec9b9..bc2a12a 100644
--- a/app/views/nutrients/index.html.erb
+++ b/app/views/nutrients/index.html.erb
@@ -9,13 +9,13 @@
<% @nutrients.each do |nutrient| %>
<%= nutrient.name %>
- <%= show_link nutrient %>
- <%= edit_link edit_nutrient_path(nutrient) %>
- <%= destroy_link nutrient %>
+ <%= link_to_show nutrient %>
+ <%= link_to_edit edit_nutrient_path(nutrient) %>
+ <%= link_to_destroy nutrient %>
<% end %>
-<%= new_link 'nutrient', new_nutrient_path %>
\ No newline at end of file
+<%= link_to_new 'nutrient', new_nutrient_path %>
diff --git a/app/views/nutrients/show.html.erb b/app/views/nutrients/show.html.erb
index 5191410..a2c5881 100644
--- a/app/views/nutrients/show.html.erb
+++ b/app/views/nutrients/show.html.erb
@@ -3,4 +3,4 @@
<%= @nutrient.name %>
-<%= edit_link edit_nutrient_path(@nutrient) %>
+<%= link_to_edit edit_nutrient_path(@nutrient) %>
diff --git a/app/views/protocols/edit.html.erb b/app/views/protocols/edit.html.erb
index b8b6e0f..a800c87 100644
--- a/app/views/protocols/edit.html.erb
+++ b/app/views/protocols/edit.html.erb
@@ -2,4 +2,4 @@
<%= render :partial => 'form' %>
-<%= show_link @protocol %>
+<%= link_to_show @protocol %>
diff --git a/app/views/protocols/index.html.erb b/app/views/protocols/index.html.erb
index 0a495d0..be9631c 100644
--- a/app/views/protocols/index.html.erb
+++ b/app/views/protocols/index.html.erb
@@ -11,13 +11,13 @@
<%= protocol.name %>
<%= protocol.version %>
- <%= show_link protocol %>
- <%= edit_link edit_protocol_path(protocol) %>
- <%= destroy_link protocol %>
+ <%= link_to_show protocol %>
+ <%= link_to_edit edit_protocol_path(protocol) %>
+ <%= link_to_destroy protocol %>
<% end %>
-<%= new_link 'protocol', new_protocol_path %>
+<%= link_to_new 'protocol', new_protocol_path %>
diff --git a/app/views/protocols/show.html.erb b/app/views/protocols/show.html.erb
index 02ab4da..f7786da 100644
--- a/app/views/protocols/show.html.erb
+++ b/app/views/protocols/show.html.erb
@@ -19,4 +19,4 @@
-<%= edit_link edit_protocol_path(@protocol) %>
+<%= link_to_edit edit_protocol_path(@protocol) %>
diff --git a/app/views/samples/edit.html.erb b/app/views/samples/edit.html.erb
index a827a8d..fce846f 100644
--- a/app/views/samples/edit.html.erb
+++ b/app/views/samples/edit.html.erb
@@ -7,4 +7,4 @@
<%= render :partial => 'form', :locals => { :f => form } %>
<% end %>
-<%= show_link [@parent, @sample] %>
+<%= link_to_show [@parent, @sample] %>
diff --git a/app/views/samples/index.html.slim b/app/views/samples/index.html.slim
index ba4b4a8..336365d 100644
--- a/app/views/samples/index.html.slim
+++ b/app/views/samples/index.html.slim
@@ -51,24 +51,24 @@ h1
br
td
- if sample.aliquot?
- = show_link sample_sample_path(sample.sample, sample)
+ = link_to_show sample_sample_path(sample.sample, sample)
- else
- = show_link test_subject_sample_path(sample.test_subject, sample)
+ = link_to_show test_subject_sample_path(sample.test_subject, sample)
td
- if sample.aliquot?
- = edit_link edit_sample_sample_path(sample.sample, sample)
+ = link_to_edit edit_sample_sample_path(sample.sample, sample)
- else
- = edit_link edit_test_subject_sample_path(sample.test_subject, sample)
+ = link_to_edit edit_test_subject_sample_path(sample.test_subject, sample)
td
- if sample.aliquot?
- = destroy_link sample_sample_path(sample.sample, sample)
+ = link_to_destroy sample_sample_path(sample.sample, sample)
- else
- = destroy_link test_subject_sample_path(sample.test_subject, sample)
+ = link_to_destroy test_subject_sample_path(sample.test_subject, sample)
br
- if defined? @parent
- if @parent.kind_of?(Sample)
- = new_link "aliquot of sample #{@parent.id}", new_sample_sample_path(@parent)
+ = link_to_new "aliquot of sample #{@parent.id}", new_sample_sample_path(@parent)
- elsif @parent.kind_of?(TestSubject)
- = new_link "sample for #{TestSubject.title.downcase} #{@parent.code}",
+ = link_to_new "sample for #{TestSubject.title.downcase} #{@parent.code}",
new_test_subject_sample_path(@parent)
diff --git a/app/views/samples/show.html.slim b/app/views/samples/show.html.slim
index 0ccf8e7..a626f8c 100644
--- a/app/views/samples/show.html.slim
+++ b/app/views/samples/show.html.slim
@@ -13,8 +13,8 @@ h1 Showing #{@sample.aliquot? ? 'aliquot' : 'sample'} #{@sample.barcode} from #{
dd = link_to(@sample.root.to_s, test_subject_path(@sample.root))
.card-footer
.btn-group
- = new_link 'aliquot', new_sample_sample_path(@sample)
- = new_link 'experiment', new_sample_experiment_path(@sample)
+ = link_to_new 'aliquot', new_sample_sample_path(@sample)
+ = link_to_new 'experiment', new_sample_experiment_path(@sample)
.card
.card-header Client-related Information
@@ -81,5 +81,5 @@ h1 Showing #{@sample.aliquot? ? 'aliquot' : 'sample'} #{@sample.barcode} from #{
br
-= edit_link @sample.aliquot? ? edit_sample_sample_path(@sample.sample, @sample) : edit_test_subject_sample_path(@test_subject, @sample)
+= link_to_edit @sample.aliquot? ? edit_sample_sample_path(@sample.sample, @sample) : edit_test_subject_sample_path(@test_subject, @sample)
diff --git a/app/views/sites/edit.html.erb b/app/views/sites/edit.html.erb
index 4aac7be..1e43de9 100644
--- a/app/views/sites/edit.html.erb
+++ b/app/views/sites/edit.html.erb
@@ -2,4 +2,4 @@
<%= render :partial => 'form' %>
-<%= show_link @site %>
+<%= link_to_show @site %>
diff --git a/app/views/sites/index.html.erb b/app/views/sites/index.html.erb
index c65dc9b..1668ebb 100644
--- a/app/views/sites/index.html.erb
+++ b/app/views/sites/index.html.erb
@@ -15,13 +15,13 @@
<% else %>
0
<% end %>
- <%= show_link site %>
- <%= edit_link edit_site_path(site) %>
- <%= destroy_link site %>
+ <%= link_to_show site %>
+ <%= link_to_edit edit_site_path(site) %>
+ <%= link_to_destroy site %>
<% end %>
-<%= new_link 'site', new_site_path %>
+<%= link_to_new 'site', new_site_path %>
diff --git a/app/views/sites/show.html.erb b/app/views/sites/show.html.erb
index c739306..d73fc55 100644
--- a/app/views/sites/show.html.erb
+++ b/app/views/sites/show.html.erb
@@ -14,4 +14,4 @@
-<%= edit_link edit_site_path(@site) %>
\ No newline at end of file
+<%= link_to_edit edit_site_path(@site) %>
diff --git a/app/views/studies/edit.html.erb b/app/views/studies/edit.html.erb
index 7a64de4..4366d1b 100644
--- a/app/views/studies/edit.html.erb
+++ b/app/views/studies/edit.html.erb
@@ -9,4 +9,4 @@
<% end %>
-<%= show_link({id: @study}) %>
+<%= link_to_show({id: @study}) %>
diff --git a/app/views/studies/index.html.erb b/app/views/studies/index.html.erb
index 733cda6..001a245 100644
--- a/app/views/studies/index.html.erb
+++ b/app/views/studies/index.html.erb
@@ -17,13 +17,13 @@
<%= study.name %>
<%= truncate(study.description, :length => 50) %>
<%= study.cohorts.count %>
- <%= show_link({:action => 'show', :id => study}, 'show/analyze') %>
- <%= edit_link({:action => 'edit', :id => study}) %>
- <%= destroy_link({:action => 'destroy', :id => study}) %>
+ <%= link_to_show({:action => 'show', :id => study}, 'show/analyze') %>
+ <%= link_to_edit({:action => 'edit', :id => study}) %>
+ <%= link_to_destroy({:action => 'destroy', :id => study}) %>
<% end %>
-<%= new_link("Study", {:action => 'new'}) %>
\ No newline at end of file
+<%= link_to_new("Study", {:action => 'new'}) %>
diff --git a/app/views/studies/show.html.erb b/app/views/studies/show.html.erb
index fd1e4d7..4aff155 100644
--- a/app/views/studies/show.html.erb
+++ b/app/views/studies/show.html.erb
@@ -13,7 +13,7 @@
<%= link_to 'Run Analysis', analysis_study_path(@study), :style => "display: #{ @study.cohorts.length > 1 ? 'inline' : 'none'}", :id => 'run-analysis' %>
- <%= link_to 'Export to MetaboAnalyst', study_path(@study, :format => :metaboanalyst) %> |
+ <%= link_to 'Export to MetaboAnalyst', study_path(@study, :format => :metaboanalyst) %> |
<%= link_to 'Export to Umetrics', study_path(@study, :format => :umetrics) %>
@@ -42,4 +42,4 @@
-<%= edit_link({:action => 'edit'}) %>
\ No newline at end of file
+<%= link_to_edit({:action => 'edit'}) %>
diff --git a/app/views/task_categories/edit.html.erb b/app/views/task_categories/edit.html.erb
index 49d211a..b09b0c6 100644
--- a/app/views/task_categories/edit.html.erb
+++ b/app/views/task_categories/edit.html.erb
@@ -15,4 +15,4 @@
<% end %>
-<%= show_link @task_category %>
+<%= link_to_show @task_category %>
diff --git a/app/views/task_categories/index.html.erb b/app/views/task_categories/index.html.erb
index 8d9f375..3d2c915 100644
--- a/app/views/task_categories/index.html.erb
+++ b/app/views/task_categories/index.html.erb
@@ -10,13 +10,13 @@
<%= task_category.name %>
<%= task_category.description %>
- <%= show_link task_category %>
- <%= edit_link edit_task_category_path(task_category) %>
- <%= destroy_link task_category %>
+ <%= link_to_show task_category %>
+ <%= link_to_edit edit_task_category_path(task_category) %>
+ <%= link_to_destroy task_category %>
<% end %>
-<%= new_link 'task category', new_task_category_path %>
+<%= link_to_new 'task category', new_task_category_path %>
diff --git a/app/views/task_categories/show.html.erb b/app/views/task_categories/show.html.erb
index 49edef0..dfea834 100644
--- a/app/views/task_categories/show.html.erb
+++ b/app/views/task_categories/show.html.erb
@@ -9,4 +9,4 @@
-<%= edit_link edit_task_category_path(@task_category) %>
\ No newline at end of file
+<%= link_to_edit edit_task_category_path(@task_category) %>
diff --git a/app/views/task_priorities/edit.html.erb b/app/views/task_priorities/edit.html.erb
index b581576..41a5c33 100644
--- a/app/views/task_priorities/edit.html.erb
+++ b/app/views/task_priorities/edit.html.erb
@@ -15,4 +15,4 @@
<% end %>
-<%= show_link @task_priority %>
\ No newline at end of file
+<%= link_to_show @task_priority %>
diff --git a/app/views/task_priorities/index.html.erb b/app/views/task_priorities/index.html.erb
index 07c5cad..746ecd2 100644
--- a/app/views/task_priorities/index.html.erb
+++ b/app/views/task_priorities/index.html.erb
@@ -10,13 +10,13 @@
<%= task_priority.name %>
<%= task_priority.description %>
- <%= show_link task_priority %>
- <%= edit_link edit_task_priority_path(task_priority) %>
- <%= destroy_link task_priority %>
+ <%= link_to_show task_priority %>
+ <%= link_to_edit edit_task_priority_path(task_priority) %>
+ <%= link_to_destroy task_priority %>
<% end %>
-<%= new_link 'task priority', new_task_priority_path %>
+<%= link_to_new 'task priority', new_task_priority_path %>
diff --git a/app/views/task_priorities/show.html.erb b/app/views/task_priorities/show.html.erb
index e88a981..4a971f3 100644
--- a/app/views/task_priorities/show.html.erb
+++ b/app/views/task_priorities/show.html.erb
@@ -9,4 +9,4 @@
-<%= edit_link edit_task_priority_path(@task_priority) %>
\ No newline at end of file
+<%= link_to_edit edit_task_priority_path(@task_priority) %>
diff --git a/app/views/tasks/calendar.html.erb b/app/views/tasks/calendar.html.erb
index 54acab4..11cb7ae 100644
--- a/app/views/tasks/calendar.html.erb
+++ b/app/views/tasks/calendar.html.erb
@@ -9,15 +9,15 @@
- <%= link_to ('« ' + (@month==1 ? "#{Date::MONTHNAMES[12]} #{@year-1}" : "#{Date::MONTHNAMES[@month-1]}")).html_safe,
+ <%= link_to ('« ' + (@month==1 ? "#{Date::MONTHNAMES[12]} #{@year-1}" : "#{Date::MONTHNAMES[@month-1]}")).html_safe,
{ :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1) }, :method => :get %> |
- <%= link_to ((@month==12 ? "#{Date::MONTHNAMES[1]} #{@year+1}" : "#{Date::MONTHNAMES[@month+1]}") + ' »').html_safe,
+ <%= link_to ((@month==12 ? "#{Date::MONTHNAMES[1]} #{@year+1}" : "#{Date::MONTHNAMES[@month+1]}") + ' »').html_safe,
{ :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1) }, :method => :get %>
<%= link_to 'Today', { :month => nil, :year => nil }, :method => :get, :class => 'icon icon-home' %>
-
+
<% 7.times do |i| %><%= Date::DAYNAMES[(@calendar.first_wday+i)%7] %> <% end %>
@@ -28,16 +28,16 @@
<% while day <= @calendar.enddt %>
<%= "#{day.cweek} ".html_safe if day.cwday == @calendar.first_wday %>
- <%= day.day %>
+ <%= day.day %>
<% @calendar.events_on(day).each do |i| %>
<% if i.is_a? Task %>
<%= if day == i.start_date && day == i.due_date
image_tag('icons/arrow_bw.png')
elsif day == i.start_date
- image_tag('icons/arrow_from.png')
+ image_tag('icons/arrow_from.png')
elsif day == i.due_date
- image_tag('icons/arrow_to.png')
+ image_tag('icons/arrow_to.png')
end %>
<%= link_to i.subject, task_path(i) %>
<%= render_task_tooltip i %>
@@ -58,6 +58,6 @@
-<%= new_link 'task', new_task_path %> |
-<%= link_to 'Tasks', tasks_path %> |
+<%= link_to_new 'task', new_task_path %> |
+<%= link_to 'Tasks', tasks_path %> |
<%= link_to 'Gantt', gantt_tasks_path, :class => 'icon icon-report' %>
diff --git a/app/views/tasks/edit.html.erb b/app/views/tasks/edit.html.erb
index 1164929..fcf0957 100644
--- a/app/views/tasks/edit.html.erb
+++ b/app/views/tasks/edit.html.erb
@@ -1,5 +1,5 @@
Editing task
<%= render :partial => 'form' %>
-
-<%= show_link @task %>
\ No newline at end of file
+
+<%= link_to_show @task %>
diff --git a/app/views/tasks/gantt.html.erb b/app/views/tasks/gantt.html.erb
index f53f41e..0bcd2e8 100644
--- a/app/views/tasks/gantt.html.erb
+++ b/app/views/tasks/gantt.html.erb
@@ -26,7 +26,7 @@
<%= link_to 'Today', @gantt.params.merge(:month => nil, :year => nil), :method => :get, :class => 'icon icon-home' %>
<% end %>
-
+
<% zoom = 1
@gantt.zoom.times { zoom = zoom * 2 }
@@ -75,25 +75,25 @@
- <%
+ <%
#
# Months headers
#
month_f = @gantt.date_from
left = 0
height = (show_weeks ? header_height : header_height + g_height)
- @gantt.months.times do
+ @gantt.months.times do
width = ((month_f >> 1) - month_f) * zoom - 1
%>
<%= link_to "#{month_f.year}-#{month_f.month}", @gantt.params.merge(:year => month_f.year, :month => month_f.month), :title => "#{month_f.month} #{month_f.year}"%>
- <%
+ <%
left = left + width + 1
month_f = month_f >> 1
end %>
- <%
+ <%
#
# Weeks headers
#
@@ -109,7 +109,7 @@
width = (7 - @gantt.date_from.cwday + 1) * zoom-1
%>
- <%
+ <%
left = left + width+1
end %>
<%
@@ -119,13 +119,13 @@
<%= week_f.cweek if width >= 16 %>
- <%
+ <%
left = left + width+1
week_f = week_f+7
end
end %>
- <%
+ <%
#
# Days headers
#
@@ -133,13 +133,13 @@
left = 0
height = g_height + header_height - 1
wday = @gantt.date_from.cwday
- (@gantt.date_to - @gantt.date_from + 1).to_i.times do
+ (@gantt.date_to - @gantt.date_from + 1).to_i.times do
width = zoom - 1
%>
5 %>" class="gantt_hdr">
<%= Date::DAYNAMES[wday % 7].first %>
- <%
+ <%
left = left + width+1
wday = wday + 1
wday = 1 if wday > 7
@@ -151,7 +151,7 @@
# Tasks
#
top = headers_height + 10
- @gantt.events.each do |i|
+ @gantt.events.each do |i|
i_start_date = (i.start_date >= @gantt.date_from ? i.start_date : @gantt.date_from )
i_end_date = (i.due_before <= @gantt.date_to ? i.due_before : @gantt.date_to )
@@ -161,7 +161,7 @@
i_late_date = [i_end_date, Date.today].min if i_start_date < Date.today
- i_left = ((i_start_date - @gantt.date_from)*zoom).floor
+ i_left = ((i_start_date - @gantt.date_from)*zoom).floor
i_width = ((i_end_date - i_start_date + 1)*zoom).floor - 2 # total width of the issue (- 2 for left and right borders)
d_width = ((i_done_date - i_start_date)*zoom).floor - 2 # done width
l_width = i_late_date ? ((i_late_date - i_start_date+1)*zoom).floor - 2 : 0 # delay width
@@ -207,6 +207,6 @@
-<%= new_link 'task', new_task_path %> |
-<%= link_to 'Tasks', tasks_path %> |
+<%= link_to_new 'task', new_task_path %> |
+<%= link_to 'Tasks', tasks_path %> |
<%= link_to 'Calendar', calendar_tasks_path, :class => 'icon icon-calendar' %>
diff --git a/app/views/tasks/index.html.erb b/app/views/tasks/index.html.erb
index d3a6890..804d973 100644
--- a/app/views/tasks/index.html.erb
+++ b/app/views/tasks/index.html.erb
@@ -31,16 +31,16 @@
<%= task.due_date %>
<%= task.estimated_hours %>
<%= task.done_ratio %>
- <%= show_link task %>
- <%= edit_link edit_task_path(task) %>
- <%= destroy_link task %>
+ <%= link_to_show task %>
+ <%= link_to_edit edit_task_path(task) %>
+ <%= link_to_destroy task %>
<% end %>
-<%= new_link("task", new_task_path) %> |
+<%= link_to_new("task", new_task_path) %> |
<%= link_to 'My tasks', user_tasks_path(current_user) %> |
<%= link_to 'Gantt', gantt_tasks_path, :class => 'icon icon-report' %> |
<%= link_to 'Calendar', calendar_tasks_path, :class => 'icon icon-calendar' %>
diff --git a/app/views/tasks/show.html.erb b/app/views/tasks/show.html.erb
index da9fe47..b001157 100644
--- a/app/views/tasks/show.html.erb
+++ b/app/views/tasks/show.html.erb
@@ -49,4 +49,4 @@
-<%= edit_link edit_task_path(@task) %>
\ No newline at end of file
+<%= link_to_edit edit_task_path(@task) %>
diff --git a/app/views/test_subject_evaluations/edit.html.erb b/app/views/test_subject_evaluations/edit.html.erb
index 183c3c1..e1c6a1a 100644
--- a/app/views/test_subject_evaluations/edit.html.erb
+++ b/app/views/test_subject_evaluations/edit.html.erb
@@ -2,4 +2,4 @@
<%= render :partial => 'form' %>
-<%= show_link test_subject_test_subject_evaluation_path(@test_subject, @test_subject_evaluation) %>
\ No newline at end of file
+<%= link_to_show test_subject_test_subject_evaluation_path(@test_subject, @test_subject_evaluation) %>
diff --git a/app/views/test_subject_evaluations/index.html.erb b/app/views/test_subject_evaluations/index.html.erb
index f589da9..d16d839 100644
--- a/app/views/test_subject_evaluations/index.html.erb
+++ b/app/views/test_subject_evaluations/index.html.erb
@@ -3,18 +3,18 @@
<% for test_subject_evaluation in @test_subject_evaluations %>
- <%= h test_subject_evaluation.evaluated_on %> <%= show_link test_subject_test_subject_evaluation_path(@test_subject, test_subject_evaluation) %> | <%= edit_link edit_test_subject_test_subject_evaluation_path(@test_subject, test_subject_evaluation) %> | <%= destroy_link test_subject_test_subject_evaluation_path(@test_subject, test_subject_evaluation) %>
+ <%= h test_subject_evaluation.evaluated_on %> <%= link_to_show test_subject_test_subject_evaluation_path(@test_subject, test_subject_evaluation) %> | <%= link_to_edit edit_test_subject_test_subject_evaluation_path(@test_subject, test_subject_evaluation) %> | <%= link_to_destroy test_subject_test_subject_evaluation_path(@test_subject, test_subject_evaluation) %>
Diagnosis: <%= test_subject_evaluation.diagnosis %>
-
+
BMI: <%= BMI(test_subject_evaluation.height, test_subject_evaluation.weight) %>
-
+
Symptoms: <%= test_subject_evaluation.symptoms.join(', ') %>
-
+
<% end %>
-<%= new_link "#{TestSubject.title.downcase} evaluation", new_test_subject_test_subject_evaluation_path(@test_subject) %>
+<%= link_to_new "#{TestSubject.title.downcase} evaluation", new_test_subject_test_subject_evaluation_path(@test_subject) %>
diff --git a/app/views/test_subject_evaluations/show.html.erb b/app/views/test_subject_evaluations/show.html.erb
index 7df43fd..2ec67ff 100644
--- a/app/views/test_subject_evaluations/show.html.erb
+++ b/app/views/test_subject_evaluations/show.html.erb
@@ -176,4 +176,4 @@ TODO: Past medical history
-<%= edit_link edit_test_subject_test_subject_evaluation_path(@test_subject, @test_subject_evaluation) %>
\ No newline at end of file
+<%= link_to_edit edit_test_subject_test_subject_evaluation_path(@test_subject, @test_subject_evaluation) %>
diff --git a/app/views/test_subjects/edit.html.erb b/app/views/test_subjects/edit.html.erb
index 43986aa..5162c5d 100644
--- a/app/views/test_subjects/edit.html.erb
+++ b/app/views/test_subjects/edit.html.erb
@@ -2,4 +2,4 @@
<%= render :partial => "#{TestSubjectsController::VIEW_PATH}/form" %>
-<%= show_link @test_subject %>
\ No newline at end of file
+<%= link_to_show @test_subject %>
diff --git a/app/views/test_subjects/subjects/cow/index.html.erb b/app/views/test_subjects/subjects/cow/index.html.erb
index 29414aa..8bacabb 100644
--- a/app/views/test_subjects/subjects/cow/index.html.erb
+++ b/app/views/test_subjects/subjects/cow/index.html.erb
@@ -13,12 +13,12 @@
<%= test_subject.code %>
<%= test_subject.birthdate %>
<%= test_subject.samples.length %> (<%= link_to 'display', test_subject_samples_path(test_subject) %>)
- <%= show_link test_subject %>
- <%= edit_link edit_test_subject_path(test_subject) %>
- <%= destroy_link test_subject %>
+ <%= link_to_show test_subject %>
+ <%= link_to_edit edit_test_subject_path(test_subject) %>
+ <%= link_to_destroy test_subject %>
<% end %>
-<%= new_link TestSubject.title.downcase, new_test_subject_path %>
+<%= link_to_new TestSubject.title.downcase, new_test_subject_path %>
diff --git a/app/views/test_subjects/subjects/cow/show.html.erb b/app/views/test_subjects/subjects/cow/show.html.erb
index 8683802..36bddac 100644
--- a/app/views/test_subjects/subjects/cow/show.html.erb
+++ b/app/views/test_subjects/subjects/cow/show.html.erb
@@ -52,14 +52,14 @@
-<%= edit_link edit_test_subject_path(@test_subject) %>
+<%= link_to_edit edit_test_subject_path(@test_subject) %>
Diet Information
-
+
<% if @meals.length > 0 %>
@@ -75,18 +75,18 @@
<%= meal.amount %>
<%= meal.consumed_during_period %>
<%= meal.consumed_on_day %>
- <%= show_link test_subject_meal_path(@test_subject, meal) %>
- <%= edit_link edit_test_subject_meal_path(@test_subject, meal) %>
- <%= destroy_link test_subject_meal_path(@test_subject, meal) %>
+ <%= link_to_show test_subject_meal_path(@test_subject, meal) %>
+ <%= link_to_edit edit_test_subject_meal_path(@test_subject, meal) %>
+ <%= link_to_destroy test_subject_meal_path(@test_subject, meal) %>
<% end %>
-
+
-
- <%= new_link "meal for #{TestSubject.title.downcase} #{@test_subject.code}", new_test_subject_meal_path(@test_subject) %>
+
+ <%= link_to_new "meal for #{TestSubject.title.downcase} #{@test_subject.code}", new_test_subject_meal_path(@test_subject) %>
<% else %>
No current diet information.
<% end %>
-
+
diff --git a/app/views/test_subjects/subjects/patient/index.html.slim b/app/views/test_subjects/subjects/patient/index.html.slim
index 7de4f39..569e78d 100644
--- a/app/views/test_subjects/subjects/patient/index.html.slim
+++ b/app/views/test_subjects/subjects/patient/index.html.slim
@@ -25,9 +25,9 @@ h1= title 'Patients'
td #{patient.samples.length} (#{link_to 'display', test_subject_samples_path(patient)})
td= patient.practitioner
td= truncate(patient.notes)
- td= show_link patient
- td= edit_link edit_test_subject_path(patient)
- td= destroy_link patient
+ td= link_to_show patient
+ td= link_to_edit edit_test_subject_path(patient)
+ td= link_to_destroy patient
-= new_link 'patient', new_test_subject_path
+= link_to_new 'patient', new_test_subject_path
diff --git a/app/views/test_subjects/subjects/patient/show.html.slim b/app/views/test_subjects/subjects/patient/show.html.slim
index e784313..55de9f2 100644
--- a/app/views/test_subjects/subjects/patient/show.html.slim
+++ b/app/views/test_subjects/subjects/patient/show.html.slim
@@ -26,5 +26,5 @@
b Notes:
= @test_subject.notes
br/
- = edit_link edit_test_subject_path(@test_subject)
+ = link_to_edit edit_test_subject_path(@test_subject)
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb
index a1b39d2..fe301f4 100644
--- a/app/views/users/index.html.erb
+++ b/app/views/users/index.html.erb
@@ -29,9 +29,9 @@
-
<% end %>
<%= user.email %>
- <%= show_link user %>
- <%= edit_link edit_user_path(user) %>
- <%= destroy_link user %>
+ <%= link_to_show user %>
+ <%= link_to_edit edit_user_path(user) %>
+ <%= link_to_destroy user %>
<% end %>
@@ -39,4 +39,4 @@
-<%= new_link 'user', new_user_path %>
\ No newline at end of file
+<%= link_to_new 'user', new_user_path %>
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index 4dd901a..e954abf 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -24,4 +24,4 @@
<%= @user.email %>
-<%= edit_link edit_user_path(@user) %>
\ No newline at end of file
+<%= link_to_edit edit_user_path(@user) %>
diff --git a/app/views/workflows/patients/_show.html.erb b/app/views/workflows/patients/_show.html.erb
index e1055bf..df56df3 100644
--- a/app/views/workflows/patients/_show.html.erb
+++ b/app/views/workflows/patients/_show.html.erb
@@ -43,4 +43,4 @@
-<%= edit_link edit_test_subject_path(@test_subject) %>
+<%= link_to_edit edit_test_subject_path(@test_subject) %>
diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb
index 4f3f07a..52257d5 100644
--- a/config/initializers/assets.rb
+++ b/config/initializers/assets.rb
@@ -8,4 +8,4 @@
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
-Rails.application.config.assets.precompile += %w( clients.css lims.css )
+Rails.application.config.assets.precompile += %w( clients.css lims.css public.css )
diff --git a/config/routes.rb b/config/routes.rb
index c9b4b71..8a7e976 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -5,29 +5,20 @@
get 'contact' => 'public/pages#contact'
get 'services' => 'public/pages#services'
- ## User routes
- devise_for :users do
- get 'landing' => 'bovine#index', as: :user_root
- end
-
- resources :users do
- resources :user_pictures
- resources :tasks
- end
-
## Client routes
- devise_for :clients do
- get 'clients/home' => 'clients/home#index', as: :client_root
- end
+ devise_for :clients
namespace :clients do
- resources :samples, only: [ :index, :show ]
+ resources :samples, only: [:index, :show]
resources :sample_manifests do
- get 'print', on: :member
+ get :print, on: :member
end
- resources :home, only: [ :index ]
+ resources :home, only: [:index]
+ root 'home#index'
end
- resources :clients
+
+ ## User routes
+ devise_for :users
namespace :workflows do
resources :experiments
@@ -44,35 +35,32 @@
end
end
+ resources :clients
+
+ resources :users do
+ resources :user_pictures
+ resources :tasks
+ end
+
namespace :batches do
resources :batches, only: [:new, :create] do
- collection do
- get :unprepped
- end
+ get :unprepped, on: :collection
end
resources :preparations, only: [:new, :create] do
- collection do
- get :non_ph
- end
+ get :non_ph, on: :collection
end
resources :phs, only: [:edit, :update] do
- collection do
- get :no_experiment
- end
+ get :no_experiment, on: :collection
end
end
resources :nutrients
resources :metabolites do
- collection do
- post :search
- end
+ post :search, on: :collection
end
- ## Resources
-
# Diets/etc.
resources :nutrients
resources :ingredients
@@ -97,15 +85,11 @@
# Studies
resources :studies do
- member do
- get :analysis
- end
+ get :analysis, on: :member
end
resources :metabolites do
- collection do
- post :search
- end
+ post :search, on: :collection
end
resources :experiments do
@@ -130,26 +114,18 @@
# Sample/test subject tracking
resources :samples do
resources :samples do
- member do
- post :finish
- end
+ post :finish, on: :member
end
resources :experiments
resources :grouping_assignments
- member do
- post :finish
- end
+ post :finish, on: :member
end
resources :test_subjects do
- member do
- get :tree
- end
+ get :tree, on: :member
resources :meals
resources :samples do
- member do
- post :finish
- end
+ post :finish, on: :member
end
resources :grouping_assignments
resources :lab_tests
@@ -177,9 +153,5 @@
controller: 'groupings', defaults: { type: grouping_type }
end
- ## Named routes
- get 'admin' => 'administrators#index', as: :admin
-
- ## Route URL
- root 'public/pages#home'
+ root 'samples#index'
end