diff --git a/app/controllers/ingredients_controller.rb b/app/controllers/ingredients_controller.rb new file mode 100644 index 0000000..f97a4d3 --- /dev/null +++ b/app/controllers/ingredients_controller.rb @@ -0,0 +1,11 @@ +class IngredientsController < ApplicationController + + def index + end + + def create + end + + def destroy + end +end diff --git a/app/helpers/ingredients_helper.rb b/app/helpers/ingredients_helper.rb new file mode 100644 index 0000000..dd54783 --- /dev/null +++ b/app/helpers/ingredients_helper.rb @@ -0,0 +1,2 @@ +module IngredientsHelper +end diff --git a/app/views/body_trackers/_sidebar.html.erb b/app/views/body_trackers/_sidebar.html.erb index d3c965b..9f50063 100644 --- a/app/views/body_trackers/_sidebar.html.erb +++ b/app/views/body_trackers/_sidebar.html.erb @@ -3,6 +3,11 @@
<%= link_to t(".link_defaults"), defaults_project_body_trackers_path(@project), method: :post, data: {confirm: t(".confirm_defaults")} %>
<%= l(:field_shortname) %> | +<%= l(:field_name) %> | +<%= l(:field_action) %> | +
---|---|---|
<%= u.shortname %> | +<%= u.name %> | +<%= delete_link unit_path(u), data: {} %> | +
<%= l(:label_no_data) %>
+<% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index d0efc19..41127d3 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -17,8 +17,10 @@ en: heading: 'Summary' sidebar: heading_body_trackers: 'Body trackers' + heding_diet: 'Diet' heading_common: 'Common' link_summary: 'Summary' + link_ingredients: 'Ingredients' link_quantities: 'Quantities' link_units: 'Units' link_defaults: 'Load defaults' diff --git a/config/routes.rb b/config/routes.rb index 938673d..9cfaa3e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -6,7 +6,8 @@ resources :projects do resources :body_trackers, :only => [:index] do post 'defaults', on: :collection end - resources :units, :only => [:index, :create, :destroy] + resources :ingredients, :only => [:index, :create, :destroy] resources :quantities, :only => [:index, :create, :destroy] + resources :units, :only => [:index, :create, :destroy] end end diff --git a/db/migrate/001_create_units.rb b/db/migrate/001_create_units.rb index 413357f..c07cab2 100644 --- a/db/migrate/001_create_units.rb +++ b/db/migrate/001_create_units.rb @@ -18,6 +18,7 @@ class CreateUnits < ActiveRecord::Migration end create_table :ingredients do |t| + t.references :project t.string :name t.decimal :ref_amount t.references :ref_unit diff --git a/test/functional/ingredients_controller_test.rb b/test/functional/ingredients_controller_test.rb new file mode 100644 index 0000000..abd52e2 --- /dev/null +++ b/test/functional/ingredients_controller_test.rb @@ -0,0 +1,8 @@ +require File.expand_path('../../test_helper', __FILE__) + +class IngredientsControllerTest < ActionController::TestCase + # Replace this with your real tests. + def test_truth + assert true + end +end