From 4a19bbc5b0accdd27c260597cab31edaefd8e537 Mon Sep 17 00:00:00 2001 From: "Liam F. Doran (ldoran)" Date: Tue, 5 Mar 2013 09:39:24 -0500 Subject: [PATCH] Had to remake, here's project with scaffolds modified --- .gitignore | 15 + .makeScaffolds.swp | Bin 0 -> 12288 bytes .rvmrc | 48 ++++ Gemfile | 41 +++ Gemfile.lock | 125 +++++++++ README.rdoc | 261 ++++++++++++++++++ Rakefile | 7 + app/assets/images/rails.png | Bin 0 -> 6646 bytes app/assets/javascripts/application.js | 15 + app/assets/javascripts/articles.js.coffee | 3 + app/assets/javascripts/avatars.js.coffee | 3 + app/assets/javascripts/children.js.coffee | 3 + app/assets/javascripts/exercises.js.coffee | 3 + app/assets/javascripts/features.js.coffee | 3 + app/assets/javascripts/leaderboards.js.coffee | 3 + .../monitor_child_relations.js.coffee | 3 + .../javascripts/monitor_profiles.js.coffee | 3 + app/assets/javascripts/regimen.js.coffee | 3 + app/assets/javascripts/tags.js.coffee | 3 + app/assets/javascripts/weekly_diets.js.coffee | 3 + app/assets/stylesheets/application.css | 13 + app/assets/stylesheets/articles.css.scss | 3 + app/assets/stylesheets/avatars.css.scss | 3 + app/assets/stylesheets/children.css.scss | 3 + app/assets/stylesheets/exercises.css.scss | 3 + app/assets/stylesheets/features.css.scss | 3 + app/assets/stylesheets/leaderboards.css.scss | 3 + .../monitor_child_relations.css.scss | 3 + .../stylesheets/monitor_profiles.css.scss | 3 + app/assets/stylesheets/regimen.css.scss | 3 + app/assets/stylesheets/scaffolds.css.scss | 69 +++++ app/assets/stylesheets/tags.css.scss | 3 + app/assets/stylesheets/weekly_diets.css.scss | 3 + app/controllers/application_controller.rb | 3 + app/controllers/articles_controller.rb | 83 ++++++ app/controllers/avatars_controller.rb | 83 ++++++ app/controllers/children_controller.rb | 83 ++++++ app/controllers/exercises_controller.rb | 83 ++++++ app/controllers/features_controller.rb | 83 ++++++ app/controllers/leaderboards_controller.rb | 83 ++++++ .../monitor_child_relations_controller.rb | 83 ++++++ .../monitor_profiles_controller.rb | 83 ++++++ app/controllers/regimen_controller.rb | 83 ++++++ app/controllers/tags_controller.rb | 83 ++++++ app/controllers/weekly_diets_controller.rb | 83 ++++++ app/helpers/application_helper.rb | 2 + app/helpers/articles_helper.rb | 2 + app/helpers/avatars_helper.rb | 2 + app/helpers/children_helper.rb | 2 + app/helpers/exercises_helper.rb | 2 + app/helpers/features_helper.rb | 2 + app/helpers/leaderboards_helper.rb | 2 + app/helpers/monitor_child_relations_helper.rb | 2 + app/helpers/monitor_profiles_helper.rb | 2 + app/helpers/regimen_helper.rb | 2 + app/helpers/tags_helper.rb | 2 + app/helpers/weekly_diets_helper.rb | 2 + app/mailers/.gitkeep | 0 app/models/.gitkeep | 0 app/models/article.rb | 5 + app/models/avatar.rb | 5 + app/models/child.rb | 8 + app/models/exercise.rb | 4 + app/models/feature.rb | 4 + app/models/leaderboard.rb | 4 + app/models/monitor_child_relation.rb | 5 + app/models/monitor_profile.rb | 6 + app/models/regiman.rb | 4 + app/models/tag.rb | 5 + app/models/weekly_diet.rb | 4 + app/views/articles/_form.html.erb | 29 ++ app/views/articles/edit.html.erb | 6 + app/views/articles/index.html.erb | 27 ++ app/views/articles/new.html.erb | 5 + app/views/articles/show.html.erb | 20 ++ app/views/avatars/_form.html.erb | 37 +++ app/views/avatars/edit.html.erb | 6 + app/views/avatars/index.html.erb | 31 +++ app/views/avatars/new.html.erb | 5 + app/views/avatars/show.html.erb | 30 ++ app/views/children/_form.html.erb | 49 ++++ app/views/children/edit.html.erb | 6 + app/views/children/index.html.erb | 37 +++ app/views/children/new.html.erb | 5 + app/views/children/show.html.erb | 45 +++ app/views/exercises/_form.html.erb | 25 ++ app/views/exercises/edit.html.erb | 6 + app/views/exercises/index.html.erb | 25 ++ app/views/exercises/new.html.erb | 5 + app/views/exercises/show.html.erb | 15 + app/views/features/_form.html.erb | 29 ++ app/views/features/edit.html.erb | 6 + app/views/features/index.html.erb | 27 ++ app/views/features/new.html.erb | 5 + app/views/features/show.html.erb | 20 ++ app/views/layouts/application.html.erb | 14 + app/views/leaderboards/_form.html.erb | 25 ++ app/views/leaderboards/edit.html.erb | 6 + app/views/leaderboards/index.html.erb | 25 ++ app/views/leaderboards/new.html.erb | 5 + app/views/leaderboards/show.html.erb | 15 + .../monitor_child_relations/_form.html.erb | 29 ++ .../monitor_child_relations/edit.html.erb | 6 + .../monitor_child_relations/index.html.erb | 27 ++ .../monitor_child_relations/new.html.erb | 5 + .../monitor_child_relations/show.html.erb | 20 ++ app/views/monitor_profiles/_form.html.erb | 33 +++ app/views/monitor_profiles/edit.html.erb | 6 + app/views/monitor_profiles/index.html.erb | 29 ++ app/views/monitor_profiles/new.html.erb | 5 + app/views/monitor_profiles/show.html.erb | 25 ++ app/views/regimen/_form.html.erb | 21 ++ app/views/regimen/edit.html.erb | 6 + app/views/regimen/index.html.erb | 23 ++ app/views/regimen/new.html.erb | 5 + app/views/regimen/show.html.erb | 10 + app/views/tags/_form.html.erb | 21 ++ app/views/tags/edit.html.erb | 6 + app/views/tags/index.html.erb | 23 ++ app/views/tags/new.html.erb | 5 + app/views/tags/show.html.erb | 10 + app/views/weekly_diets/_form.html.erb | 73 +++++ app/views/weekly_diets/edit.html.erb | 6 + app/views/weekly_diets/index.html.erb | 49 ++++ app/views/weekly_diets/new.html.erb | 5 + app/views/weekly_diets/show.html.erb | 75 +++++ config.ru | 4 + config/application.rb | 62 +++++ config/boot.rb | 6 + config/database.yml | 25 ++ config/environment.rb | 5 + config/environments/development.rb | 37 +++ config/environments/production.rb | 67 +++++ config/environments/test.rb | 37 +++ config/initializers/backtrace_silencers.rb | 7 + config/initializers/inflections.rb | 15 + config/initializers/mime_types.rb | 5 + config/initializers/secret_token.rb | 7 + config/initializers/session_store.rb | 8 + config/initializers/wrap_parameters.rb | 14 + config/locales/en.yml | 5 + config/routes.rb | 91 ++++++ .../20130305005752_create_weekly_diets.rb | 22 ++ db/migrate/20130305033129_create_tags.rb | 9 + db/migrate/20130305033217_create_children.rb | 16 ++ ...05033224_create_monitor_child_relations.rb | 11 + db/migrate/20130305033228_create_regimen.rb | 9 + db/migrate/20130305033232_create_exercises.rb | 10 + db/migrate/20130305033236_create_avatars.rb | 13 + db/migrate/20130305033240_create_features.rb | 11 + db/migrate/20130305033245_create_articles.rb | 11 + .../20130305033249_create_leaderboards.rb | 10 + .../20130305033355_create_monitor_profiles.rb | 12 + db/seeds.rb | 7 + doc/README_FOR_APP | 2 + lib/assets/.gitkeep | 0 lib/tasks/.gitkeep | 0 log/.gitkeep | 0 makeScaffolds | 11 + public/404.html | 26 ++ public/422.html | 26 ++ public/500.html | 25 ++ public/favicon.ico | 0 public/index.html | 241 ++++++++++++++++ public/robots.txt | 5 + script/rails | 6 + test/fixtures/.gitkeep | 0 test/fixtures/articles.yml | 11 + test/fixtures/avatars.yml | 15 + test/fixtures/children.yml | 21 ++ test/fixtures/exercises.yml | 9 + test/fixtures/features.yml | 11 + test/fixtures/leaderboards.yml | 9 + test/fixtures/monitor_child_relations.yml | 11 + test/fixtures/monitor_profiles.yml | 13 + test/fixtures/regimen.yml | 7 + test/fixtures/tags.yml | 7 + test/fixtures/weekly_diets.yml | 33 +++ test/functional/.gitkeep | 0 test/functional/articles_controller_test.rb | 49 ++++ test/functional/avatars_controller_test.rb | 49 ++++ test/functional/children_controller_test.rb | 49 ++++ test/functional/exercises_controller_test.rb | 49 ++++ test/functional/features_controller_test.rb | 49 ++++ .../leaderboards_controller_test.rb | 49 ++++ ...monitor_child_relations_controller_test.rb | 49 ++++ .../monitor_profiles_controller_test.rb | 49 ++++ test/functional/regimen_controller_test.rb | 49 ++++ test/functional/tags_controller_test.rb | 49 ++++ .../weekly_diets_controller_test.rb | 49 ++++ test/integration/.gitkeep | 0 test/performance/browsing_test.rb | 12 + test/test_helper.rb | 13 + test/unit/.gitkeep | 0 test/unit/article_test.rb | 7 + test/unit/avatar_test.rb | 7 + test/unit/child_test.rb | 7 + test/unit/exercise_test.rb | 7 + test/unit/feature_test.rb | 7 + test/unit/helpers/articles_helper_test.rb | 4 + test/unit/helpers/avatars_helper_test.rb | 4 + test/unit/helpers/children_helper_test.rb | 4 + test/unit/helpers/exercises_helper_test.rb | 4 + test/unit/helpers/features_helper_test.rb | 4 + test/unit/helpers/leaderboards_helper_test.rb | 4 + .../monitor_child_relations_helper_test.rb | 4 + .../helpers/monitor_profiles_helper_test.rb | 4 + test/unit/helpers/regimen_helper_test.rb | 4 + test/unit/helpers/tags_helper_test.rb | 4 + test/unit/helpers/weekly_diets_helper_test.rb | 4 + test/unit/leaderboard_test.rb | 7 + test/unit/monitor_child_relation_test.rb | 7 + test/unit/monitor_profile_test.rb | 7 + test/unit/regiman_test.rb | 7 + test/unit/tag_test.rb | 7 + test/unit/weekly_diet_test.rb | 7 + vendor/assets/javascripts/.gitkeep | 0 vendor/assets/stylesheets/.gitkeep | 0 vendor/plugins/.gitkeep | 0 219 files changed, 4478 insertions(+) create mode 100644 .gitignore create mode 100644 .makeScaffolds.swp create mode 100644 .rvmrc create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 README.rdoc create mode 100644 Rakefile create mode 100644 app/assets/images/rails.png create mode 100644 app/assets/javascripts/application.js create mode 100644 app/assets/javascripts/articles.js.coffee create mode 100644 app/assets/javascripts/avatars.js.coffee create mode 100644 app/assets/javascripts/children.js.coffee create mode 100644 app/assets/javascripts/exercises.js.coffee create mode 100644 app/assets/javascripts/features.js.coffee create mode 100644 app/assets/javascripts/leaderboards.js.coffee create mode 100644 app/assets/javascripts/monitor_child_relations.js.coffee create mode 100644 app/assets/javascripts/monitor_profiles.js.coffee create mode 100644 app/assets/javascripts/regimen.js.coffee create mode 100644 app/assets/javascripts/tags.js.coffee create mode 100644 app/assets/javascripts/weekly_diets.js.coffee create mode 100644 app/assets/stylesheets/application.css create mode 100644 app/assets/stylesheets/articles.css.scss create mode 100644 app/assets/stylesheets/avatars.css.scss create mode 100644 app/assets/stylesheets/children.css.scss create mode 100644 app/assets/stylesheets/exercises.css.scss create mode 100644 app/assets/stylesheets/features.css.scss create mode 100644 app/assets/stylesheets/leaderboards.css.scss create mode 100644 app/assets/stylesheets/monitor_child_relations.css.scss create mode 100644 app/assets/stylesheets/monitor_profiles.css.scss create mode 100644 app/assets/stylesheets/regimen.css.scss create mode 100644 app/assets/stylesheets/scaffolds.css.scss create mode 100644 app/assets/stylesheets/tags.css.scss create mode 100644 app/assets/stylesheets/weekly_diets.css.scss create mode 100644 app/controllers/application_controller.rb create mode 100644 app/controllers/articles_controller.rb create mode 100644 app/controllers/avatars_controller.rb create mode 100644 app/controllers/children_controller.rb create mode 100644 app/controllers/exercises_controller.rb create mode 100644 app/controllers/features_controller.rb create mode 100644 app/controllers/leaderboards_controller.rb create mode 100644 app/controllers/monitor_child_relations_controller.rb create mode 100644 app/controllers/monitor_profiles_controller.rb create mode 100644 app/controllers/regimen_controller.rb create mode 100644 app/controllers/tags_controller.rb create mode 100644 app/controllers/weekly_diets_controller.rb create mode 100644 app/helpers/application_helper.rb create mode 100644 app/helpers/articles_helper.rb create mode 100644 app/helpers/avatars_helper.rb create mode 100644 app/helpers/children_helper.rb create mode 100644 app/helpers/exercises_helper.rb create mode 100644 app/helpers/features_helper.rb create mode 100644 app/helpers/leaderboards_helper.rb create mode 100644 app/helpers/monitor_child_relations_helper.rb create mode 100644 app/helpers/monitor_profiles_helper.rb create mode 100644 app/helpers/regimen_helper.rb create mode 100644 app/helpers/tags_helper.rb create mode 100644 app/helpers/weekly_diets_helper.rb create mode 100644 app/mailers/.gitkeep create mode 100644 app/models/.gitkeep create mode 100644 app/models/article.rb create mode 100644 app/models/avatar.rb create mode 100644 app/models/child.rb create mode 100644 app/models/exercise.rb create mode 100644 app/models/feature.rb create mode 100644 app/models/leaderboard.rb create mode 100644 app/models/monitor_child_relation.rb create mode 100644 app/models/monitor_profile.rb create mode 100644 app/models/regiman.rb create mode 100644 app/models/tag.rb create mode 100644 app/models/weekly_diet.rb create mode 100644 app/views/articles/_form.html.erb create mode 100644 app/views/articles/edit.html.erb create mode 100644 app/views/articles/index.html.erb create mode 100644 app/views/articles/new.html.erb create mode 100644 app/views/articles/show.html.erb create mode 100644 app/views/avatars/_form.html.erb create mode 100644 app/views/avatars/edit.html.erb create mode 100644 app/views/avatars/index.html.erb create mode 100644 app/views/avatars/new.html.erb create mode 100644 app/views/avatars/show.html.erb create mode 100644 app/views/children/_form.html.erb create mode 100644 app/views/children/edit.html.erb create mode 100644 app/views/children/index.html.erb create mode 100644 app/views/children/new.html.erb create mode 100644 app/views/children/show.html.erb create mode 100644 app/views/exercises/_form.html.erb create mode 100644 app/views/exercises/edit.html.erb create mode 100644 app/views/exercises/index.html.erb create mode 100644 app/views/exercises/new.html.erb create mode 100644 app/views/exercises/show.html.erb create mode 100644 app/views/features/_form.html.erb create mode 100644 app/views/features/edit.html.erb create mode 100644 app/views/features/index.html.erb create mode 100644 app/views/features/new.html.erb create mode 100644 app/views/features/show.html.erb create mode 100644 app/views/layouts/application.html.erb create mode 100644 app/views/leaderboards/_form.html.erb create mode 100644 app/views/leaderboards/edit.html.erb create mode 100644 app/views/leaderboards/index.html.erb create mode 100644 app/views/leaderboards/new.html.erb create mode 100644 app/views/leaderboards/show.html.erb create mode 100644 app/views/monitor_child_relations/_form.html.erb create mode 100644 app/views/monitor_child_relations/edit.html.erb create mode 100644 app/views/monitor_child_relations/index.html.erb create mode 100644 app/views/monitor_child_relations/new.html.erb create mode 100644 app/views/monitor_child_relations/show.html.erb create mode 100644 app/views/monitor_profiles/_form.html.erb create mode 100644 app/views/monitor_profiles/edit.html.erb create mode 100644 app/views/monitor_profiles/index.html.erb create mode 100644 app/views/monitor_profiles/new.html.erb create mode 100644 app/views/monitor_profiles/show.html.erb create mode 100644 app/views/regimen/_form.html.erb create mode 100644 app/views/regimen/edit.html.erb create mode 100644 app/views/regimen/index.html.erb create mode 100644 app/views/regimen/new.html.erb create mode 100644 app/views/regimen/show.html.erb create mode 100644 app/views/tags/_form.html.erb create mode 100644 app/views/tags/edit.html.erb create mode 100644 app/views/tags/index.html.erb create mode 100644 app/views/tags/new.html.erb create mode 100644 app/views/tags/show.html.erb create mode 100644 app/views/weekly_diets/_form.html.erb create mode 100644 app/views/weekly_diets/edit.html.erb create mode 100644 app/views/weekly_diets/index.html.erb create mode 100644 app/views/weekly_diets/new.html.erb create mode 100644 app/views/weekly_diets/show.html.erb create mode 100644 config.ru create mode 100644 config/application.rb create mode 100644 config/boot.rb create mode 100644 config/database.yml create mode 100644 config/environment.rb create mode 100644 config/environments/development.rb create mode 100644 config/environments/production.rb create mode 100644 config/environments/test.rb create mode 100644 config/initializers/backtrace_silencers.rb create mode 100644 config/initializers/inflections.rb create mode 100644 config/initializers/mime_types.rb create mode 100644 config/initializers/secret_token.rb create mode 100644 config/initializers/session_store.rb create mode 100644 config/initializers/wrap_parameters.rb create mode 100644 config/locales/en.yml create mode 100644 config/routes.rb create mode 100644 db/migrate/20130305005752_create_weekly_diets.rb create mode 100644 db/migrate/20130305033129_create_tags.rb create mode 100644 db/migrate/20130305033217_create_children.rb create mode 100644 db/migrate/20130305033224_create_monitor_child_relations.rb create mode 100644 db/migrate/20130305033228_create_regimen.rb create mode 100644 db/migrate/20130305033232_create_exercises.rb create mode 100644 db/migrate/20130305033236_create_avatars.rb create mode 100644 db/migrate/20130305033240_create_features.rb create mode 100644 db/migrate/20130305033245_create_articles.rb create mode 100644 db/migrate/20130305033249_create_leaderboards.rb create mode 100644 db/migrate/20130305033355_create_monitor_profiles.rb create mode 100644 db/seeds.rb create mode 100644 doc/README_FOR_APP create mode 100644 lib/assets/.gitkeep create mode 100644 lib/tasks/.gitkeep create mode 100644 log/.gitkeep create mode 100644 makeScaffolds create mode 100644 public/404.html create mode 100644 public/422.html create mode 100644 public/500.html create mode 100644 public/favicon.ico create mode 100644 public/index.html create mode 100644 public/robots.txt create mode 100755 script/rails create mode 100644 test/fixtures/.gitkeep create mode 100644 test/fixtures/articles.yml create mode 100644 test/fixtures/avatars.yml create mode 100644 test/fixtures/children.yml create mode 100644 test/fixtures/exercises.yml create mode 100644 test/fixtures/features.yml create mode 100644 test/fixtures/leaderboards.yml create mode 100644 test/fixtures/monitor_child_relations.yml create mode 100644 test/fixtures/monitor_profiles.yml create mode 100644 test/fixtures/regimen.yml create mode 100644 test/fixtures/tags.yml create mode 100644 test/fixtures/weekly_diets.yml create mode 100644 test/functional/.gitkeep create mode 100644 test/functional/articles_controller_test.rb create mode 100644 test/functional/avatars_controller_test.rb create mode 100644 test/functional/children_controller_test.rb create mode 100644 test/functional/exercises_controller_test.rb create mode 100644 test/functional/features_controller_test.rb create mode 100644 test/functional/leaderboards_controller_test.rb create mode 100644 test/functional/monitor_child_relations_controller_test.rb create mode 100644 test/functional/monitor_profiles_controller_test.rb create mode 100644 test/functional/regimen_controller_test.rb create mode 100644 test/functional/tags_controller_test.rb create mode 100644 test/functional/weekly_diets_controller_test.rb create mode 100644 test/integration/.gitkeep create mode 100644 test/performance/browsing_test.rb create mode 100644 test/test_helper.rb create mode 100644 test/unit/.gitkeep create mode 100644 test/unit/article_test.rb create mode 100644 test/unit/avatar_test.rb create mode 100644 test/unit/child_test.rb create mode 100644 test/unit/exercise_test.rb create mode 100644 test/unit/feature_test.rb create mode 100644 test/unit/helpers/articles_helper_test.rb create mode 100644 test/unit/helpers/avatars_helper_test.rb create mode 100644 test/unit/helpers/children_helper_test.rb create mode 100644 test/unit/helpers/exercises_helper_test.rb create mode 100644 test/unit/helpers/features_helper_test.rb create mode 100644 test/unit/helpers/leaderboards_helper_test.rb create mode 100644 test/unit/helpers/monitor_child_relations_helper_test.rb create mode 100644 test/unit/helpers/monitor_profiles_helper_test.rb create mode 100644 test/unit/helpers/regimen_helper_test.rb create mode 100644 test/unit/helpers/tags_helper_test.rb create mode 100644 test/unit/helpers/weekly_diets_helper_test.rb create mode 100644 test/unit/leaderboard_test.rb create mode 100644 test/unit/monitor_child_relation_test.rb create mode 100644 test/unit/monitor_profile_test.rb create mode 100644 test/unit/regiman_test.rb create mode 100644 test/unit/tag_test.rb create mode 100644 test/unit/weekly_diet_test.rb create mode 100644 vendor/assets/javascripts/.gitkeep create mode 100644 vendor/assets/stylesheets/.gitkeep create mode 100644 vendor/plugins/.gitkeep diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..eb3489a --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +# See http://help.github.com/ignore-files/ for more about ignoring files. +# +# If you find yourself ignoring temporary files generated by your text editor +# or operating system, you probably want to add a global ignore instead: +# git config --global core.excludesfile ~/.gitignore_global + +# Ignore bundler config +/.bundle + +# Ignore the default SQLite database. +/db/*.sqlite3 + +# Ignore all logfiles and tempfiles. +/log/*.log +/tmp diff --git a/.makeScaffolds.swp b/.makeScaffolds.swp new file mode 100644 index 0000000000000000000000000000000000000000..f38a59ffba69529f89e776fec60865c202e7a76d GIT binary patch literal 12288 zcmeI&u}Z{15C-5m5v)W}uwJ#+oF1aw8z@+aoY=`GnT^A3Hes_V1o1_zd@}V(bOR?g zCsD8p|GN zyDBRuq4IaNuZ&n$PM17wf)`h)TC&i3o~Gioe^B8+X6Rz-*|2AqvC=+BX8F4kxBBUl J>|SiH=o9@OYasvt literal 0 HcmV?d00001 diff --git a/.rvmrc b/.rvmrc new file mode 100644 index 0000000..708ef8c --- /dev/null +++ b/.rvmrc @@ -0,0 +1,48 @@ +#!/usr/bin/env bash + +# This is an RVM Project .rvmrc file, used to automatically load the ruby +# development environment upon cd'ing into the directory + +# First we specify our desired [@], the @gemset name is optional, +# Only full ruby name is supported here, for short names use: +# echo "rvm use 1.9.3" > .rvmrc +environment_id="ruby-1.9.3-p374@fitkids" + +# Uncomment the following lines if you want to verify rvm version per project +# rvmrc_rvm_version="1.18.15 (stable)" # 1.10.1 seams as a safe start +# eval "$(echo ${rvm_version}.${rvmrc_rvm_version} | awk -F. '{print "[[ "$1*65536+$2*256+$3" -ge "$4*65536+$5*256+$6" ]]"}' )" || { +# echo "This .rvmrc file requires at least RVM ${rvmrc_rvm_version}, aborting loading." +# return 1 +# } + +# First we attempt to load the desired environment directly from the environment +# file. This is very fast and efficient compared to running through the entire +# CLI and selector. If you want feedback on which environment was used then +# insert the word 'use' after --create as this triggers verbose mode. +if [[ -d "${rvm_path:-$HOME/.rvm}/environments" + && -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]] +then + \. "${rvm_path:-$HOME/.rvm}/environments/$environment_id" + [[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]] && + \. "${rvm_path:-$HOME/.rvm}/hooks/after_use" || true +else + # If the environment file has not yet been created, use the RVM CLI to select. + rvm --create "$environment_id" || { + echo "Failed to create RVM environment '${environment_id}'." + return 1 + } +fi + +# If you use bundler, this might be useful to you: +# if [[ -s Gemfile ]] && { +# ! builtin command -v bundle >/dev/null || +# builtin command -v bundle | GREP_OPTIONS= \grep $rvm_path/bin/bundle >/dev/null +# } +# then +# printf "%b" "The rubygem 'bundler' is not installed. Installing it now.\n" +# gem install bundler +# fi +# if [[ -s Gemfile ]] && builtin command -v bundle >/dev/null +# then +# bundle install | GREP_OPTIONS= \grep -vE '^Using|Your bundle is complete' +# fi diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..2f12678 --- /dev/null +++ b/Gemfile @@ -0,0 +1,41 @@ +source 'https://rubygems.org' + +gem 'rails', '3.2.12' + +# Bundle edge Rails instead: +# gem 'rails', :git => 'git://github.com/rails/rails.git' + +gem 'sqlite3' + + +# Gems used only for assets and not required +# in production environments by default. +group :assets do + gem 'sass-rails', '~> 3.2.3' + gem 'coffee-rails', '~> 3.2.1' + + # See https://github.com/sstephenson/execjs#readme for more supported runtimes + # gem 'therubyracer', :platforms => :ruby + + gem 'uglifier', '>= 1.0.3' +end + +gem 'jquery-rails' + +# To use ActiveModel has_secure_password +# gem 'bcrypt-ruby', '~> 3.0.0' + +# To use Jbuilder templates for JSON +# gem 'jbuilder' + +# Use unicorn as the app server +# gem 'unicorn' + +# Deploy with Capistrano +# gem 'capistrano' + +# To use debugger +# gem 'debugger' + +gem 'thin' +gem 'therubyracer' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..dc053bf --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,125 @@ +GEM + remote: https://rubygems.org/ + specs: + actionmailer (3.2.12) + actionpack (= 3.2.12) + mail (~> 2.4.4) + actionpack (3.2.12) + activemodel (= 3.2.12) + activesupport (= 3.2.12) + builder (~> 3.0.0) + erubis (~> 2.7.0) + journey (~> 1.0.4) + rack (~> 1.4.5) + rack-cache (~> 1.2) + rack-test (~> 0.6.1) + sprockets (~> 2.2.1) + activemodel (3.2.12) + activesupport (= 3.2.12) + builder (~> 3.0.0) + activerecord (3.2.12) + activemodel (= 3.2.12) + activesupport (= 3.2.12) + arel (~> 3.0.2) + tzinfo (~> 0.3.29) + activeresource (3.2.12) + activemodel (= 3.2.12) + activesupport (= 3.2.12) + activesupport (3.2.12) + i18n (~> 0.6) + multi_json (~> 1.0) + arel (3.0.2) + builder (3.0.4) + coffee-rails (3.2.2) + coffee-script (>= 2.2.0) + railties (~> 3.2.0) + coffee-script (2.2.0) + coffee-script-source + execjs + coffee-script-source (1.5.0) + daemons (1.1.9) + erubis (2.7.0) + eventmachine (1.0.1) + execjs (1.4.0) + multi_json (~> 1.0) + hike (1.2.1) + i18n (0.6.4) + journey (1.0.4) + jquery-rails (2.2.1) + railties (>= 3.0, < 5.0) + thor (>= 0.14, < 2.0) + json (1.7.7) + libv8 (3.11.8.13) + mail (2.4.4) + i18n (>= 0.4.0) + mime-types (~> 1.16) + treetop (~> 1.4.8) + mime-types (1.21) + multi_json (1.6.1) + polyglot (0.3.3) + rack (1.4.5) + rack-cache (1.2) + rack (>= 0.4) + rack-ssl (1.3.3) + rack + rack-test (0.6.2) + rack (>= 1.0) + rails (3.2.12) + actionmailer (= 3.2.12) + actionpack (= 3.2.12) + activerecord (= 3.2.12) + activeresource (= 3.2.12) + activesupport (= 3.2.12) + bundler (~> 1.0) + railties (= 3.2.12) + railties (3.2.12) + actionpack (= 3.2.12) + activesupport (= 3.2.12) + rack-ssl (~> 1.3.2) + rake (>= 0.8.7) + rdoc (~> 3.4) + thor (>= 0.14.6, < 2.0) + rake (10.0.3) + rdoc (3.12.2) + json (~> 1.4) + ref (1.0.2) + sass (3.2.6) + sass-rails (3.2.6) + railties (~> 3.2.0) + sass (>= 3.1.10) + tilt (~> 1.3) + sprockets (2.2.2) + hike (~> 1.2) + multi_json (~> 1.0) + rack (~> 1.0) + tilt (~> 1.1, != 1.3.0) + sqlite3 (1.3.7) + therubyracer (0.11.4) + libv8 (~> 3.11.8.12) + ref + thin (1.5.0) + daemons (>= 1.0.9) + eventmachine (>= 0.12.6) + rack (>= 1.0.0) + thor (0.17.0) + tilt (1.3.4) + treetop (1.4.12) + polyglot + polyglot (>= 0.3.1) + tzinfo (0.3.35) + uglifier (1.3.0) + execjs (>= 0.3.0) + multi_json (~> 1.0, >= 1.0.2) + +PLATFORMS + ruby + +DEPENDENCIES + coffee-rails (~> 3.2.1) + jquery-rails + rails (= 3.2.12) + sass-rails (~> 3.2.3) + sqlite3 + therubyracer + thin + uglifier (>= 1.0.3) diff --git a/README.rdoc b/README.rdoc new file mode 100644 index 0000000..7c36f23 --- /dev/null +++ b/README.rdoc @@ -0,0 +1,261 @@ +== Welcome to Rails + +Rails is a web-application framework that includes everything needed to create +database-backed web applications according to the Model-View-Control pattern. + +This pattern splits the view (also called the presentation) into "dumb" +templates that are primarily responsible for inserting pre-built data in between +HTML tags. The model contains the "smart" domain objects (such as Account, +Product, Person, Post) that holds all the business logic and knows how to +persist themselves to a database. The controller handles the incoming requests +(such as Save New Account, Update Product, Show Post) by manipulating the model +and directing data to the view. + +In Rails, the model is handled by what's called an object-relational mapping +layer entitled Active Record. This layer allows you to present the data from +database rows as objects and embellish these data objects with business logic +methods. You can read more about Active Record in +link:files/vendor/rails/activerecord/README.html. + +The controller and view are handled by the Action Pack, which handles both +layers by its two parts: Action View and Action Controller. These two layers +are bundled in a single package due to their heavy interdependence. This is +unlike the relationship between the Active Record and Action Pack that is much +more separate. Each of these packages can be used independently outside of +Rails. You can read more about Action Pack in +link:files/vendor/rails/actionpack/README.html. + + +== Getting Started + +1. At the command prompt, create a new Rails application: + rails new myapp (where myapp is the application name) + +2. Change directory to myapp and start the web server: + cd myapp; rails server (run with --help for options) + +3. Go to http://localhost:3000/ and you'll see: + "Welcome aboard: You're riding Ruby on Rails!" + +4. Follow the guidelines to start developing your application. You can find +the following resources handy: + +* The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html +* Ruby on Rails Tutorial Book: http://www.railstutorial.org/ + + +== Debugging Rails + +Sometimes your application goes wrong. Fortunately there are a lot of tools that +will help you debug it and get it back on the rails. + +First area to check is the application log files. Have "tail -f" commands +running on the server.log and development.log. Rails will automatically display +debugging and runtime information to these files. Debugging info will also be +shown in the browser on requests from 127.0.0.1. + +You can also log your own messages directly into the log file from your code +using the Ruby logger class from inside your controllers. Example: + + class WeblogController < ActionController::Base + def destroy + @weblog = Weblog.find(params[:id]) + @weblog.destroy + logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!") + end + end + +The result will be a message in your log file along the lines of: + + Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1! + +More information on how to use the logger is at http://www.ruby-doc.org/core/ + +Also, Ruby documentation can be found at http://www.ruby-lang.org/. There are +several books available online as well: + +* Programming Ruby: http://www.ruby-doc.org/docs/ProgrammingRuby/ (Pickaxe) +* Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide) + +These two books will bring you up to speed on the Ruby language and also on +programming in general. + + +== Debugger + +Debugger support is available through the debugger command when you start your +Mongrel or WEBrick server with --debugger. This means that you can break out of +execution at any point in the code, investigate and change the model, and then, +resume execution! You need to install ruby-debug to run the server in debugging +mode. With gems, use sudo gem install ruby-debug. Example: + + class WeblogController < ActionController::Base + def index + @posts = Post.all + debugger + end + end + +So the controller will accept the action, run the first line, then present you +with a IRB prompt in the server window. Here you can do things like: + + >> @posts.inspect + => "[#nil, "body"=>nil, "id"=>"1"}>, + #"Rails", "body"=>"Only ten..", "id"=>"2"}>]" + >> @posts.first.title = "hello from a debugger" + => "hello from a debugger" + +...and even better, you can examine how your runtime objects actually work: + + >> f = @posts.first + => #nil, "body"=>nil, "id"=>"1"}> + >> f. + Display all 152 possibilities? (y or n) + +Finally, when you're ready to resume execution, you can enter "cont". + + +== Console + +The console is a Ruby shell, which allows you to interact with your +application's domain model. Here you'll have all parts of the application +configured, just like it is when the application is running. You can inspect +domain models, change values, and save to the database. Starting the script +without arguments will launch it in the development environment. + +To start the console, run rails console from the application +directory. + +Options: + +* Passing the -s, --sandbox argument will rollback any modifications + made to the database. +* Passing an environment name as an argument will load the corresponding + environment. Example: rails console production. + +To reload your controllers and models after launching the console run +reload! + +More information about irb can be found at: +link:http://www.rubycentral.org/pickaxe/irb.html + + +== dbconsole + +You can go to the command line of your database directly through rails +dbconsole. You would be connected to the database with the credentials +defined in database.yml. Starting the script without arguments will connect you +to the development database. Passing an argument will connect you to a different +database, like rails dbconsole production. Currently works for MySQL, +PostgreSQL and SQLite 3. + +== Description of Contents + +The default directory structure of a generated Ruby on Rails application: + + |-- app + | |-- assets + | |-- images + | |-- javascripts + | `-- stylesheets + | |-- controllers + | |-- helpers + | |-- mailers + | |-- models + | `-- views + | `-- layouts + |-- config + | |-- environments + | |-- initializers + | `-- locales + |-- db + |-- doc + |-- lib + | `-- tasks + |-- log + |-- public + |-- script + |-- test + | |-- fixtures + | |-- functional + | |-- integration + | |-- performance + | `-- unit + |-- tmp + | |-- cache + | |-- pids + | |-- sessions + | `-- sockets + `-- vendor + |-- assets + `-- stylesheets + `-- plugins + +app + Holds all the code that's specific to this particular application. + +app/assets + Contains subdirectories for images, stylesheets, and JavaScript files. + +app/controllers + Holds controllers that should be named like weblogs_controller.rb for + automated URL mapping. All controllers should descend from + ApplicationController which itself descends from ActionController::Base. + +app/models + Holds models that should be named like post.rb. Models descend from + ActiveRecord::Base by default. + +app/views + Holds the template files for the view that should be named like + weblogs/index.html.erb for the WeblogsController#index action. All views use + eRuby syntax by default. + +app/views/layouts + Holds the template files for layouts to be used with views. This models the + common header/footer method of wrapping views. In your views, define a layout + using the layout :default and create a file named default.html.erb. + Inside default.html.erb, call <% yield %> to render the view using this + layout. + +app/helpers + Holds view helpers that should be named like weblogs_helper.rb. These are + generated for you automatically when using generators for controllers. + Helpers can be used to wrap functionality for your views into methods. + +config + Configuration files for the Rails environment, the routing map, the database, + and other dependencies. + +db + Contains the database schema in schema.rb. db/migrate contains all the + sequence of Migrations for your schema. + +doc + This directory is where your application documentation will be stored when + generated using rake doc:app + +lib + Application specific libraries. Basically, any kind of custom code that + doesn't belong under controllers, models, or helpers. This directory is in + the load path. + +public + The directory available for the web server. Also contains the dispatchers and the + default HTML files. This should be set as the DOCUMENT_ROOT of your web + server. + +script + Helper scripts for automation and generation. + +test + Unit and functional tests along with fixtures. When using the rails generate + command, template test files will be generated for you and placed in this + directory. + +vendor + External libraries that the application depends on. Also includes the plugins + subdirectory. If the app has frozen rails, those gems also go here, under + vendor/rails/. This directory is in the load path. diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..019d445 --- /dev/null +++ b/Rakefile @@ -0,0 +1,7 @@ +#!/usr/bin/env rake +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require File.expand_path('../config/application', __FILE__) + +Fitkids::Application.load_tasks diff --git a/app/assets/images/rails.png b/app/assets/images/rails.png new file mode 100644 index 0000000000000000000000000000000000000000..d5edc04e65f555e3ba4dcdaad39dc352e75b575e GIT binary patch literal 6646 zcmVpVcQya!6@Dsmj@#jv7C*qh zIhOJ6_K0n?*d`*T7TDuW-}m`9Kz3~>+7`DUkbAraU%yi+R{N~~XA2B%zt-4=tLimUer9!2M~N{G5bftFij_O&)a zsHnOppFIzebQ`RA0$!yUM-lg#*o@_O2wf422iLnM6cU(ktYU8#;*G!QGhIy9+ZfzKjLuZo%@a z-i@9A`X%J{^;2q&ZHY3C(B%gqCPW!8{9C0PMcNZccefK){s|V5-xxtHQc@uf>XqhD z7#N^siWqetgq29aX>G^olMf=bbRF6@Y(}zYxw6o!9WBdG1unP}<(V;zKlcR2p86fq zYjaqB^;Ycq>Wy@5T1xOzG3tucG3e%nPvajaN{CrFbnzv^9&K3$NrDm*eQe4`BGQ2bI;dFEwyt>hK%X!L6)82aOZp zsrGcJ#7PoX7)s|~t6is?FfX*7vWdREi58tiY4S)t6u*|kv?J)d_$r+CH#eZ?Ef+I_ z(eVlX8dh~4QP?o*E`_MgaNFIKj*rtN(0Raj3ECjSXcWfd#27NYs&~?t`QZFT}!Zaf=ldZIhi}LhQlqLo+o5(Pvui&{7PD__^53f9j>HW`Q z_V8X5j~$|GP9qXu0C#!@RX2}lXD35@3N5{BkUi%jtaPQ*H6OX2zIz4QPuqmTv3`vG{zc>l3t0B9E75h< z8&twGh%dp7WPNI+tRl%#gf2}Epg8st+~O4GjtwJsXfN;EjAmyr6z5dnaFU(;IV~QK zW62fogF~zA``(Q>_SmD!izc6Y4zq*97|NAPHp1j5X7Op2%;GLYm>^HEMyObo6s7l) zE3n|aOHi5~B84!}b^b*-aL2E)>OEJX_tJ~t<#VJ?bT?lDwyDB&5SZ$_1aUhmAY}#* zs@V1I+c5md9%R-o#_DUfqVtRk>59{+Opd5Yu%dAU#VQW}^m}x-30ftBx#527{^pI4 z6l2C6C7QBG$~NLYb3rVdLD#Z{+SleOp`(Lg5J}`kxdTHe(nV5BdpLrD=l|)e$gEqA zwI6vuX-PFCtcDIH>bGY2dwq&^tf+&R?)nY-@7_j%4CMRAF}C9w%p86W<2!aSY$p+k zrkFtG=cGo38RnrG28;?PNk%7a@faaXq&MS*&?1Z`7Ojw7(#>}ZG4nMAs3VXxfdW>i zY4VX02c5;f7jDPY_7@Oa)CHH}cH<3y#}_!nng^W+h1e-RL*YFYOteC@h?BtJZ+?sE zy)P5^8Mregx{nQaw1NY-|3>{Z)|0`?zc?G2-acYiSU`tj#sSGfm7k86ZQ0SQgPevcklHxM9<~4yW zR796sisf1|!#{Z=e^)0;_8iUhL8g(;j$l=02FTPZ(dZV@s#aQ`DHkLM6=YsbE4iQ!b#*374l0Jw5;jD%J;vQayq=nD8-kHI~f9Ux|32SJUM`> zGp2UGK*4t?cRKi!2he`zI#j0f${I#f-jeT?u_C7S4WsA0)ryi-1L0(@%pa^&g5x=e z=KW9+Nn(=)1T&S8g_ug%dgk*~l2O-$r9#zEGBdQsweO%t*6F4c8JC36JtTizCyy+E4h%G(+ z5>y$%0txMuQ$e~wjFgN(xrAndHQo`Za+K*?gUVDTBV&Ap^}|{w#CIq{DRe}+l@(Ec zCCV6f_?dY_{+f{}6XGn!pL_up?}@>KijT^$w#Lb6iHW&^8RP~g6y=vZBXx~B9nI^i zGexaPjcd(%)zGw!DG_dDwh-7x6+ST#R^${iz_M$uM!da8SxgB_;Z0G%Y*HpvLjKw; zX=ir7i1O$-T|*TBoH$dlW+TLf5j5sep^DlDtkox;Kg{Q%EXWedJq@J@%VAcK)j3y1 zShM!CS#qax;D@RND%2t3W6kv+#Ky0F9<3YKDbV^XJ=^$s(Vtza8V72YY)577nnldI zHMA0PUo!F3j(ubV*CM@PiK<^|RM2(DuCbG7`W}Rg(xdYC>C~ z;1KJGLN&$cRxSZunjXcntykmpFJ7;dk>shY(DdK&3K_JDJ6R%D`e~6Qv67@Rwu+q9 z*|NG{r}4F8f{Dfzt0+cZMd$fvlX3Q`dzM46@r?ISxr;9gBTG2rmfiGOD*#c*3f)cc zF+PFZobY$-^}J8 z%n=h4;x2}cP!@SiVd!v;^Wwo0(N??-ygDr7gG^NKxDjSo{5T{?$|Qo5;8V!~D6O;F*I zuY!gd@+2j_8Rn=UWDa#*4E2auWoGYDddMW7t0=yuC(xLWky?vLimM~!$3fgu!dR>p z?L?!8z>6v$|MsLb&dU?ob)Zd!B)!a*Z2eTE7 zKCzP&e}XO>CT%=o(v+WUY`Az*`9inbTG& z_9_*oQKw;sc8{ipoBC`S4Tb7a%tUE)1fE+~ib$;|(`|4QbXc2>VzFi%1nX%ti;^s3~NIL0R}!!a{0A zyCRp0F7Y&vcP&3`&Dzv5!&#h}F2R-h&QhIfq*ts&qO13{_CP}1*sLz!hI9VoTSzTu zok5pV0+~jrGymE~{TgbS#nN5+*rF7ij)cnSLQw0Ltc70zmk|O!O(kM<3zw-sUvkx~ z2`y+{xAwKSa-0}n7{$I@Zop7CWy%_xIeN1e-7&OjQ6vZZPbZ^3_ z(~=;ZSP98S2oB#35b1~_x`2gWiPdIVddEf`AD9<@c_s)TM;3J$T_l?pr{<7PTgdiy zBc5IGx)g~n=s+Z$RzYCmv8PlJu%gkh^;%mTGMc)UwRINVD~K;`Rl!5@hhGg;y>5qj zq|u-Yf0q_~Y+Mbivkkfa0nAOzB1acnytogsj_m7FB(-FjihMek#GAU4M!iXCgdK8a zjoKm?*|iz7;dHm4$^hh(`Ufl>yb>$hjIA-;>{>C}G0Di%bGvUsJkfLAV|xq32c>RqJqTBJ3Dx zYC;*Dt|S$b6)aCJFnK(Eey$M1DpVV~_MIhwK> zygo(jWC|_IRw|456`roEyXtkNLWNAt-4N1qyN$I@DvBzt;e|?g<*HK1%~cq|^u*}C zmMrwh>{QAq?Ar~4l^DqT%SQ)w)FA(#7#u+N;>E975rYML>)LgE`2<7nN=C1pC{IkV zVw}_&v6j&S?QVh*)wF3#XmE@0($^BVl1969csLKUBNer{suVd!a~B!0MxWY?=(GD6 zy$G&ERFR#i6G4=2F?R4}Mz3B?3tnpoX3)qFF2sh9-Jn*e%9F>i{WG7$_~XyOO2!+@ z6k+38KyD@-0=uee54D0!Z1@B^ilj~StchdOn(*qvg~s5QJpWGc!6U^Aj!xt-HZn_V zS%|fyQ5YS@EP2lBIodXCLjG_+a)%En+7jzngk@J>6D~^xbxKkvf-R0-c%mX+o{?&j zZZ%RxFeav8Y0gkwtdtrwUb-i0Egd2C=ADu%w5VV-hNJvl)GZ?M;y$!?b=S+wKRK7Q zcOjPT!p<*#8m;TsBih=@Xc&c)?Vy`Ys>IvK@|1%N+M6J-^RCRaZcPP2eQh9DEGZr+ z?8B~wF14mk4Xkuen{wY^CWwS1PI<8gikY*)3?RSo5l8es4*J z43k_BIwc}of=6Pfs%xIxlMDGOJN zvl!a>G)52XMqA%fbgkZi%)%bN*ZzZw2!rn4@+J)2eK#kWuEW{)W~-`y1vhA5-7p%R z&f5N!a9f8cK1Xa=O}=9{wg%}Ur^+8Y(!UCeqw>%wj@|bYHD-bZO~mk3L$9_^MmF3G zvCiK^e@q6G?tHkM8%GqsBMZaB20W$UEt_5r~jc#WlR>Bv{6W>A=!#InoY zLOd04@Rz?*7PpW8u|+}bt`?+Z(GsX{Br4A2$ZZ(26Degmr9`O=t2KgHTL*==R3xcP z&Y(J7hC@6_x8zVz!CX3l4Xtss6i7r#E6kXMNN1~>9KTRzewfp))ij%)SBBl0fZdYP zd!zzQD5u8yk-u|41|Rqz7_tCFUMThZJVj)yQf6^Cwtn|Ew6cm5J|u1Bq>MWX-AfB&NE;C z62@=-0le`E6-CurMKjoIy)BuUmhMGJb}pPx!@GLWMT+wH2R?wA=MEy)o57~feFp8P zY@YXAyt4<1FD<|iw{FGQu~GEI<4C64)V*QiVk+VzOV^9GWf4ir#oYgHJz!wq>iZV#_6@_{)&lum)4x z_Of*CLVQ7wdT#XT-(h0qH%mcIF7yzMIvvTN3bPceK>PpJi(=3Nny zbSn}p$dGKQUlX&-t~RR)#F7I<8NCD^yke(vdf#4^aAh}M-{tS9-&^tC4`KU_pToXy z+|K8sx}a)Kh{h{;*V1#hs1xB%(?j>)g~`Wv(9F)f=Qn)(daVB7hZtcp^#LrEr1T1J zZSJ*lVyVVjhy)mkex9Whn=EinKDHe@KlfQI-Fl7M?-c~HnW0;C;+MbUY8?FToy;A+ zs&Nc7VZ=Of+e!G6s#+S5WBU)kgQq_I1@!uH74GJ-+O|%0HXm9Mqlvp|j%0`T>fr9^ zK;qo>XdwZW<>%tTA+<(1^6(>=-2N;hRgBnjvEjN;VbKMbFg--WrGy|XESoH1p|M4` z86(gC^vB4qScASZ&cdpT{~QDN-jC|GJ(RYoW1VW4!SSn- zhQds9&RBKn6M&GVK_Aayt(Hekbnw=tr>f z^o@v9_*iQO1*zeOrts9Q-$pc@!StS&kz$cF`s@pM`rmJXTP&h5G)A74!0e%ZJbl}( zssI|_!%~_hZFypv*S^JE5N&Kvmx7KiG<|fGMO=WrH+@Yhuj+KwiS#l4>@%2nl zS)mDikfmokO4q2A)hRVZBq2-5q&XC>%HOLkOYxZ66(s86?=0s4z5xbiOV)}L-&6b)h6(~CIaR#JNw~46+WBiU7IhB zq!NuR4!TsYnyBg>@G=Ib*cMq^k<}AMpCeYEf&dzfiGI-wOQ7hb+nA zkN7_){y&c3xC0 AQ~&?~ literal 0 HcmV?d00001 diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js new file mode 100644 index 0000000..9097d83 --- /dev/null +++ b/app/assets/javascripts/application.js @@ -0,0 +1,15 @@ +// This is a manifest file that'll be compiled into application.js, which will include all the files +// listed below. +// +// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, +// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. +// +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// the compiled file. +// +// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD +// GO AFTER THE REQUIRES BELOW. +// +//= require jquery +//= require jquery_ujs +//= require_tree . diff --git a/app/assets/javascripts/articles.js.coffee b/app/assets/javascripts/articles.js.coffee new file mode 100644 index 0000000..7615679 --- /dev/null +++ b/app/assets/javascripts/articles.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/ diff --git a/app/assets/javascripts/avatars.js.coffee b/app/assets/javascripts/avatars.js.coffee new file mode 100644 index 0000000..7615679 --- /dev/null +++ b/app/assets/javascripts/avatars.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/ diff --git a/app/assets/javascripts/children.js.coffee b/app/assets/javascripts/children.js.coffee new file mode 100644 index 0000000..7615679 --- /dev/null +++ b/app/assets/javascripts/children.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/ diff --git a/app/assets/javascripts/exercises.js.coffee b/app/assets/javascripts/exercises.js.coffee new file mode 100644 index 0000000..7615679 --- /dev/null +++ b/app/assets/javascripts/exercises.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/ diff --git a/app/assets/javascripts/features.js.coffee b/app/assets/javascripts/features.js.coffee new file mode 100644 index 0000000..7615679 --- /dev/null +++ b/app/assets/javascripts/features.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/ diff --git a/app/assets/javascripts/leaderboards.js.coffee b/app/assets/javascripts/leaderboards.js.coffee new file mode 100644 index 0000000..7615679 --- /dev/null +++ b/app/assets/javascripts/leaderboards.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/ diff --git a/app/assets/javascripts/monitor_child_relations.js.coffee b/app/assets/javascripts/monitor_child_relations.js.coffee new file mode 100644 index 0000000..7615679 --- /dev/null +++ b/app/assets/javascripts/monitor_child_relations.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/ diff --git a/app/assets/javascripts/monitor_profiles.js.coffee b/app/assets/javascripts/monitor_profiles.js.coffee new file mode 100644 index 0000000..7615679 --- /dev/null +++ b/app/assets/javascripts/monitor_profiles.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/ diff --git a/app/assets/javascripts/regimen.js.coffee b/app/assets/javascripts/regimen.js.coffee new file mode 100644 index 0000000..7615679 --- /dev/null +++ b/app/assets/javascripts/regimen.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/ diff --git a/app/assets/javascripts/tags.js.coffee b/app/assets/javascripts/tags.js.coffee new file mode 100644 index 0000000..7615679 --- /dev/null +++ b/app/assets/javascripts/tags.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/ diff --git a/app/assets/javascripts/weekly_diets.js.coffee b/app/assets/javascripts/weekly_diets.js.coffee new file mode 100644 index 0000000..7615679 --- /dev/null +++ b/app/assets/javascripts/weekly_diets.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/ diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css new file mode 100644 index 0000000..3192ec8 --- /dev/null +++ b/app/assets/stylesheets/application.css @@ -0,0 +1,13 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, + * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. + * + * 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 . + */ diff --git a/app/assets/stylesheets/articles.css.scss b/app/assets/stylesheets/articles.css.scss new file mode 100644 index 0000000..cca5487 --- /dev/null +++ b/app/assets/stylesheets/articles.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the articles controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/avatars.css.scss b/app/assets/stylesheets/avatars.css.scss new file mode 100644 index 0000000..b53fc3e --- /dev/null +++ b/app/assets/stylesheets/avatars.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the avatars controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/children.css.scss b/app/assets/stylesheets/children.css.scss new file mode 100644 index 0000000..e8bb1ad --- /dev/null +++ b/app/assets/stylesheets/children.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the children controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/exercises.css.scss b/app/assets/stylesheets/exercises.css.scss new file mode 100644 index 0000000..6a99ac4 --- /dev/null +++ b/app/assets/stylesheets/exercises.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the exercises controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/features.css.scss b/app/assets/stylesheets/features.css.scss new file mode 100644 index 0000000..6c091d9 --- /dev/null +++ b/app/assets/stylesheets/features.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the features controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/leaderboards.css.scss b/app/assets/stylesheets/leaderboards.css.scss new file mode 100644 index 0000000..aa26cdd --- /dev/null +++ b/app/assets/stylesheets/leaderboards.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the leaderboards controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/monitor_child_relations.css.scss b/app/assets/stylesheets/monitor_child_relations.css.scss new file mode 100644 index 0000000..90a84ee --- /dev/null +++ b/app/assets/stylesheets/monitor_child_relations.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the monitorChildRelations controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/monitor_profiles.css.scss b/app/assets/stylesheets/monitor_profiles.css.scss new file mode 100644 index 0000000..33378f0 --- /dev/null +++ b/app/assets/stylesheets/monitor_profiles.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the monitor_profiles controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/regimen.css.scss b/app/assets/stylesheets/regimen.css.scss new file mode 100644 index 0000000..efe623b --- /dev/null +++ b/app/assets/stylesheets/regimen.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the regimen controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/scaffolds.css.scss b/app/assets/stylesheets/scaffolds.css.scss new file mode 100644 index 0000000..6ec6a8f --- /dev/null +++ b/app/assets/stylesheets/scaffolds.css.scss @@ -0,0 +1,69 @@ +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; + } +} diff --git a/app/assets/stylesheets/tags.css.scss b/app/assets/stylesheets/tags.css.scss new file mode 100644 index 0000000..eb3f7cc --- /dev/null +++ b/app/assets/stylesheets/tags.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the tags controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/weekly_diets.css.scss b/app/assets/stylesheets/weekly_diets.css.scss new file mode 100644 index 0000000..d292672 --- /dev/null +++ b/app/assets/stylesheets/weekly_diets.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the weeklyDiets controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb new file mode 100644 index 0000000..e8065d9 --- /dev/null +++ b/app/controllers/application_controller.rb @@ -0,0 +1,3 @@ +class ApplicationController < ActionController::Base + protect_from_forgery +end diff --git a/app/controllers/articles_controller.rb b/app/controllers/articles_controller.rb new file mode 100644 index 0000000..1565d37 --- /dev/null +++ b/app/controllers/articles_controller.rb @@ -0,0 +1,83 @@ +class ArticlesController < ApplicationController + # GET /articles + # GET /articles.json + def index + @articles = Article.all + + respond_to do |format| + format.html # index.html.erb + format.json { render json: @articles } + end + end + + # GET /articles/1 + # GET /articles/1.json + def show + @article = Article.find(params[:id]) + + respond_to do |format| + format.html # show.html.erb + format.json { render json: @article } + end + end + + # GET /articles/new + # GET /articles/new.json + def new + @article = Article.new + + respond_to do |format| + format.html # new.html.erb + format.json { render json: @article } + end + end + + # GET /articles/1/edit + def edit + @article = Article.find(params[:id]) + end + + # POST /articles + # POST /articles.json + def create + @article = Article.new(params[:article]) + + respond_to do |format| + if @article.save + format.html { redirect_to @article, notice: 'Article was successfully created.' } + format.json { render json: @article, status: :created, location: @article } + else + format.html { render action: "new" } + format.json { render json: @article.errors, status: :unprocessable_entity } + end + end + end + + # PUT /articles/1 + # PUT /articles/1.json + def update + @article = Article.find(params[:id]) + + respond_to do |format| + if @article.update_attributes(params[:article]) + format.html { redirect_to @article, notice: 'Article was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: "edit" } + format.json { render json: @article.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /articles/1 + # DELETE /articles/1.json + def destroy + @article = Article.find(params[:id]) + @article.destroy + + respond_to do |format| + format.html { redirect_to articles_url } + format.json { head :no_content } + end + end +end diff --git a/app/controllers/avatars_controller.rb b/app/controllers/avatars_controller.rb new file mode 100644 index 0000000..8eff573 --- /dev/null +++ b/app/controllers/avatars_controller.rb @@ -0,0 +1,83 @@ +class AvatarsController < ApplicationController + # GET /avatars + # GET /avatars.json + def index + @avatars = Avatar.all + + respond_to do |format| + format.html # index.html.erb + format.json { render json: @avatars } + end + end + + # GET /avatars/1 + # GET /avatars/1.json + def show + @avatar = Avatar.find(params[:id]) + + respond_to do |format| + format.html # show.html.erb + format.json { render json: @avatar } + end + end + + # GET /avatars/new + # GET /avatars/new.json + def new + @avatar = Avatar.new + + respond_to do |format| + format.html # new.html.erb + format.json { render json: @avatar } + end + end + + # GET /avatars/1/edit + def edit + @avatar = Avatar.find(params[:id]) + end + + # POST /avatars + # POST /avatars.json + def create + @avatar = Avatar.new(params[:avatar]) + + respond_to do |format| + if @avatar.save + format.html { redirect_to @avatar, notice: 'Avatar was successfully created.' } + format.json { render json: @avatar, status: :created, location: @avatar } + else + format.html { render action: "new" } + format.json { render json: @avatar.errors, status: :unprocessable_entity } + end + end + end + + # PUT /avatars/1 + # PUT /avatars/1.json + def update + @avatar = Avatar.find(params[:id]) + + respond_to do |format| + if @avatar.update_attributes(params[:avatar]) + format.html { redirect_to @avatar, notice: 'Avatar was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: "edit" } + format.json { render json: @avatar.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /avatars/1 + # DELETE /avatars/1.json + def destroy + @avatar = Avatar.find(params[:id]) + @avatar.destroy + + respond_to do |format| + format.html { redirect_to avatars_url } + format.json { head :no_content } + end + end +end diff --git a/app/controllers/children_controller.rb b/app/controllers/children_controller.rb new file mode 100644 index 0000000..3cbaaa9 --- /dev/null +++ b/app/controllers/children_controller.rb @@ -0,0 +1,83 @@ +class ChildrenController < ApplicationController + # GET /children + # GET /children.json + def index + @children = Child.all + + respond_to do |format| + format.html # index.html.erb + format.json { render json: @children } + end + end + + # GET /children/1 + # GET /children/1.json + def show + @child = Child.find(params[:id]) + + respond_to do |format| + format.html # show.html.erb + format.json { render json: @child } + end + end + + # GET /children/new + # GET /children/new.json + def new + @child = Child.new + + respond_to do |format| + format.html # new.html.erb + format.json { render json: @child } + end + end + + # GET /children/1/edit + def edit + @child = Child.find(params[:id]) + end + + # POST /children + # POST /children.json + def create + @child = Child.new(params[:child]) + + respond_to do |format| + if @child.save + format.html { redirect_to @child, notice: 'Child was successfully created.' } + format.json { render json: @child, status: :created, location: @child } + else + format.html { render action: "new" } + format.json { render json: @child.errors, status: :unprocessable_entity } + end + end + end + + # PUT /children/1 + # PUT /children/1.json + def update + @child = Child.find(params[:id]) + + respond_to do |format| + if @child.update_attributes(params[:child]) + format.html { redirect_to @child, notice: 'Child was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: "edit" } + format.json { render json: @child.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /children/1 + # DELETE /children/1.json + def destroy + @child = Child.find(params[:id]) + @child.destroy + + respond_to do |format| + format.html { redirect_to children_url } + format.json { head :no_content } + end + end +end diff --git a/app/controllers/exercises_controller.rb b/app/controllers/exercises_controller.rb new file mode 100644 index 0000000..ba0e92e --- /dev/null +++ b/app/controllers/exercises_controller.rb @@ -0,0 +1,83 @@ +class ExercisesController < ApplicationController + # GET /exercises + # GET /exercises.json + def index + @exercises = Exercise.all + + respond_to do |format| + format.html # index.html.erb + format.json { render json: @exercises } + end + end + + # GET /exercises/1 + # GET /exercises/1.json + def show + @exercise = Exercise.find(params[:id]) + + respond_to do |format| + format.html # show.html.erb + format.json { render json: @exercise } + end + end + + # GET /exercises/new + # GET /exercises/new.json + def new + @exercise = Exercise.new + + respond_to do |format| + format.html # new.html.erb + format.json { render json: @exercise } + end + end + + # GET /exercises/1/edit + def edit + @exercise = Exercise.find(params[:id]) + end + + # POST /exercises + # POST /exercises.json + def create + @exercise = Exercise.new(params[:exercise]) + + respond_to do |format| + if @exercise.save + format.html { redirect_to @exercise, notice: 'Exercise was successfully created.' } + format.json { render json: @exercise, status: :created, location: @exercise } + else + format.html { render action: "new" } + format.json { render json: @exercise.errors, status: :unprocessable_entity } + end + end + end + + # PUT /exercises/1 + # PUT /exercises/1.json + def update + @exercise = Exercise.find(params[:id]) + + respond_to do |format| + if @exercise.update_attributes(params[:exercise]) + format.html { redirect_to @exercise, notice: 'Exercise was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: "edit" } + format.json { render json: @exercise.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /exercises/1 + # DELETE /exercises/1.json + def destroy + @exercise = Exercise.find(params[:id]) + @exercise.destroy + + respond_to do |format| + format.html { redirect_to exercises_url } + format.json { head :no_content } + end + end +end diff --git a/app/controllers/features_controller.rb b/app/controllers/features_controller.rb new file mode 100644 index 0000000..f15d270 --- /dev/null +++ b/app/controllers/features_controller.rb @@ -0,0 +1,83 @@ +class FeaturesController < ApplicationController + # GET /features + # GET /features.json + def index + @features = Feature.all + + respond_to do |format| + format.html # index.html.erb + format.json { render json: @features } + end + end + + # GET /features/1 + # GET /features/1.json + def show + @feature = Feature.find(params[:id]) + + respond_to do |format| + format.html # show.html.erb + format.json { render json: @feature } + end + end + + # GET /features/new + # GET /features/new.json + def new + @feature = Feature.new + + respond_to do |format| + format.html # new.html.erb + format.json { render json: @feature } + end + end + + # GET /features/1/edit + def edit + @feature = Feature.find(params[:id]) + end + + # POST /features + # POST /features.json + def create + @feature = Feature.new(params[:feature]) + + respond_to do |format| + if @feature.save + format.html { redirect_to @feature, notice: 'Feature was successfully created.' } + format.json { render json: @feature, status: :created, location: @feature } + else + format.html { render action: "new" } + format.json { render json: @feature.errors, status: :unprocessable_entity } + end + end + end + + # PUT /features/1 + # PUT /features/1.json + def update + @feature = Feature.find(params[:id]) + + respond_to do |format| + if @feature.update_attributes(params[:feature]) + format.html { redirect_to @feature, notice: 'Feature was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: "edit" } + format.json { render json: @feature.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /features/1 + # DELETE /features/1.json + def destroy + @feature = Feature.find(params[:id]) + @feature.destroy + + respond_to do |format| + format.html { redirect_to features_url } + format.json { head :no_content } + end + end +end diff --git a/app/controllers/leaderboards_controller.rb b/app/controllers/leaderboards_controller.rb new file mode 100644 index 0000000..672e988 --- /dev/null +++ b/app/controllers/leaderboards_controller.rb @@ -0,0 +1,83 @@ +class LeaderboardsController < ApplicationController + # GET /leaderboards + # GET /leaderboards.json + def index + @leaderboards = Leaderboard.all + + respond_to do |format| + format.html # index.html.erb + format.json { render json: @leaderboards } + end + end + + # GET /leaderboards/1 + # GET /leaderboards/1.json + def show + @leaderboard = Leaderboard.find(params[:id]) + + respond_to do |format| + format.html # show.html.erb + format.json { render json: @leaderboard } + end + end + + # GET /leaderboards/new + # GET /leaderboards/new.json + def new + @leaderboard = Leaderboard.new + + respond_to do |format| + format.html # new.html.erb + format.json { render json: @leaderboard } + end + end + + # GET /leaderboards/1/edit + def edit + @leaderboard = Leaderboard.find(params[:id]) + end + + # POST /leaderboards + # POST /leaderboards.json + def create + @leaderboard = Leaderboard.new(params[:leaderboard]) + + respond_to do |format| + if @leaderboard.save + format.html { redirect_to @leaderboard, notice: 'Leaderboard was successfully created.' } + format.json { render json: @leaderboard, status: :created, location: @leaderboard } + else + format.html { render action: "new" } + format.json { render json: @leaderboard.errors, status: :unprocessable_entity } + end + end + end + + # PUT /leaderboards/1 + # PUT /leaderboards/1.json + def update + @leaderboard = Leaderboard.find(params[:id]) + + respond_to do |format| + if @leaderboard.update_attributes(params[:leaderboard]) + format.html { redirect_to @leaderboard, notice: 'Leaderboard was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: "edit" } + format.json { render json: @leaderboard.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /leaderboards/1 + # DELETE /leaderboards/1.json + def destroy + @leaderboard = Leaderboard.find(params[:id]) + @leaderboard.destroy + + respond_to do |format| + format.html { redirect_to leaderboards_url } + format.json { head :no_content } + end + end +end diff --git a/app/controllers/monitor_child_relations_controller.rb b/app/controllers/monitor_child_relations_controller.rb new file mode 100644 index 0000000..b457b05 --- /dev/null +++ b/app/controllers/monitor_child_relations_controller.rb @@ -0,0 +1,83 @@ +class MonitorChildRelationsController < ApplicationController + # GET /monitor_child_relations + # GET /monitor_child_relations.json + def index + @monitor_child_relations = MonitorChildRelation.all + + respond_to do |format| + format.html # index.html.erb + format.json { render json: @monitor_child_relations } + end + end + + # GET /monitor_child_relations/1 + # GET /monitor_child_relations/1.json + def show + @monitor_child_relation = MonitorChildRelation.find(params[:id]) + + respond_to do |format| + format.html # show.html.erb + format.json { render json: @monitor_child_relation } + end + end + + # GET /monitor_child_relations/new + # GET /monitor_child_relations/new.json + def new + @monitor_child_relation = MonitorChildRelation.new + + respond_to do |format| + format.html # new.html.erb + format.json { render json: @monitor_child_relation } + end + end + + # GET /monitor_child_relations/1/edit + def edit + @monitor_child_relation = MonitorChildRelation.find(params[:id]) + end + + # POST /monitor_child_relations + # POST /monitor_child_relations.json + def create + @monitor_child_relation = MonitorChildRelation.new(params[:monitor_child_relation]) + + respond_to do |format| + if @monitor_child_relation.save + format.html { redirect_to @monitor_child_relation, notice: 'Monitor child relation was successfully created.' } + format.json { render json: @monitor_child_relation, status: :created, location: @monitor_child_relation } + else + format.html { render action: "new" } + format.json { render json: @monitor_child_relation.errors, status: :unprocessable_entity } + end + end + end + + # PUT /monitor_child_relations/1 + # PUT /monitor_child_relations/1.json + def update + @monitor_child_relation = MonitorChildRelation.find(params[:id]) + + respond_to do |format| + if @monitor_child_relation.update_attributes(params[:monitor_child_relation]) + format.html { redirect_to @monitor_child_relation, notice: 'Monitor child relation was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: "edit" } + format.json { render json: @monitor_child_relation.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /monitor_child_relations/1 + # DELETE /monitor_child_relations/1.json + def destroy + @monitor_child_relation = MonitorChildRelation.find(params[:id]) + @monitor_child_relation.destroy + + respond_to do |format| + format.html { redirect_to monitor_child_relations_url } + format.json { head :no_content } + end + end +end diff --git a/app/controllers/monitor_profiles_controller.rb b/app/controllers/monitor_profiles_controller.rb new file mode 100644 index 0000000..e806d29 --- /dev/null +++ b/app/controllers/monitor_profiles_controller.rb @@ -0,0 +1,83 @@ +class MonitorProfilesController < ApplicationController + # GET /monitor_profiles + # GET /monitor_profiles.json + def index + @monitor_profiles = MonitorProfile.all + + respond_to do |format| + format.html # index.html.erb + format.json { render json: @monitor_profiles } + end + end + + # GET /monitor_profiles/1 + # GET /monitor_profiles/1.json + def show + @monitor_profile = MonitorProfile.find(params[:id]) + + respond_to do |format| + format.html # show.html.erb + format.json { render json: @monitor_profile } + end + end + + # GET /monitor_profiles/new + # GET /monitor_profiles/new.json + def new + @monitor_profile = MonitorProfile.new + + respond_to do |format| + format.html # new.html.erb + format.json { render json: @monitor_profile } + end + end + + # GET /monitor_profiles/1/edit + def edit + @monitor_profile = MonitorProfile.find(params[:id]) + end + + # POST /monitor_profiles + # POST /monitor_profiles.json + def create + @monitor_profile = MonitorProfile.new(params[:monitor_profile]) + + respond_to do |format| + if @monitor_profile.save + format.html { redirect_to @monitor_profile, notice: 'Monitor profile was successfully created.' } + format.json { render json: @monitor_profile, status: :created, location: @monitor_profile } + else + format.html { render action: "new" } + format.json { render json: @monitor_profile.errors, status: :unprocessable_entity } + end + end + end + + # PUT /monitor_profiles/1 + # PUT /monitor_profiles/1.json + def update + @monitor_profile = MonitorProfile.find(params[:id]) + + respond_to do |format| + if @monitor_profile.update_attributes(params[:monitor_profile]) + format.html { redirect_to @monitor_profile, notice: 'Monitor profile was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: "edit" } + format.json { render json: @monitor_profile.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /monitor_profiles/1 + # DELETE /monitor_profiles/1.json + def destroy + @monitor_profile = MonitorProfile.find(params[:id]) + @monitor_profile.destroy + + respond_to do |format| + format.html { redirect_to monitor_profiles_url } + format.json { head :no_content } + end + end +end diff --git a/app/controllers/regimen_controller.rb b/app/controllers/regimen_controller.rb new file mode 100644 index 0000000..d9656be --- /dev/null +++ b/app/controllers/regimen_controller.rb @@ -0,0 +1,83 @@ +class RegimenController < ApplicationController + # GET /regimen + # GET /regimen.json + def index + @regimen = Regiman.all + + respond_to do |format| + format.html # index.html.erb + format.json { render json: @regimen } + end + end + + # GET /regimen/1 + # GET /regimen/1.json + def show + @regiman = Regiman.find(params[:id]) + + respond_to do |format| + format.html # show.html.erb + format.json { render json: @regiman } + end + end + + # GET /regimen/new + # GET /regimen/new.json + def new + @regiman = Regiman.new + + respond_to do |format| + format.html # new.html.erb + format.json { render json: @regiman } + end + end + + # GET /regimen/1/edit + def edit + @regiman = Regiman.find(params[:id]) + end + + # POST /regimen + # POST /regimen.json + def create + @regiman = Regiman.new(params[:regiman]) + + respond_to do |format| + if @regiman.save + format.html { redirect_to @regiman, notice: 'Regiman was successfully created.' } + format.json { render json: @regiman, status: :created, location: @regiman } + else + format.html { render action: "new" } + format.json { render json: @regiman.errors, status: :unprocessable_entity } + end + end + end + + # PUT /regimen/1 + # PUT /regimen/1.json + def update + @regiman = Regiman.find(params[:id]) + + respond_to do |format| + if @regiman.update_attributes(params[:regiman]) + format.html { redirect_to @regiman, notice: 'Regiman was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: "edit" } + format.json { render json: @regiman.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /regimen/1 + # DELETE /regimen/1.json + def destroy + @regiman = Regiman.find(params[:id]) + @regiman.destroy + + respond_to do |format| + format.html { redirect_to regimen_url } + format.json { head :no_content } + end + end +end diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb new file mode 100644 index 0000000..d142ed9 --- /dev/null +++ b/app/controllers/tags_controller.rb @@ -0,0 +1,83 @@ +class TagsController < ApplicationController + # GET /tags + # GET /tags.json + def index + @tags = Tag.all + + respond_to do |format| + format.html # index.html.erb + format.json { render json: @tags } + end + end + + # GET /tags/1 + # GET /tags/1.json + def show + @tag = Tag.find(params[:id]) + + respond_to do |format| + format.html # show.html.erb + format.json { render json: @tag } + end + end + + # GET /tags/new + # GET /tags/new.json + def new + @tag = Tag.new + + respond_to do |format| + format.html # new.html.erb + format.json { render json: @tag } + end + end + + # GET /tags/1/edit + def edit + @tag = Tag.find(params[:id]) + end + + # POST /tags + # POST /tags.json + def create + @tag = Tag.new(params[:tag]) + + respond_to do |format| + if @tag.save + format.html { redirect_to @tag, notice: 'Tag was successfully created.' } + format.json { render json: @tag, status: :created, location: @tag } + else + format.html { render action: "new" } + format.json { render json: @tag.errors, status: :unprocessable_entity } + end + end + end + + # PUT /tags/1 + # PUT /tags/1.json + def update + @tag = Tag.find(params[:id]) + + respond_to do |format| + if @tag.update_attributes(params[:tag]) + format.html { redirect_to @tag, notice: 'Tag was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: "edit" } + format.json { render json: @tag.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /tags/1 + # DELETE /tags/1.json + def destroy + @tag = Tag.find(params[:id]) + @tag.destroy + + respond_to do |format| + format.html { redirect_to tags_url } + format.json { head :no_content } + end + end +end diff --git a/app/controllers/weekly_diets_controller.rb b/app/controllers/weekly_diets_controller.rb new file mode 100644 index 0000000..a9aac45 --- /dev/null +++ b/app/controllers/weekly_diets_controller.rb @@ -0,0 +1,83 @@ +class WeeklyDietsController < ApplicationController + # GET /weekly_diets + # GET /weekly_diets.json + def index + @weekly_diets = WeeklyDiet.all + + respond_to do |format| + format.html # index.html.erb + format.json { render json: @weekly_diets } + end + end + + # GET /weekly_diets/1 + # GET /weekly_diets/1.json + def show + @weekly_diet = WeeklyDiet.find(params[:id]) + + respond_to do |format| + format.html # show.html.erb + format.json { render json: @weekly_diet } + end + end + + # GET /weekly_diets/new + # GET /weekly_diets/new.json + def new + @weekly_diet = WeeklyDiet.new + + respond_to do |format| + format.html # new.html.erb + format.json { render json: @weekly_diet } + end + end + + # GET /weekly_diets/1/edit + def edit + @weekly_diet = WeeklyDiet.find(params[:id]) + end + + # POST /weekly_diets + # POST /weekly_diets.json + def create + @weekly_diet = WeeklyDiet.new(params[:weekly_diet]) + + respond_to do |format| + if @weekly_diet.save + format.html { redirect_to @weekly_diet, notice: 'Weekly diet was successfully created.' } + format.json { render json: @weekly_diet, status: :created, location: @weekly_diet } + else + format.html { render action: "new" } + format.json { render json: @weekly_diet.errors, status: :unprocessable_entity } + end + end + end + + # PUT /weekly_diets/1 + # PUT /weekly_diets/1.json + def update + @weekly_diet = WeeklyDiet.find(params[:id]) + + respond_to do |format| + if @weekly_diet.update_attributes(params[:weekly_diet]) + format.html { redirect_to @weekly_diet, notice: 'Weekly diet was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: "edit" } + format.json { render json: @weekly_diet.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /weekly_diets/1 + # DELETE /weekly_diets/1.json + def destroy + @weekly_diet = WeeklyDiet.find(params[:id]) + @weekly_diet.destroy + + respond_to do |format| + format.html { redirect_to weekly_diets_url } + format.json { head :no_content } + end + end +end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb new file mode 100644 index 0000000..de6be79 --- /dev/null +++ b/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/app/helpers/articles_helper.rb b/app/helpers/articles_helper.rb new file mode 100644 index 0000000..2968277 --- /dev/null +++ b/app/helpers/articles_helper.rb @@ -0,0 +1,2 @@ +module ArticlesHelper +end diff --git a/app/helpers/avatars_helper.rb b/app/helpers/avatars_helper.rb new file mode 100644 index 0000000..13e037c --- /dev/null +++ b/app/helpers/avatars_helper.rb @@ -0,0 +1,2 @@ +module AvatarsHelper +end diff --git a/app/helpers/children_helper.rb b/app/helpers/children_helper.rb new file mode 100644 index 0000000..7ad6bc5 --- /dev/null +++ b/app/helpers/children_helper.rb @@ -0,0 +1,2 @@ +module ChildrenHelper +end diff --git a/app/helpers/exercises_helper.rb b/app/helpers/exercises_helper.rb new file mode 100644 index 0000000..05dd59b --- /dev/null +++ b/app/helpers/exercises_helper.rb @@ -0,0 +1,2 @@ +module ExercisesHelper +end diff --git a/app/helpers/features_helper.rb b/app/helpers/features_helper.rb new file mode 100644 index 0000000..1a5e6b2 --- /dev/null +++ b/app/helpers/features_helper.rb @@ -0,0 +1,2 @@ +module FeaturesHelper +end diff --git a/app/helpers/leaderboards_helper.rb b/app/helpers/leaderboards_helper.rb new file mode 100644 index 0000000..aabe508 --- /dev/null +++ b/app/helpers/leaderboards_helper.rb @@ -0,0 +1,2 @@ +module LeaderboardsHelper +end diff --git a/app/helpers/monitor_child_relations_helper.rb b/app/helpers/monitor_child_relations_helper.rb new file mode 100644 index 0000000..b1d75b8 --- /dev/null +++ b/app/helpers/monitor_child_relations_helper.rb @@ -0,0 +1,2 @@ +module MonitorChildRelationsHelper +end diff --git a/app/helpers/monitor_profiles_helper.rb b/app/helpers/monitor_profiles_helper.rb new file mode 100644 index 0000000..3f0d2f7 --- /dev/null +++ b/app/helpers/monitor_profiles_helper.rb @@ -0,0 +1,2 @@ +module MonitorProfilesHelper +end diff --git a/app/helpers/regimen_helper.rb b/app/helpers/regimen_helper.rb new file mode 100644 index 0000000..72e5cab --- /dev/null +++ b/app/helpers/regimen_helper.rb @@ -0,0 +1,2 @@ +module RegimenHelper +end diff --git a/app/helpers/tags_helper.rb b/app/helpers/tags_helper.rb new file mode 100644 index 0000000..23450bc --- /dev/null +++ b/app/helpers/tags_helper.rb @@ -0,0 +1,2 @@ +module TagsHelper +end diff --git a/app/helpers/weekly_diets_helper.rb b/app/helpers/weekly_diets_helper.rb new file mode 100644 index 0000000..519301c --- /dev/null +++ b/app/helpers/weekly_diets_helper.rb @@ -0,0 +1,2 @@ +module WeeklyDietsHelper +end diff --git a/app/mailers/.gitkeep b/app/mailers/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/models/.gitkeep b/app/models/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/models/article.rb b/app/models/article.rb new file mode 100644 index 0000000..9975f67 --- /dev/null +++ b/app/models/article.rb @@ -0,0 +1,5 @@ +class Article < ActiveRecord::Base + attr_accessible :content, :tag, :title + #many to many with monitors + #many to many with tags +end diff --git a/app/models/avatar.rb b/app/models/avatar.rb new file mode 100644 index 0000000..6ad64fa --- /dev/null +++ b/app/models/avatar.rb @@ -0,0 +1,5 @@ +class Avatar < ActiveRecord::Base + attr_accessible :color, :features, :image, :name, :story + has_many :features, inverse_of :avatar + belongs_to :child, inverse_of :avatar +end diff --git a/app/models/child.rb b/app/models/child.rb new file mode 100644 index 0000000..a25a380 --- /dev/null +++ b/app/models/child.rb @@ -0,0 +1,8 @@ +class Child < ActiveRecord::Base + attr_accessible :age, :avatar, :exp, :height, :name, :regimen, :weekly_diet, :weight + has_one :avatar, inverse_of :child + has_one :regimen, inverse_of :child + has_one :weekly_diet, inverse_of :child + belongs_to :leaderboard, inverse_of :child + has_one :monitor_child_relationship, inverse_of :child +end diff --git a/app/models/exercise.rb b/app/models/exercise.rb new file mode 100644 index 0000000..23ede11 --- /dev/null +++ b/app/models/exercise.rb @@ -0,0 +1,4 @@ +class Exercise < ActiveRecord::Base + attr_accessible :exercise_type, :reps + #many to many with regimen +end diff --git a/app/models/feature.rb b/app/models/feature.rb new file mode 100644 index 0000000..70c4032 --- /dev/null +++ b/app/models/feature.rb @@ -0,0 +1,4 @@ +class Feature < ActiveRecord::Base + attr_accessible :color, :feature_type, :image + belongs_to :avatar , inverse_of :feature +end diff --git a/app/models/leaderboard.rb b/app/models/leaderboard.rb new file mode 100644 index 0000000..fbba308 --- /dev/null +++ b/app/models/leaderboard.rb @@ -0,0 +1,4 @@ +class Leaderboard < ActiveRecord::Base + attr_accessible :board_type, :child + has_many :child , inverse_of :leaderboard +end diff --git a/app/models/monitor_child_relation.rb b/app/models/monitor_child_relation.rb new file mode 100644 index 0000000..34b24af --- /dev/null +++ b/app/models/monitor_child_relation.rb @@ -0,0 +1,5 @@ +class MonitorChildRelation < ActiveRecord::Base + attr_accessible :child, :monitor_profile, :relation + belongs_to :child, inverse_of: child + belongs_to :monitor_profile, inverse_of: monitor_profile +end diff --git a/app/models/monitor_profile.rb b/app/models/monitor_profile.rb new file mode 100644 index 0000000..b080fef --- /dev/null +++ b/app/models/monitor_profile.rb @@ -0,0 +1,6 @@ +class MonitorProfile < ActiveRecord::Base + attr_accessible :article, :name, :picture, :tag + has_many :monitor_child_relationships , inverse_of :monitorProfile + #many to many with articles + #many to many with tags +end diff --git a/app/models/regiman.rb b/app/models/regiman.rb new file mode 100644 index 0000000..d9726c5 --- /dev/null +++ b/app/models/regiman.rb @@ -0,0 +1,4 @@ +class Regiman < ActiveRecord::Base + attr_accessible :exercise + #many to many with exercises +end diff --git a/app/models/tag.rb b/app/models/tag.rb new file mode 100644 index 0000000..9b62ac3 --- /dev/null +++ b/app/models/tag.rb @@ -0,0 +1,5 @@ +class Tag < ActiveRecord::Base + attr_accessible :tag_name + #many to many with articles + #many to many with tags +end diff --git a/app/models/weekly_diet.rb b/app/models/weekly_diet.rb new file mode 100644 index 0000000..829a339 --- /dev/null +++ b/app/models/weekly_diet.rb @@ -0,0 +1,4 @@ +class WeeklyDiet < ActiveRecord::Base + attr_accessible :carb_goal, :carbs_eaten, :dairy_eaten, :dairy_goal, :fruit_eaten, :fruit_goal, :protein_eaten, :protein_goal, :sweets_eaten, :sweets_goal, :veggie_eaten, :veggie_goal, :water_eaten, :water_goal +belongs_to :child , inverse_of :weeklyDiet +end diff --git a/app/views/articles/_form.html.erb b/app/views/articles/_form.html.erb new file mode 100644 index 0000000..d55310b --- /dev/null +++ b/app/views/articles/_form.html.erb @@ -0,0 +1,29 @@ +<%= form_for(@article) do |f| %> + <% if @article.errors.any? %> +
+

<%= pluralize(@article.errors.count, "error") %> prohibited this article from being saved:

+ +
    + <% @article.errors.full_messages.each do |msg| %> +
  • <%= msg %>
  • + <% end %> +
+
+ <% end %> + +
+ <%= f.label :title %>
+ <%= f.text_field :title %> +
+
+ <%= f.label :content %>
+ <%= f.text_area :content %> +
+
+ <%= f.label :tag %>
+ <%= f.text_field :tag %> +
+
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/articles/edit.html.erb b/app/views/articles/edit.html.erb new file mode 100644 index 0000000..2c19833 --- /dev/null +++ b/app/views/articles/edit.html.erb @@ -0,0 +1,6 @@ +

Editing article

+ +<%= render 'form' %> + +<%= link_to 'Show', @article %> | +<%= link_to 'Back', articles_path %> diff --git a/app/views/articles/index.html.erb b/app/views/articles/index.html.erb new file mode 100644 index 0000000..93318a3 --- /dev/null +++ b/app/views/articles/index.html.erb @@ -0,0 +1,27 @@ +

Listing articles

+ + + + + + + + + + + +<% @articles.each do |article| %> + + + + + + + + +<% end %> +
TitleContentTag
<%= article.title %><%= article.content %><%= article.tag %><%= link_to 'Show', article %><%= link_to 'Edit', edit_article_path(article) %><%= link_to 'Destroy', article, method: :delete, data: { confirm: 'Are you sure?' } %>
+ +
+ +<%= link_to 'New Article', new_article_path %> diff --git a/app/views/articles/new.html.erb b/app/views/articles/new.html.erb new file mode 100644 index 0000000..721bfb5 --- /dev/null +++ b/app/views/articles/new.html.erb @@ -0,0 +1,5 @@ +

New article

+ +<%= render 'form' %> + +<%= link_to 'Back', articles_path %> diff --git a/app/views/articles/show.html.erb b/app/views/articles/show.html.erb new file mode 100644 index 0000000..f37b254 --- /dev/null +++ b/app/views/articles/show.html.erb @@ -0,0 +1,20 @@ +

<%= notice %>

+ +

+ Title: + <%= @article.title %> +

+ +

+ Content: + <%= @article.content %> +

+ +

+ Tag: + <%= @article.tag %> +

+ + +<%= link_to 'Edit', edit_article_path(@article) %> | +<%= link_to 'Back', articles_path %> diff --git a/app/views/avatars/_form.html.erb b/app/views/avatars/_form.html.erb new file mode 100644 index 0000000..3bd7eff --- /dev/null +++ b/app/views/avatars/_form.html.erb @@ -0,0 +1,37 @@ +<%= form_for(@avatar) do |f| %> + <% if @avatar.errors.any? %> +
+

<%= pluralize(@avatar.errors.count, "error") %> prohibited this avatar from being saved:

+ +
    + <% @avatar.errors.full_messages.each do |msg| %> +
  • <%= msg %>
  • + <% end %> +
+
+ <% end %> + +
+ <%= f.label :name %>
+ <%= f.text_field :name %> +
+
+ <%= f.label :color %>
+ <%= f.text_field :color %> +
+
+ <%= f.label :story %>
+ <%= f.text_area :story %> +
+
+ <%= f.label :image %>
+ <%= f.text_field :image %> +
+
+ <%= f.label :features %>
+ <%= f.text_field :features %> +
+
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/avatars/edit.html.erb b/app/views/avatars/edit.html.erb new file mode 100644 index 0000000..949aff7 --- /dev/null +++ b/app/views/avatars/edit.html.erb @@ -0,0 +1,6 @@ +

Editing avatar

+ +<%= render 'form' %> + +<%= link_to 'Show', @avatar %> | +<%= link_to 'Back', avatars_path %> diff --git a/app/views/avatars/index.html.erb b/app/views/avatars/index.html.erb new file mode 100644 index 0000000..3359642 --- /dev/null +++ b/app/views/avatars/index.html.erb @@ -0,0 +1,31 @@ +

Listing avatars

+ + + + + + + + + + + + + +<% @avatars.each do |avatar| %> + + + + + + + + + + +<% end %> +
NameColorStoryImageFeatures
<%= avatar.name %><%= avatar.color %><%= avatar.story %><%= avatar.image %><%= avatar.features %><%= link_to 'Show', avatar %><%= link_to 'Edit', edit_avatar_path(avatar) %><%= link_to 'Destroy', avatar, method: :delete, data: { confirm: 'Are you sure?' } %>
+ +
+ +<%= link_to 'New Avatar', new_avatar_path %> diff --git a/app/views/avatars/new.html.erb b/app/views/avatars/new.html.erb new file mode 100644 index 0000000..ed8aab5 --- /dev/null +++ b/app/views/avatars/new.html.erb @@ -0,0 +1,5 @@ +

New avatar

+ +<%= render 'form' %> + +<%= link_to 'Back', avatars_path %> diff --git a/app/views/avatars/show.html.erb b/app/views/avatars/show.html.erb new file mode 100644 index 0000000..9299270 --- /dev/null +++ b/app/views/avatars/show.html.erb @@ -0,0 +1,30 @@ +

<%= notice %>

+ +

+ Name: + <%= @avatar.name %> +

+ +

+ Color: + <%= @avatar.color %> +

+ +

+ Story: + <%= @avatar.story %> +

+ +

+ Image: + <%= @avatar.image %> +

+ +

+ Features: + <%= @avatar.features %> +

+ + +<%= link_to 'Edit', edit_avatar_path(@avatar) %> | +<%= link_to 'Back', avatars_path %> diff --git a/app/views/children/_form.html.erb b/app/views/children/_form.html.erb new file mode 100644 index 0000000..e7fae95 --- /dev/null +++ b/app/views/children/_form.html.erb @@ -0,0 +1,49 @@ +<%= form_for(@child) do |f| %> + <% if @child.errors.any? %> +
+

<%= pluralize(@child.errors.count, "error") %> prohibited this child from being saved:

+ +
    + <% @child.errors.full_messages.each do |msg| %> +
  • <%= msg %>
  • + <% end %> +
+
+ <% end %> + +
+ <%= f.label :name %>
+ <%= f.text_field :name %> +
+
+ <%= f.label :height %>
+ <%= f.text_field :height %> +
+
+ <%= f.label :weight %>
+ <%= f.text_field :weight %> +
+
+ <%= f.label :age %>
+ <%= f.text_field :age %> +
+
+ <%= f.label :exp %>
+ <%= f.text_field :exp %> +
+
+ <%= f.label :avatar %>
+ <%= f.text_field :avatar %> +
+
+ <%= f.label :weekly_diet %>
+ <%= f.text_field :weekly_diet %> +
+
+ <%= f.label :regimen %>
+ <%= f.text_field :regimen %> +
+
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/children/edit.html.erb b/app/views/children/edit.html.erb new file mode 100644 index 0000000..50ae356 --- /dev/null +++ b/app/views/children/edit.html.erb @@ -0,0 +1,6 @@ +

Editing child

+ +<%= render 'form' %> + +<%= link_to 'Show', @child %> | +<%= link_to 'Back', children_path %> diff --git a/app/views/children/index.html.erb b/app/views/children/index.html.erb new file mode 100644 index 0000000..d9ba90b --- /dev/null +++ b/app/views/children/index.html.erb @@ -0,0 +1,37 @@ +

Listing children

+ + + + + + + + + + + + + + + + +<% @children.each do |child| %> + + + + + + + + + + + + + +<% end %> +
NameHeightWeightAgeExpAvatarWeekly dietRegimen
<%= child.name %><%= child.height %><%= child.weight %><%= child.age %><%= child.exp %><%= child.avatar %><%= child.weekly_diet %><%= child.regimen %><%= link_to 'Show', child %><%= link_to 'Edit', edit_child_path(child) %><%= link_to 'Destroy', child, method: :delete, data: { confirm: 'Are you sure?' } %>
+ +
+ +<%= link_to 'New Child', new_child_path %> diff --git a/app/views/children/new.html.erb b/app/views/children/new.html.erb new file mode 100644 index 0000000..da1f21b --- /dev/null +++ b/app/views/children/new.html.erb @@ -0,0 +1,5 @@ +

New child

+ +<%= render 'form' %> + +<%= link_to 'Back', children_path %> diff --git a/app/views/children/show.html.erb b/app/views/children/show.html.erb new file mode 100644 index 0000000..1988bda --- /dev/null +++ b/app/views/children/show.html.erb @@ -0,0 +1,45 @@ +

<%= notice %>

+ +

+ Name: + <%= @child.name %> +

+ +

+ Height: + <%= @child.height %> +

+ +

+ Weight: + <%= @child.weight %> +

+ +

+ Age: + <%= @child.age %> +

+ +

+ Exp: + <%= @child.exp %> +

+ +

+ Avatar: + <%= @child.avatar %> +

+ +

+ Weekly diet: + <%= @child.weekly_diet %> +

+ +

+ Regimen: + <%= @child.regimen %> +

+ + +<%= link_to 'Edit', edit_child_path(@child) %> | +<%= link_to 'Back', children_path %> diff --git a/app/views/exercises/_form.html.erb b/app/views/exercises/_form.html.erb new file mode 100644 index 0000000..5597197 --- /dev/null +++ b/app/views/exercises/_form.html.erb @@ -0,0 +1,25 @@ +<%= form_for(@exercise) do |f| %> + <% if @exercise.errors.any? %> +
+

<%= pluralize(@exercise.errors.count, "error") %> prohibited this exercise from being saved:

+ +
    + <% @exercise.errors.full_messages.each do |msg| %> +
  • <%= msg %>
  • + <% end %> +
+
+ <% end %> + +
+ <%= f.label :exercise_type %>
+ <%= f.text_field :exercise_type %> +
+
+ <%= f.label :reps %>
+ <%= f.text_field :reps %> +
+
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/exercises/edit.html.erb b/app/views/exercises/edit.html.erb new file mode 100644 index 0000000..6c80598 --- /dev/null +++ b/app/views/exercises/edit.html.erb @@ -0,0 +1,6 @@ +

Editing exercise

+ +<%= render 'form' %> + +<%= link_to 'Show', @exercise %> | +<%= link_to 'Back', exercises_path %> diff --git a/app/views/exercises/index.html.erb b/app/views/exercises/index.html.erb new file mode 100644 index 0000000..8ce04b6 --- /dev/null +++ b/app/views/exercises/index.html.erb @@ -0,0 +1,25 @@ +

Listing exercises

+ + + + + + + + + + +<% @exercises.each do |exercise| %> + + + + + + + +<% end %> +
Exercise typeReps
<%= exercise.exercise_type %><%= exercise.reps %><%= link_to 'Show', exercise %><%= link_to 'Edit', edit_exercise_path(exercise) %><%= link_to 'Destroy', exercise, method: :delete, data: { confirm: 'Are you sure?' } %>
+ +
+ +<%= link_to 'New Exercise', new_exercise_path %> diff --git a/app/views/exercises/new.html.erb b/app/views/exercises/new.html.erb new file mode 100644 index 0000000..312cdac --- /dev/null +++ b/app/views/exercises/new.html.erb @@ -0,0 +1,5 @@ +

New exercise

+ +<%= render 'form' %> + +<%= link_to 'Back', exercises_path %> diff --git a/app/views/exercises/show.html.erb b/app/views/exercises/show.html.erb new file mode 100644 index 0000000..8b14139 --- /dev/null +++ b/app/views/exercises/show.html.erb @@ -0,0 +1,15 @@ +

<%= notice %>

+ +

+ Exercise type: + <%= @exercise.exercise_type %> +

+ +

+ Reps: + <%= @exercise.reps %> +

+ + +<%= link_to 'Edit', edit_exercise_path(@exercise) %> | +<%= link_to 'Back', exercises_path %> diff --git a/app/views/features/_form.html.erb b/app/views/features/_form.html.erb new file mode 100644 index 0000000..3816ac9 --- /dev/null +++ b/app/views/features/_form.html.erb @@ -0,0 +1,29 @@ +<%= form_for(@feature) do |f| %> + <% if @feature.errors.any? %> +
+

<%= pluralize(@feature.errors.count, "error") %> prohibited this feature from being saved:

+ +
    + <% @feature.errors.full_messages.each do |msg| %> +
  • <%= msg %>
  • + <% end %> +
+
+ <% end %> + +
+ <%= f.label :feature_type %>
+ <%= f.text_field :feature_type %> +
+
+ <%= f.label :color %>
+ <%= f.text_field :color %> +
+
+ <%= f.label :image %>
+ <%= f.text_field :image %> +
+
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/features/edit.html.erb b/app/views/features/edit.html.erb new file mode 100644 index 0000000..baee63f --- /dev/null +++ b/app/views/features/edit.html.erb @@ -0,0 +1,6 @@ +

Editing feature

+ +<%= render 'form' %> + +<%= link_to 'Show', @feature %> | +<%= link_to 'Back', features_path %> diff --git a/app/views/features/index.html.erb b/app/views/features/index.html.erb new file mode 100644 index 0000000..576f9f1 --- /dev/null +++ b/app/views/features/index.html.erb @@ -0,0 +1,27 @@ +

Listing features

+ + + + + + + + + + + +<% @features.each do |feature| %> + + + + + + + + +<% end %> +
Feature typeColorImage
<%= feature.feature_type %><%= feature.color %><%= feature.image %><%= link_to 'Show', feature %><%= link_to 'Edit', edit_feature_path(feature) %><%= link_to 'Destroy', feature, method: :delete, data: { confirm: 'Are you sure?' } %>
+ +
+ +<%= link_to 'New Feature', new_feature_path %> diff --git a/app/views/features/new.html.erb b/app/views/features/new.html.erb new file mode 100644 index 0000000..3666fd6 --- /dev/null +++ b/app/views/features/new.html.erb @@ -0,0 +1,5 @@ +

New feature

+ +<%= render 'form' %> + +<%= link_to 'Back', features_path %> diff --git a/app/views/features/show.html.erb b/app/views/features/show.html.erb new file mode 100644 index 0000000..602239b --- /dev/null +++ b/app/views/features/show.html.erb @@ -0,0 +1,20 @@ +

<%= notice %>

+ +

+ Feature type: + <%= @feature.feature_type %> +

+ +

+ Color: + <%= @feature.color %> +

+ +

+ Image: + <%= @feature.image %> +

+ + +<%= link_to 'Edit', edit_feature_path(@feature) %> | +<%= link_to 'Back', features_path %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb new file mode 100644 index 0000000..e268b83 --- /dev/null +++ b/app/views/layouts/application.html.erb @@ -0,0 +1,14 @@ + + + + Fitkids + <%= stylesheet_link_tag "application", :media => "all" %> + <%= javascript_include_tag "application" %> + <%= csrf_meta_tags %> + + + +<%= yield %> + + + diff --git a/app/views/leaderboards/_form.html.erb b/app/views/leaderboards/_form.html.erb new file mode 100644 index 0000000..4166426 --- /dev/null +++ b/app/views/leaderboards/_form.html.erb @@ -0,0 +1,25 @@ +<%= form_for(@leaderboard) do |f| %> + <% if @leaderboard.errors.any? %> +
+

<%= pluralize(@leaderboard.errors.count, "error") %> prohibited this leaderboard from being saved:

+ +
    + <% @leaderboard.errors.full_messages.each do |msg| %> +
  • <%= msg %>
  • + <% end %> +
+
+ <% end %> + +
+ <%= f.label :board_type %>
+ <%= f.text_field :board_type %> +
+
+ <%= f.label :child %>
+ <%= f.text_field :child %> +
+
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/leaderboards/edit.html.erb b/app/views/leaderboards/edit.html.erb new file mode 100644 index 0000000..4126dfe --- /dev/null +++ b/app/views/leaderboards/edit.html.erb @@ -0,0 +1,6 @@ +

Editing leaderboard

+ +<%= render 'form' %> + +<%= link_to 'Show', @leaderboard %> | +<%= link_to 'Back', leaderboards_path %> diff --git a/app/views/leaderboards/index.html.erb b/app/views/leaderboards/index.html.erb new file mode 100644 index 0000000..4ed9101 --- /dev/null +++ b/app/views/leaderboards/index.html.erb @@ -0,0 +1,25 @@ +

Listing leaderboards

+ + + + + + + + + + +<% @leaderboards.each do |leaderboard| %> + + + + + + + +<% end %> +
Board typeChild
<%= leaderboard.board_type %><%= leaderboard.child %><%= link_to 'Show', leaderboard %><%= link_to 'Edit', edit_leaderboard_path(leaderboard) %><%= link_to 'Destroy', leaderboard, method: :delete, data: { confirm: 'Are you sure?' } %>
+ +
+ +<%= link_to 'New Leaderboard', new_leaderboard_path %> diff --git a/app/views/leaderboards/new.html.erb b/app/views/leaderboards/new.html.erb new file mode 100644 index 0000000..40fdad7 --- /dev/null +++ b/app/views/leaderboards/new.html.erb @@ -0,0 +1,5 @@ +

New leaderboard

+ +<%= render 'form' %> + +<%= link_to 'Back', leaderboards_path %> diff --git a/app/views/leaderboards/show.html.erb b/app/views/leaderboards/show.html.erb new file mode 100644 index 0000000..501c91e --- /dev/null +++ b/app/views/leaderboards/show.html.erb @@ -0,0 +1,15 @@ +

<%= notice %>

+ +

+ Board type: + <%= @leaderboard.board_type %> +

+ +

+ Child: + <%= @leaderboard.child %> +

+ + +<%= link_to 'Edit', edit_leaderboard_path(@leaderboard) %> | +<%= link_to 'Back', leaderboards_path %> diff --git a/app/views/monitor_child_relations/_form.html.erb b/app/views/monitor_child_relations/_form.html.erb new file mode 100644 index 0000000..ddaed09 --- /dev/null +++ b/app/views/monitor_child_relations/_form.html.erb @@ -0,0 +1,29 @@ +<%= form_for(@monitor_child_relation) do |f| %> + <% if @monitor_child_relation.errors.any? %> +
+

<%= pluralize(@monitor_child_relation.errors.count, "error") %> prohibited this monitor_child_relation from being saved:

+ +
    + <% @monitor_child_relation.errors.full_messages.each do |msg| %> +
  • <%= msg %>
  • + <% end %> +
+
+ <% end %> + +
+ <%= f.label :relation %>
+ <%= f.text_field :relation %> +
+
+ <%= f.label :child %>
+ <%= f.text_field :child %> +
+
+ <%= f.label :monitor %>
+ <%= f.text_field :monitor %> +
+
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/monitor_child_relations/edit.html.erb b/app/views/monitor_child_relations/edit.html.erb new file mode 100644 index 0000000..09d99cd --- /dev/null +++ b/app/views/monitor_child_relations/edit.html.erb @@ -0,0 +1,6 @@ +

Editing monitor_child_relation

+ +<%= render 'form' %> + +<%= link_to 'Show', @monitor_child_relation %> | +<%= link_to 'Back', monitor_child_relations_path %> diff --git a/app/views/monitor_child_relations/index.html.erb b/app/views/monitor_child_relations/index.html.erb new file mode 100644 index 0000000..0946aed --- /dev/null +++ b/app/views/monitor_child_relations/index.html.erb @@ -0,0 +1,27 @@ +

Listing monitor_child_relations

+ + + + + + + + + + + +<% @monitor_child_relations.each do |monitor_child_relation| %> + + + + + + + + +<% end %> +
RelationChildMonitor
<%= monitor_child_relation.relation %><%= monitor_child_relation.child %><%= monitor_child_relation.monitor %><%= link_to 'Show', monitor_child_relation %><%= link_to 'Edit', edit_monitor_child_relation_path(monitor_child_relation) %><%= link_to 'Destroy', monitor_child_relation, method: :delete, data: { confirm: 'Are you sure?' } %>
+ +
+ +<%= link_to 'New Monitor child relation', new_monitor_child_relation_path %> diff --git a/app/views/monitor_child_relations/new.html.erb b/app/views/monitor_child_relations/new.html.erb new file mode 100644 index 0000000..58cf0ad --- /dev/null +++ b/app/views/monitor_child_relations/new.html.erb @@ -0,0 +1,5 @@ +

New monitor_child_relation

+ +<%= render 'form' %> + +<%= link_to 'Back', monitor_child_relations_path %> diff --git a/app/views/monitor_child_relations/show.html.erb b/app/views/monitor_child_relations/show.html.erb new file mode 100644 index 0000000..b1443b0 --- /dev/null +++ b/app/views/monitor_child_relations/show.html.erb @@ -0,0 +1,20 @@ +

<%= notice %>

+ +

+ Relation: + <%= @monitor_child_relation.relation %> +

+ +

+ Child: + <%= @monitor_child_relation.child %> +

+ +

+ Monitor: + <%= @monitor_child_relation.monitor %> +

+ + +<%= link_to 'Edit', edit_monitor_child_relation_path(@monitor_child_relation) %> | +<%= link_to 'Back', monitor_child_relations_path %> diff --git a/app/views/monitor_profiles/_form.html.erb b/app/views/monitor_profiles/_form.html.erb new file mode 100644 index 0000000..1989372 --- /dev/null +++ b/app/views/monitor_profiles/_form.html.erb @@ -0,0 +1,33 @@ +<%= form_for(@monitor_profile) do |f| %> + <% if @monitor_profile.errors.any? %> +
+

<%= pluralize(@monitor_profile.errors.count, "error") %> prohibited this monitor_profile from being saved:

+ +
    + <% @monitor_profile.errors.full_messages.each do |msg| %> +
  • <%= msg %>
  • + <% end %> +
+
+ <% end %> + +
+ <%= f.label :name %>
+ <%= f.text_field :name %> +
+
+ <%= f.label :picture %>
+ <%= f.text_field :picture %> +
+
+ <%= f.label :tag %>
+ <%= f.text_field :tag %> +
+
+ <%= f.label :article %>
+ <%= f.text_field :article %> +
+
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/monitor_profiles/edit.html.erb b/app/views/monitor_profiles/edit.html.erb new file mode 100644 index 0000000..0ed4697 --- /dev/null +++ b/app/views/monitor_profiles/edit.html.erb @@ -0,0 +1,6 @@ +

Editing monitor_profile

+ +<%= render 'form' %> + +<%= link_to 'Show', @monitor_profile %> | +<%= link_to 'Back', monitor_profiles_path %> diff --git a/app/views/monitor_profiles/index.html.erb b/app/views/monitor_profiles/index.html.erb new file mode 100644 index 0000000..c378124 --- /dev/null +++ b/app/views/monitor_profiles/index.html.erb @@ -0,0 +1,29 @@ +

Listing monitor_profiles

+ + + + + + + + + + + + +<% @monitor_profiles.each do |monitor_profile| %> + + + + + + + + + +<% end %> +
NamePictureTagArticle
<%= monitor_profile.name %><%= monitor_profile.picture %><%= monitor_profile.tag %><%= monitor_profile.article %><%= link_to 'Show', monitor_profile %><%= link_to 'Edit', edit_monitor_profile_path(monitor_profile) %><%= link_to 'Destroy', monitor_profile, method: :delete, data: { confirm: 'Are you sure?' } %>
+ +
+ +<%= link_to 'New Monitor profile', new_monitor_profile_path %> diff --git a/app/views/monitor_profiles/new.html.erb b/app/views/monitor_profiles/new.html.erb new file mode 100644 index 0000000..7b35c95 --- /dev/null +++ b/app/views/monitor_profiles/new.html.erb @@ -0,0 +1,5 @@ +

New monitor_profile

+ +<%= render 'form' %> + +<%= link_to 'Back', monitor_profiles_path %> diff --git a/app/views/monitor_profiles/show.html.erb b/app/views/monitor_profiles/show.html.erb new file mode 100644 index 0000000..d36cf60 --- /dev/null +++ b/app/views/monitor_profiles/show.html.erb @@ -0,0 +1,25 @@ +

<%= notice %>

+ +

+ Name: + <%= @monitor_profile.name %> +

+ +

+ Picture: + <%= @monitor_profile.picture %> +

+ +

+ Tag: + <%= @monitor_profile.tag %> +

+ +

+ Article: + <%= @monitor_profile.article %> +

+ + +<%= link_to 'Edit', edit_monitor_profile_path(@monitor_profile) %> | +<%= link_to 'Back', monitor_profiles_path %> diff --git a/app/views/regimen/_form.html.erb b/app/views/regimen/_form.html.erb new file mode 100644 index 0000000..ef6b470 --- /dev/null +++ b/app/views/regimen/_form.html.erb @@ -0,0 +1,21 @@ +<%= form_for(@regiman) do |f| %> + <% if @regiman.errors.any? %> +
+

<%= pluralize(@regiman.errors.count, "error") %> prohibited this regiman from being saved:

+ +
    + <% @regiman.errors.full_messages.each do |msg| %> +
  • <%= msg %>
  • + <% end %> +
+
+ <% end %> + +
+ <%= f.label :exercise %>
+ <%= f.text_field :exercise %> +
+
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/regimen/edit.html.erb b/app/views/regimen/edit.html.erb new file mode 100644 index 0000000..054f19f --- /dev/null +++ b/app/views/regimen/edit.html.erb @@ -0,0 +1,6 @@ +

Editing regiman

+ +<%= render 'form' %> + +<%= link_to 'Show', @regiman %> | +<%= link_to 'Back', regimen_path %> diff --git a/app/views/regimen/index.html.erb b/app/views/regimen/index.html.erb new file mode 100644 index 0000000..825df84 --- /dev/null +++ b/app/views/regimen/index.html.erb @@ -0,0 +1,23 @@ +

Listing regimen

+ + + + + + + + + +<% @regimen.each do |regiman| %> + + + + + + +<% end %> +
Exercise
<%= regiman.exercise %><%= link_to 'Show', regiman %><%= link_to 'Edit', edit_regiman_path(regiman) %><%= link_to 'Destroy', regiman, method: :delete, data: { confirm: 'Are you sure?' } %>
+ +
+ +<%= link_to 'New Regiman', new_regiman_path %> diff --git a/app/views/regimen/new.html.erb b/app/views/regimen/new.html.erb new file mode 100644 index 0000000..8798a3f --- /dev/null +++ b/app/views/regimen/new.html.erb @@ -0,0 +1,5 @@ +

New regiman

+ +<%= render 'form' %> + +<%= link_to 'Back', regimen_path %> diff --git a/app/views/regimen/show.html.erb b/app/views/regimen/show.html.erb new file mode 100644 index 0000000..c2e2d1b --- /dev/null +++ b/app/views/regimen/show.html.erb @@ -0,0 +1,10 @@ +

<%= notice %>

+ +

+ Exercise: + <%= @regiman.exercise %> +

+ + +<%= link_to 'Edit', edit_regiman_path(@regiman) %> | +<%= link_to 'Back', regimen_path %> diff --git a/app/views/tags/_form.html.erb b/app/views/tags/_form.html.erb new file mode 100644 index 0000000..ef5edf7 --- /dev/null +++ b/app/views/tags/_form.html.erb @@ -0,0 +1,21 @@ +<%= form_for(@tag) do |f| %> + <% if @tag.errors.any? %> +
+

<%= pluralize(@tag.errors.count, "error") %> prohibited this tag from being saved:

+ +
    + <% @tag.errors.full_messages.each do |msg| %> +
  • <%= msg %>
  • + <% end %> +
+
+ <% end %> + +
+ <%= f.label :tag_name %>
+ <%= f.text_field :tag_name %> +
+
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/tags/edit.html.erb b/app/views/tags/edit.html.erb new file mode 100644 index 0000000..d248aa7 --- /dev/null +++ b/app/views/tags/edit.html.erb @@ -0,0 +1,6 @@ +

Editing tag

+ +<%= render 'form' %> + +<%= link_to 'Show', @tag %> | +<%= link_to 'Back', tags_path %> diff --git a/app/views/tags/index.html.erb b/app/views/tags/index.html.erb new file mode 100644 index 0000000..86291ef --- /dev/null +++ b/app/views/tags/index.html.erb @@ -0,0 +1,23 @@ +

Listing tags

+ + + + + + + + + +<% @tags.each do |tag| %> + + + + + + +<% end %> +
Tag name
<%= tag.tag_name %><%= link_to 'Show', tag %><%= link_to 'Edit', edit_tag_path(tag) %><%= link_to 'Destroy', tag, method: :delete, data: { confirm: 'Are you sure?' } %>
+ +
+ +<%= link_to 'New Tag', new_tag_path %> diff --git a/app/views/tags/new.html.erb b/app/views/tags/new.html.erb new file mode 100644 index 0000000..a555828 --- /dev/null +++ b/app/views/tags/new.html.erb @@ -0,0 +1,5 @@ +

New tag

+ +<%= render 'form' %> + +<%= link_to 'Back', tags_path %> diff --git a/app/views/tags/show.html.erb b/app/views/tags/show.html.erb new file mode 100644 index 0000000..c99ac6f --- /dev/null +++ b/app/views/tags/show.html.erb @@ -0,0 +1,10 @@ +

<%= notice %>

+ +

+ Tag name: + <%= @tag.tag_name %> +

+ + +<%= link_to 'Edit', edit_tag_path(@tag) %> | +<%= link_to 'Back', tags_path %> diff --git a/app/views/weekly_diets/_form.html.erb b/app/views/weekly_diets/_form.html.erb new file mode 100644 index 0000000..92aa340 --- /dev/null +++ b/app/views/weekly_diets/_form.html.erb @@ -0,0 +1,73 @@ +<%= form_for(@weekly_diet) do |f| %> + <% if @weekly_diet.errors.any? %> +
+

<%= pluralize(@weekly_diet.errors.count, "error") %> prohibited this weekly_diet from being saved:

+ +
    + <% @weekly_diet.errors.full_messages.each do |msg| %> +
  • <%= msg %>
  • + <% end %> +
+
+ <% end %> + +
+ <%= f.label :carb_goal %>
+ <%= f.text_field :carb_goal %> +
+
+ <%= f.label :veggie_goal %>
+ <%= f.text_field :veggie_goal %> +
+
+ <%= f.label :fruit_goal %>
+ <%= f.text_field :fruit_goal %> +
+
+ <%= f.label :protein_goal %>
+ <%= f.text_field :protein_goal %> +
+
+ <%= f.label :dairy_goal %>
+ <%= f.text_field :dairy_goal %> +
+
+ <%= f.label :water_goal %>
+ <%= f.text_field :water_goal %> +
+
+ <%= f.label :sweets_goal %>
+ <%= f.text_field :sweets_goal %> +
+
+ <%= f.label :carbs_eaten %>
+ <%= f.text_field :carbs_eaten %> +
+
+ <%= f.label :veggie_eaten %>
+ <%= f.text_field :veggie_eaten %> +
+
+ <%= f.label :fruit_eaten %>
+ <%= f.text_field :fruit_eaten %> +
+
+ <%= f.label :protein_eaten %>
+ <%= f.text_field :protein_eaten %> +
+
+ <%= f.label :dairy_eaten %>
+ <%= f.text_field :dairy_eaten %> +
+
+ <%= f.label :water_eaten %>
+ <%= f.text_field :water_eaten %> +
+
+ <%= f.label :sweets_eaten %>
+ <%= f.text_field :sweets_eaten %> +
+
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/weekly_diets/edit.html.erb b/app/views/weekly_diets/edit.html.erb new file mode 100644 index 0000000..1ad2c47 --- /dev/null +++ b/app/views/weekly_diets/edit.html.erb @@ -0,0 +1,6 @@ +

Editing weekly_diet

+ +<%= render 'form' %> + +<%= link_to 'Show', @weekly_diet %> | +<%= link_to 'Back', weekly_diets_path %> diff --git a/app/views/weekly_diets/index.html.erb b/app/views/weekly_diets/index.html.erb new file mode 100644 index 0000000..62d3285 --- /dev/null +++ b/app/views/weekly_diets/index.html.erb @@ -0,0 +1,49 @@ +

Listing weekly_diets

+ + + + + + + + + + + + + + + + + + + + + + +<% @weekly_diets.each do |weekly_diet| %> + + + + + + + + + + + + + + + + + + + +<% end %> +
Carb goalVeggie goalFruit goalProtein goalDairy goalWater goalSweets goalCarbs eatenVeggie eatenFruit eatenProtein eatenDairy eatenWater eatenSweets eaten
<%= weekly_diet.carb_goal %><%= weekly_diet.veggie_goal %><%= weekly_diet.fruit_goal %><%= weekly_diet.protein_goal %><%= weekly_diet.dairy_goal %><%= weekly_diet.water_goal %><%= weekly_diet.sweets_goal %><%= weekly_diet.carbs_eaten %><%= weekly_diet.veggie_eaten %><%= weekly_diet.fruit_eaten %><%= weekly_diet.protein_eaten %><%= weekly_diet.dairy_eaten %><%= weekly_diet.water_eaten %><%= weekly_diet.sweets_eaten %><%= link_to 'Show', weekly_diet %><%= link_to 'Edit', edit_weekly_diet_path(weekly_diet) %><%= link_to 'Destroy', weekly_diet, method: :delete, data: { confirm: 'Are you sure?' } %>
+ +
+ +<%= link_to 'New Weekly diet', new_weekly_diet_path %> diff --git a/app/views/weekly_diets/new.html.erb b/app/views/weekly_diets/new.html.erb new file mode 100644 index 0000000..4bed11a --- /dev/null +++ b/app/views/weekly_diets/new.html.erb @@ -0,0 +1,5 @@ +

New weekly_diet

+ +<%= render 'form' %> + +<%= link_to 'Back', weekly_diets_path %> diff --git a/app/views/weekly_diets/show.html.erb b/app/views/weekly_diets/show.html.erb new file mode 100644 index 0000000..ea011ef --- /dev/null +++ b/app/views/weekly_diets/show.html.erb @@ -0,0 +1,75 @@ +

<%= notice %>

+ +

+ Carb goal: + <%= @weekly_diet.carb_goal %> +

+ +

+ Veggie goal: + <%= @weekly_diet.veggie_goal %> +

+ +

+ Fruit goal: + <%= @weekly_diet.fruit_goal %> +

+ +

+ Protein goal: + <%= @weekly_diet.protein_goal %> +

+ +

+ Dairy goal: + <%= @weekly_diet.dairy_goal %> +

+ +

+ Water goal: + <%= @weekly_diet.water_goal %> +

+ +

+ Sweets goal: + <%= @weekly_diet.sweets_goal %> +

+ +

+ Carbs eaten: + <%= @weekly_diet.carbs_eaten %> +

+ +

+ Veggie eaten: + <%= @weekly_diet.veggie_eaten %> +

+ +

+ Fruit eaten: + <%= @weekly_diet.fruit_eaten %> +

+ +

+ Protein eaten: + <%= @weekly_diet.protein_eaten %> +

+ +

+ Dairy eaten: + <%= @weekly_diet.dairy_eaten %> +

+ +

+ Water eaten: + <%= @weekly_diet.water_eaten %> +

+ +

+ Sweets eaten: + <%= @weekly_diet.sweets_eaten %> +

+ + +<%= link_to 'Edit', edit_weekly_diet_path(@weekly_diet) %> | +<%= link_to 'Back', weekly_diets_path %> diff --git a/config.ru b/config.ru new file mode 100644 index 0000000..313714c --- /dev/null +++ b/config.ru @@ -0,0 +1,4 @@ +# This file is used by Rack-based servers to start the application. + +require ::File.expand_path('../config/environment', __FILE__) +run Fitkids::Application diff --git a/config/application.rb b/config/application.rb new file mode 100644 index 0000000..4ff6417 --- /dev/null +++ b/config/application.rb @@ -0,0 +1,62 @@ +require File.expand_path('../boot', __FILE__) + +require 'rails/all' + +if defined?(Bundler) + # If you precompile assets before deploying to production, use this line + Bundler.require(*Rails.groups(:assets => %w(development test))) + # If you want your assets lazily compiled in production, use this line + # Bundler.require(:default, :assets, Rails.env) +end + +module Fitkids + class Application < Rails::Application + # Settings in config/environments/* take precedence over those specified here. + # Application configuration should go into files in config/initializers + # -- all .rb files in that directory are automatically loaded. + + # Custom directories with classes and modules you want to be autoloadable. + # config.autoload_paths += %W(#{config.root}/extras) + + # Only load the plugins named here, in the order given (default is alphabetical). + # :all can be used as a placeholder for all plugins not explicitly named. + # config.plugins = [ :exception_notification, :ssl_requirement, :all ] + + # Activate observers that should always be running. + # config.active_record.observers = :cacher, :garbage_collector, :forum_observer + + # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. + # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. + # config.time_zone = 'Central Time (US & Canada)' + + # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. + # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] + # config.i18n.default_locale = :de + + # Configure the default encoding used in templates for Ruby 1.9. + config.encoding = "utf-8" + + # Configure sensitive parameters which will be filtered from the log file. + config.filter_parameters += [:password] + + # Enable escaping HTML in JSON. + config.active_support.escape_html_entities_in_json = true + + # Use SQL instead of Active Record's schema dumper when creating the database. + # This is necessary if your schema can't be completely dumped by the schema dumper, + # like if you have constraints or database-specific column types + # config.active_record.schema_format = :sql + + # Enforce whitelist mode for mass assignment. + # This will create an empty whitelist of attributes available for mass-assignment for all models + # in your app. As such, your models will need to explicitly whitelist or blacklist accessible + # parameters by using an attr_accessible or attr_protected declaration. + config.active_record.whitelist_attributes = true + + # Enable the asset pipeline + config.assets.enabled = true + + # Version of your assets, change this if you want to expire all your assets + config.assets.version = '1.0' + end +end diff --git a/config/boot.rb b/config/boot.rb new file mode 100644 index 0000000..4489e58 --- /dev/null +++ b/config/boot.rb @@ -0,0 +1,6 @@ +require 'rubygems' + +# Set up gems listed in the Gemfile. +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) + +require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) diff --git a/config/database.yml b/config/database.yml new file mode 100644 index 0000000..51a4dd4 --- /dev/null +++ b/config/database.yml @@ -0,0 +1,25 @@ +# SQLite version 3.x +# gem install sqlite3 +# +# Ensure the SQLite 3 gem is defined in your Gemfile +# gem 'sqlite3' +development: + adapter: sqlite3 + database: db/development.sqlite3 + pool: 5 + timeout: 5000 + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + adapter: sqlite3 + database: db/test.sqlite3 + pool: 5 + timeout: 5000 + +production: + adapter: sqlite3 + database: db/production.sqlite3 + pool: 5 + timeout: 5000 diff --git a/config/environment.rb b/config/environment.rb new file mode 100644 index 0000000..0f728e8 --- /dev/null +++ b/config/environment.rb @@ -0,0 +1,5 @@ +# Load the rails application +require File.expand_path('../application', __FILE__) + +# Initialize the rails application +Fitkids::Application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb new file mode 100644 index 0000000..b7e66e7 --- /dev/null +++ b/config/environments/development.rb @@ -0,0 +1,37 @@ +Fitkids::Application.configure do + # Settings specified here will take precedence over those in config/application.rb + + # In the development environment your application's code is reloaded on + # every request. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. + config.cache_classes = false + + # Log error messages when you accidentally call methods on nil. + config.whiny_nils = true + + # Show full error reports and disable caching + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Don't care if the mailer can't send + config.action_mailer.raise_delivery_errors = false + + # Print deprecation notices to the Rails logger + config.active_support.deprecation = :log + + # Only use best-standards-support built into browsers + config.action_dispatch.best_standards_support = :builtin + + # Raise exception on mass assignment protection for Active Record models + config.active_record.mass_assignment_sanitizer = :strict + + # Log the query plan for queries taking more than this (works + # with SQLite, MySQL, and PostgreSQL) + config.active_record.auto_explain_threshold_in_seconds = 0.5 + + # Do not compress assets + config.assets.compress = false + + # Expands the lines which load the assets + config.assets.debug = true +end diff --git a/config/environments/production.rb b/config/environments/production.rb new file mode 100644 index 0000000..b52be7e --- /dev/null +++ b/config/environments/production.rb @@ -0,0 +1,67 @@ +Fitkids::Application.configure do + # Settings specified here will take precedence over those in config/application.rb + + # Code is not reloaded between requests + config.cache_classes = true + + # Full error reports are disabled and caching is turned on + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Disable Rails's static asset server (Apache or nginx will already do this) + config.serve_static_assets = false + + # Compress JavaScripts and CSS + config.assets.compress = true + + # Don't fallback to assets pipeline if a precompiled asset is missed + config.assets.compile = false + + # Generate digests for assets URLs + config.assets.digest = true + + # Defaults to nil and saved in location specified by config.assets.prefix + # config.assets.manifest = YOUR_PATH + + # Specifies the header that your server uses for sending files + # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true + + # See everything in the log (default is :info) + # config.log_level = :debug + + # Prepend all log lines with the following tags + # config.log_tags = [ :subdomain, :uuid ] + + # Use a different logger for distributed setups + # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) + + # Use a different cache store in production + # config.cache_store = :mem_cache_store + + # Enable serving of images, stylesheets, and JavaScripts from an asset server + # config.action_controller.asset_host = "http://assets.example.com" + + # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) + # config.assets.precompile += %w( search.js ) + + # Disable delivery errors, bad email addresses will be ignored + # config.action_mailer.raise_delivery_errors = false + + # Enable threaded mode + # config.threadsafe! + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation can not be found) + config.i18n.fallbacks = true + + # Send deprecation notices to registered listeners + config.active_support.deprecation = :notify + + # Log the query plan for queries taking more than this (works + # with SQLite, MySQL, and PostgreSQL) + # config.active_record.auto_explain_threshold_in_seconds = 0.5 +end diff --git a/config/environments/test.rb b/config/environments/test.rb new file mode 100644 index 0000000..9a788b9 --- /dev/null +++ b/config/environments/test.rb @@ -0,0 +1,37 @@ +Fitkids::Application.configure do + # Settings specified here will take precedence over those in config/application.rb + + # The test environment is used exclusively to run your application's + # test suite. You never need to work with it otherwise. Remember that + # your test database is "scratch space" for the test suite and is wiped + # and recreated between test runs. Don't rely on the data there! + config.cache_classes = true + + # Configure static asset server for tests with Cache-Control for performance + config.serve_static_assets = true + config.static_cache_control = "public, max-age=3600" + + # Log error messages when you accidentally call methods on nil + config.whiny_nils = true + + # Show full error reports and disable caching + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Raise exceptions instead of rendering exception templates + config.action_dispatch.show_exceptions = false + + # Disable request forgery protection in test environment + config.action_controller.allow_forgery_protection = false + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Raise exception on mass assignment protection for Active Record models + config.active_record.mass_assignment_sanitizer = :strict + + # Print deprecation notices to the stderr + config.active_support.deprecation = :stderr +end diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb new file mode 100644 index 0000000..59385cd --- /dev/null +++ b/config/initializers/backtrace_silencers.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. +# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } + +# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. +# Rails.backtrace_cleaner.remove_silencers! diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb new file mode 100644 index 0000000..5d8d9be --- /dev/null +++ b/config/initializers/inflections.rb @@ -0,0 +1,15 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format +# (all these examples are active by default): +# ActiveSupport::Inflector.inflections do |inflect| +# inflect.plural /^(ox)$/i, '\1en' +# inflect.singular /^(ox)en/i, '\1' +# inflect.irregular 'person', 'people' +# inflect.uncountable %w( fish sheep ) +# end +# +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections do |inflect| +# inflect.acronym 'RESTful' +# end diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb new file mode 100644 index 0000000..72aca7e --- /dev/null +++ b/config/initializers/mime_types.rb @@ -0,0 +1,5 @@ +# Be sure to restart your server when you modify this file. + +# Add new mime types for use in respond_to blocks: +# Mime::Type.register "text/richtext", :rtf +# Mime::Type.register_alias "text/html", :iphone diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb new file mode 100644 index 0000000..b193285 --- /dev/null +++ b/config/initializers/secret_token.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +# Your secret key for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +Fitkids::Application.config.secret_token = '3611c66e6e54ad2b4be4caf75e83534b2f2eb1f29a228db1dde010ac502f8d5cef79c89f1bf76419fa70274d818fd31734a3f60f9bc7149a5641e9e202390d1f' diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb new file mode 100644 index 0000000..3838427 --- /dev/null +++ b/config/initializers/session_store.rb @@ -0,0 +1,8 @@ +# Be sure to restart your server when you modify this file. + +Fitkids::Application.config.session_store :cookie_store, key: '_fitkids_session' + +# Use the database for sessions instead of the cookie-based default, +# which shouldn't be used to store highly confidential information +# (create the session table with "rails generate session_migration") +# Fitkids::Application.config.session_store :active_record_store diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb new file mode 100644 index 0000000..999df20 --- /dev/null +++ b/config/initializers/wrap_parameters.rb @@ -0,0 +1,14 @@ +# Be sure to restart your server when you modify this file. +# +# This file contains settings for ActionController::ParamsWrapper which +# is enabled by default. + +# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. +ActiveSupport.on_load(:action_controller) do + wrap_parameters format: [:json] +end + +# Disable root element in JSON by default. +ActiveSupport.on_load(:active_record) do + self.include_root_in_json = false +end diff --git a/config/locales/en.yml b/config/locales/en.yml new file mode 100644 index 0000000..179c14c --- /dev/null +++ b/config/locales/en.yml @@ -0,0 +1,5 @@ +# Sample localization file for English. Add more files in this directory for other locales. +# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +en: + hello: "Hello world" diff --git a/config/routes.rb b/config/routes.rb new file mode 100644 index 0000000..67afd76 --- /dev/null +++ b/config/routes.rb @@ -0,0 +1,91 @@ +Fitkids::Application.routes.draw do + resources :monitor_profiles + + + resources :leaderboards + + + resources :articles + + + resources :features + + + resources :avatars + + + resources :exercises + + + resources :regimen + + + resources :monitor_child_relations + + + resources :children + + + resources :tags + + + resources :weekly_diets + + + # The priority is based upon order of creation: + # first created -> highest priority. + + # Sample of regular route: + # match 'products/:id' => 'catalog#view' + # Keep in mind you can assign values other than :controller and :action + + # 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 diff --git a/db/migrate/20130305005752_create_weekly_diets.rb b/db/migrate/20130305005752_create_weekly_diets.rb new file mode 100644 index 0000000..f65592b --- /dev/null +++ b/db/migrate/20130305005752_create_weekly_diets.rb @@ -0,0 +1,22 @@ +class CreateWeeklyDiets < ActiveRecord::Migration + def change + create_table :weekly_diets do |t| + t.int :carb_goal, :default => 0 + t.int :veggie_goal, :default => 0 + t.int :fruit_goal, :default => 0 + t.int :protein_goal, :default => 0 + t.int :dairy_goal, :default => 0 + t.int :water_goal, :default => 0 + t.int :sweets_goal, :default => 0 + t.int :carbs_eaten, :default => 0 + t.int :veggie_eaten, :default => 0 + t.int :fruit_eaten, :default => 0 + t.int :protein_eaten, :default => 0 + t.int :dairy_eaten, :default => 0 + t.int :water_eaten, :default => 0 + t.int :sweets_eaten, :default => 0 + + t.timestamps + end + end +end diff --git a/db/migrate/20130305033129_create_tags.rb b/db/migrate/20130305033129_create_tags.rb new file mode 100644 index 0000000..d7e1fee --- /dev/null +++ b/db/migrate/20130305033129_create_tags.rb @@ -0,0 +1,9 @@ +class CreateTags < ActiveRecord::Migration + def change + create_table :tags do |t| + t.string :tag_name, :null => false + + t.timestamps + end + end +end diff --git a/db/migrate/20130305033217_create_children.rb b/db/migrate/20130305033217_create_children.rb new file mode 100644 index 0000000..d5b9561 --- /dev/null +++ b/db/migrate/20130305033217_create_children.rb @@ -0,0 +1,16 @@ +class CreateChildren < ActiveRecord::Migration + def change + create_table :children do |t| + t.string :name, :null => false + t.int :height, :null => false + t.int :weight, :null => false + t.int :age, :null => false + t.int :exp, :default => 0 + t.reference :avatar + t.reference :weekly_diet + t.reference :regimen + + t.timestamps + end + end +end diff --git a/db/migrate/20130305033224_create_monitor_child_relations.rb b/db/migrate/20130305033224_create_monitor_child_relations.rb new file mode 100644 index 0000000..47ce7e8 --- /dev/null +++ b/db/migrate/20130305033224_create_monitor_child_relations.rb @@ -0,0 +1,11 @@ +class CreateMonitorChildRelations < ActiveRecord::Migration + def change + create_table :monitor_child_relations do |t| + t.string :relation + t.reference :child + t.reference :monitor + + t.timestamps + end + end +end diff --git a/db/migrate/20130305033228_create_regimen.rb b/db/migrate/20130305033228_create_regimen.rb new file mode 100644 index 0000000..b3ca69a --- /dev/null +++ b/db/migrate/20130305033228_create_regimen.rb @@ -0,0 +1,9 @@ +class CreateRegimen < ActiveRecord::Migration + def change + create_table :regimen do |t| + t.reference :exercise + + t.timestamps + end + end +end diff --git a/db/migrate/20130305033232_create_exercises.rb b/db/migrate/20130305033232_create_exercises.rb new file mode 100644 index 0000000..388d663 --- /dev/null +++ b/db/migrate/20130305033232_create_exercises.rb @@ -0,0 +1,10 @@ +class CreateExercises < ActiveRecord::Migration + def change + create_table :exercises do |t| + t.reference :exercise_type + t.int :reps + + t.timestamps + end + end +end diff --git a/db/migrate/20130305033236_create_avatars.rb b/db/migrate/20130305033236_create_avatars.rb new file mode 100644 index 0000000..8365227 --- /dev/null +++ b/db/migrate/20130305033236_create_avatars.rb @@ -0,0 +1,13 @@ +class CreateAvatars < ActiveRecord::Migration + def change + create_table :avatars do |t| + t.string :name, :null => false + t.string :color, default => "green" + t.text :story + t.binary :image + t.reference :features + + t.timestamps + end + end +end diff --git a/db/migrate/20130305033240_create_features.rb b/db/migrate/20130305033240_create_features.rb new file mode 100644 index 0000000..8fc8622 --- /dev/null +++ b/db/migrate/20130305033240_create_features.rb @@ -0,0 +1,11 @@ +class CreateFeatures < ActiveRecord::Migration + def change + create_table :features do |t| + t.string :feature_type, :null => false + t.string :color, :defailt => "green" + t.binary :image + + t.timestamps + end + end +end diff --git a/db/migrate/20130305033245_create_articles.rb b/db/migrate/20130305033245_create_articles.rb new file mode 100644 index 0000000..51f3481 --- /dev/null +++ b/db/migrate/20130305033245_create_articles.rb @@ -0,0 +1,11 @@ +class CreateArticles < ActiveRecord::Migration + def change + create_table :articles do |t| + t.string :title , :null => false + t.text :content + t.reference :tag + + t.timestamps + end + end +end diff --git a/db/migrate/20130305033249_create_leaderboards.rb b/db/migrate/20130305033249_create_leaderboards.rb new file mode 100644 index 0000000..4c87207 --- /dev/null +++ b/db/migrate/20130305033249_create_leaderboards.rb @@ -0,0 +1,10 @@ +class CreateLeaderboards < ActiveRecord::Migration + def change + create_table :leaderboards do |t| + t.string :board_type + t.reference :child + + t.timestamps + end + end +end diff --git a/db/migrate/20130305033355_create_monitor_profiles.rb b/db/migrate/20130305033355_create_monitor_profiles.rb new file mode 100644 index 0000000..2d83767 --- /dev/null +++ b/db/migrate/20130305033355_create_monitor_profiles.rb @@ -0,0 +1,12 @@ +class CreateMonitorProfiles < ActiveRecord::Migration + def change + create_table :monitor_profiles do |t| + t.string :name, :default => false + t.binary :picture + t.reference :tag + t.reference :article + + t.timestamps + end + end +end diff --git a/db/seeds.rb b/db/seeds.rb new file mode 100644 index 0000000..4edb1e8 --- /dev/null +++ b/db/seeds.rb @@ -0,0 +1,7 @@ +# This file should contain all the record creation needed to seed the database with its default values. +# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). +# +# Examples: +# +# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) +# Mayor.create(name: 'Emanuel', city: cities.first) diff --git a/doc/README_FOR_APP b/doc/README_FOR_APP new file mode 100644 index 0000000..fe41f5c --- /dev/null +++ b/doc/README_FOR_APP @@ -0,0 +1,2 @@ +Use this README file to introduce your application and point to useful places in the API for learning more. +Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries. diff --git a/lib/assets/.gitkeep b/lib/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/lib/tasks/.gitkeep b/lib/tasks/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/log/.gitkeep b/log/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/makeScaffolds b/makeScaffolds new file mode 100644 index 0000000..cd26c4a --- /dev/null +++ b/makeScaffolds @@ -0,0 +1,11 @@ +rails generate scaffold articlecontent:text, tag:reference, title:string +rails generate scaffold avatar color:string, features:reference, image:binary, name:string, story:text +rails generate scaffold child age:int, avatar:reference, exp:int, height:int, name:string, regimen:reference, weekly_diet:reference, weight:int +rails generate scaffold exercise exercise_type:string, reps:int +rails generate scaffold feature color:string, feature_type:string, image:binary +rails generate scaffold board_type:string, child:reference +rails generate scaffold monitorChildRelationship child:reference, monitor_profile:reference, relation:string +rails generate scaffold monitor_profile article:reference, name:string, picture:binary, tag:reference +rais generate scaffold regiman exercise:reference +rails generate scaffold tag tag_name:string +rails generate scaffold weekly_diet carb_goal:int, carbs_eaten:int, dairy_eaten:int, dairy_goal:int, fruit_eaten:int, fruit_goal:int, protein_eaten:int, protein_goal:int, sweets_eaten:int, sweets_goal:int, veggie_eaten:int, veggie_goal:int, water_eaten:int, water_goal:int \ No newline at end of file diff --git a/public/404.html b/public/404.html new file mode 100644 index 0000000..9a48320 --- /dev/null +++ b/public/404.html @@ -0,0 +1,26 @@ + + + + The page you were looking for doesn't exist (404) + + + + + +
+

The page you were looking for doesn't exist.

+

You may have mistyped the address or the page may have moved.

+
+ + diff --git a/public/422.html b/public/422.html new file mode 100644 index 0000000..83660ab --- /dev/null +++ b/public/422.html @@ -0,0 +1,26 @@ + + + + The change you wanted was rejected (422) + + + + + +
+

The change you wanted was rejected.

+

Maybe you tried to change something you didn't have access to.

+
+ + diff --git a/public/500.html b/public/500.html new file mode 100644 index 0000000..f3648a0 --- /dev/null +++ b/public/500.html @@ -0,0 +1,25 @@ + + + + We're sorry, but something went wrong (500) + + + + + +
+

We're sorry, but something went wrong.

+
+ + diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..e69de29 diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..a1d5099 --- /dev/null +++ b/public/index.html @@ -0,0 +1,241 @@ + + + + Ruby on Rails: Welcome aboard + + + + +
+ + +
+ + + + +
+

Getting started

+

Here’s how to get rolling:

+ +
    +
  1. +

    Use rails generate to create your models and controllers

    +

    To see all available options, run it without parameters.

    +
  2. + +
  3. +

    Set up a default route and remove public/index.html

    +

    Routes are set up in config/routes.rb.

    +
  4. + +
  5. +

    Create your database

    +

    Run rake db:create to create your database. If you're not using SQLite (the default), edit config/database.yml with your username and password.

    +
  6. +
+
+
+ + +
+ + diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..085187f --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,5 @@ +# See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file +# +# To ban all spiders from the entire site uncomment the next two lines: +# User-Agent: * +# Disallow: / diff --git a/script/rails b/script/rails new file mode 100755 index 0000000..f8da2cf --- /dev/null +++ b/script/rails @@ -0,0 +1,6 @@ +#!/usr/bin/env ruby +# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. + +APP_PATH = File.expand_path('../../config/application', __FILE__) +require File.expand_path('../../config/boot', __FILE__) +require 'rails/commands' diff --git a/test/fixtures/.gitkeep b/test/fixtures/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/test/fixtures/articles.yml b/test/fixtures/articles.yml new file mode 100644 index 0000000..116f8fd --- /dev/null +++ b/test/fixtures/articles.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html + +one: + title: MyString + content: MyText + tag: + +two: + title: MyString + content: MyText + tag: diff --git a/test/fixtures/avatars.yml b/test/fixtures/avatars.yml new file mode 100644 index 0000000..d1d37a2 --- /dev/null +++ b/test/fixtures/avatars.yml @@ -0,0 +1,15 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html + +one: + name: MyString + color: MyString + story: MyText + image: + features: + +two: + name: MyString + color: MyString + story: MyText + image: + features: diff --git a/test/fixtures/children.yml b/test/fixtures/children.yml new file mode 100644 index 0000000..c77e3f6 --- /dev/null +++ b/test/fixtures/children.yml @@ -0,0 +1,21 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html + +one: + name: MyString + height: + weight: + age: + exp: + avatar: + weekly_diet: + regimen: + +two: + name: MyString + height: + weight: + age: + exp: + avatar: + weekly_diet: + regimen: diff --git a/test/fixtures/exercises.yml b/test/fixtures/exercises.yml new file mode 100644 index 0000000..e44ac2b --- /dev/null +++ b/test/fixtures/exercises.yml @@ -0,0 +1,9 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html + +one: + exercise_type: + reps: + +two: + exercise_type: + reps: diff --git a/test/fixtures/features.yml b/test/fixtures/features.yml new file mode 100644 index 0000000..75bf837 --- /dev/null +++ b/test/fixtures/features.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html + +one: + feature_type: MyString + color: MyString + image: + +two: + feature_type: MyString + color: MyString + image: diff --git a/test/fixtures/leaderboards.yml b/test/fixtures/leaderboards.yml new file mode 100644 index 0000000..b294dc7 --- /dev/null +++ b/test/fixtures/leaderboards.yml @@ -0,0 +1,9 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html + +one: + board_type: MyString + child: + +two: + board_type: MyString + child: diff --git a/test/fixtures/monitor_child_relations.yml b/test/fixtures/monitor_child_relations.yml new file mode 100644 index 0000000..e84a7bc --- /dev/null +++ b/test/fixtures/monitor_child_relations.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html + +one: + relation: MyString + child: + monitor: + +two: + relation: MyString + child: + monitor: diff --git a/test/fixtures/monitor_profiles.yml b/test/fixtures/monitor_profiles.yml new file mode 100644 index 0000000..d3f3eb7 --- /dev/null +++ b/test/fixtures/monitor_profiles.yml @@ -0,0 +1,13 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html + +one: + name: MyString + picture: + tag: + article: + +two: + name: MyString + picture: + tag: + article: diff --git a/test/fixtures/regimen.yml b/test/fixtures/regimen.yml new file mode 100644 index 0000000..2be9277 --- /dev/null +++ b/test/fixtures/regimen.yml @@ -0,0 +1,7 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html + +one: + exercise: + +two: + exercise: diff --git a/test/fixtures/tags.yml b/test/fixtures/tags.yml new file mode 100644 index 0000000..3240de5 --- /dev/null +++ b/test/fixtures/tags.yml @@ -0,0 +1,7 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html + +one: + tag_name: MyString + +two: + tag_name: MyString diff --git a/test/fixtures/weekly_diets.yml b/test/fixtures/weekly_diets.yml new file mode 100644 index 0000000..ab43501 --- /dev/null +++ b/test/fixtures/weekly_diets.yml @@ -0,0 +1,33 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html + +one: + carb_goal: + veggie_goal: + fruit_goal: + protein_goal: + dairy_goal: + water_goal: + sweets_goal: + carbs_eaten: + veggie_eaten: + fruit_eaten: + protein_eaten: + dairy_eaten: + water_eaten: + sweets_eaten: + +two: + carb_goal: + veggie_goal: + fruit_goal: + protein_goal: + dairy_goal: + water_goal: + sweets_goal: + carbs_eaten: + veggie_eaten: + fruit_eaten: + protein_eaten: + dairy_eaten: + water_eaten: + sweets_eaten: diff --git a/test/functional/.gitkeep b/test/functional/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/test/functional/articles_controller_test.rb b/test/functional/articles_controller_test.rb new file mode 100644 index 0000000..013b779 --- /dev/null +++ b/test/functional/articles_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class ArticlesControllerTest < ActionController::TestCase + setup do + @article = articles(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:articles) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create article" do + assert_difference('Article.count') do + post :create, article: { content: @article.content, tag: @article.tag, title: @article.title } + end + + assert_redirected_to article_path(assigns(:article)) + end + + test "should show article" do + get :show, id: @article + assert_response :success + end + + test "should get edit" do + get :edit, id: @article + assert_response :success + end + + test "should update article" do + put :update, id: @article, article: { content: @article.content, tag: @article.tag, title: @article.title } + assert_redirected_to article_path(assigns(:article)) + end + + test "should destroy article" do + assert_difference('Article.count', -1) do + delete :destroy, id: @article + end + + assert_redirected_to articles_path + end +end diff --git a/test/functional/avatars_controller_test.rb b/test/functional/avatars_controller_test.rb new file mode 100644 index 0000000..f3868c8 --- /dev/null +++ b/test/functional/avatars_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class AvatarsControllerTest < ActionController::TestCase + setup do + @avatar = avatars(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:avatars) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create avatar" do + assert_difference('Avatar.count') do + post :create, avatar: { color: @avatar.color, features: @avatar.features, image: @avatar.image, name: @avatar.name, story: @avatar.story } + end + + assert_redirected_to avatar_path(assigns(:avatar)) + end + + test "should show avatar" do + get :show, id: @avatar + assert_response :success + end + + test "should get edit" do + get :edit, id: @avatar + assert_response :success + end + + test "should update avatar" do + put :update, id: @avatar, avatar: { color: @avatar.color, features: @avatar.features, image: @avatar.image, name: @avatar.name, story: @avatar.story } + assert_redirected_to avatar_path(assigns(:avatar)) + end + + test "should destroy avatar" do + assert_difference('Avatar.count', -1) do + delete :destroy, id: @avatar + end + + assert_redirected_to avatars_path + end +end diff --git a/test/functional/children_controller_test.rb b/test/functional/children_controller_test.rb new file mode 100644 index 0000000..4933479 --- /dev/null +++ b/test/functional/children_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class ChildrenControllerTest < ActionController::TestCase + setup do + @child = children(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:children) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create child" do + assert_difference('Child.count') do + post :create, child: { age: @child.age, avatar: @child.avatar, exp: @child.exp, height: @child.height, name: @child.name, regimen: @child.regimen, weekly_diet: @child.weekly_diet, weight: @child.weight } + end + + assert_redirected_to child_path(assigns(:child)) + end + + test "should show child" do + get :show, id: @child + assert_response :success + end + + test "should get edit" do + get :edit, id: @child + assert_response :success + end + + test "should update child" do + put :update, id: @child, child: { age: @child.age, avatar: @child.avatar, exp: @child.exp, height: @child.height, name: @child.name, regimen: @child.regimen, weekly_diet: @child.weekly_diet, weight: @child.weight } + assert_redirected_to child_path(assigns(:child)) + end + + test "should destroy child" do + assert_difference('Child.count', -1) do + delete :destroy, id: @child + end + + assert_redirected_to children_path + end +end diff --git a/test/functional/exercises_controller_test.rb b/test/functional/exercises_controller_test.rb new file mode 100644 index 0000000..40ab636 --- /dev/null +++ b/test/functional/exercises_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class ExercisesControllerTest < ActionController::TestCase + setup do + @exercise = exercises(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:exercises) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create exercise" do + assert_difference('Exercise.count') do + post :create, exercise: { exercise_type: @exercise.exercise_type, reps: @exercise.reps } + end + + assert_redirected_to exercise_path(assigns(:exercise)) + end + + test "should show exercise" do + get :show, id: @exercise + assert_response :success + end + + test "should get edit" do + get :edit, id: @exercise + assert_response :success + end + + test "should update exercise" do + put :update, id: @exercise, exercise: { exercise_type: @exercise.exercise_type, reps: @exercise.reps } + assert_redirected_to exercise_path(assigns(:exercise)) + end + + test "should destroy exercise" do + assert_difference('Exercise.count', -1) do + delete :destroy, id: @exercise + end + + assert_redirected_to exercises_path + end +end diff --git a/test/functional/features_controller_test.rb b/test/functional/features_controller_test.rb new file mode 100644 index 0000000..b8743e9 --- /dev/null +++ b/test/functional/features_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class FeaturesControllerTest < ActionController::TestCase + setup do + @feature = features(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:features) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create feature" do + assert_difference('Feature.count') do + post :create, feature: { color: @feature.color, feature_type: @feature.feature_type, image: @feature.image } + end + + assert_redirected_to feature_path(assigns(:feature)) + end + + test "should show feature" do + get :show, id: @feature + assert_response :success + end + + test "should get edit" do + get :edit, id: @feature + assert_response :success + end + + test "should update feature" do + put :update, id: @feature, feature: { color: @feature.color, feature_type: @feature.feature_type, image: @feature.image } + assert_redirected_to feature_path(assigns(:feature)) + end + + test "should destroy feature" do + assert_difference('Feature.count', -1) do + delete :destroy, id: @feature + end + + assert_redirected_to features_path + end +end diff --git a/test/functional/leaderboards_controller_test.rb b/test/functional/leaderboards_controller_test.rb new file mode 100644 index 0000000..8aabcae --- /dev/null +++ b/test/functional/leaderboards_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class LeaderboardsControllerTest < ActionController::TestCase + setup do + @leaderboard = leaderboards(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:leaderboards) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create leaderboard" do + assert_difference('Leaderboard.count') do + post :create, leaderboard: { board_type: @leaderboard.board_type, child: @leaderboard.child } + end + + assert_redirected_to leaderboard_path(assigns(:leaderboard)) + end + + test "should show leaderboard" do + get :show, id: @leaderboard + assert_response :success + end + + test "should get edit" do + get :edit, id: @leaderboard + assert_response :success + end + + test "should update leaderboard" do + put :update, id: @leaderboard, leaderboard: { board_type: @leaderboard.board_type, child: @leaderboard.child } + assert_redirected_to leaderboard_path(assigns(:leaderboard)) + end + + test "should destroy leaderboard" do + assert_difference('Leaderboard.count', -1) do + delete :destroy, id: @leaderboard + end + + assert_redirected_to leaderboards_path + end +end diff --git a/test/functional/monitor_child_relations_controller_test.rb b/test/functional/monitor_child_relations_controller_test.rb new file mode 100644 index 0000000..a6d8b7f --- /dev/null +++ b/test/functional/monitor_child_relations_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class MonitorChildRelationsControllerTest < ActionController::TestCase + setup do + @monitor_child_relation = monitor_child_relations(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:monitor_child_relations) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create monitor_child_relation" do + assert_difference('MonitorChildRelation.count') do + post :create, monitor_child_relation: { child: @monitor_child_relation.child, monitor: @monitor_child_relation.monitor, relation: @monitor_child_relation.relation } + end + + assert_redirected_to monitor_child_relation_path(assigns(:monitor_child_relation)) + end + + test "should show monitor_child_relation" do + get :show, id: @monitor_child_relation + assert_response :success + end + + test "should get edit" do + get :edit, id: @monitor_child_relation + assert_response :success + end + + test "should update monitor_child_relation" do + put :update, id: @monitor_child_relation, monitor_child_relation: { child: @monitor_child_relation.child, monitor: @monitor_child_relation.monitor, relation: @monitor_child_relation.relation } + assert_redirected_to monitor_child_relation_path(assigns(:monitor_child_relation)) + end + + test "should destroy monitor_child_relation" do + assert_difference('MonitorChildRelation.count', -1) do + delete :destroy, id: @monitor_child_relation + end + + assert_redirected_to monitor_child_relations_path + end +end diff --git a/test/functional/monitor_profiles_controller_test.rb b/test/functional/monitor_profiles_controller_test.rb new file mode 100644 index 0000000..9977a73 --- /dev/null +++ b/test/functional/monitor_profiles_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class MonitorProfilesControllerTest < ActionController::TestCase + setup do + @monitor_profile = monitor_profiles(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:monitor_profiles) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create monitor_profile" do + assert_difference('MonitorProfile.count') do + post :create, monitor_profile: { article: @monitor_profile.article, name: @monitor_profile.name, picture: @monitor_profile.picture, tag: @monitor_profile.tag } + end + + assert_redirected_to monitor_profile_path(assigns(:monitor_profile)) + end + + test "should show monitor_profile" do + get :show, id: @monitor_profile + assert_response :success + end + + test "should get edit" do + get :edit, id: @monitor_profile + assert_response :success + end + + test "should update monitor_profile" do + put :update, id: @monitor_profile, monitor_profile: { article: @monitor_profile.article, name: @monitor_profile.name, picture: @monitor_profile.picture, tag: @monitor_profile.tag } + assert_redirected_to monitor_profile_path(assigns(:monitor_profile)) + end + + test "should destroy monitor_profile" do + assert_difference('MonitorProfile.count', -1) do + delete :destroy, id: @monitor_profile + end + + assert_redirected_to monitor_profiles_path + end +end diff --git a/test/functional/regimen_controller_test.rb b/test/functional/regimen_controller_test.rb new file mode 100644 index 0000000..f642dec --- /dev/null +++ b/test/functional/regimen_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class RegimenControllerTest < ActionController::TestCase + setup do + @regiman = regimen(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:regimen) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create regiman" do + assert_difference('Regiman.count') do + post :create, regiman: { exercise: @regiman.exercise } + end + + assert_redirected_to regiman_path(assigns(:regiman)) + end + + test "should show regiman" do + get :show, id: @regiman + assert_response :success + end + + test "should get edit" do + get :edit, id: @regiman + assert_response :success + end + + test "should update regiman" do + put :update, id: @regiman, regiman: { exercise: @regiman.exercise } + assert_redirected_to regiman_path(assigns(:regiman)) + end + + test "should destroy regiman" do + assert_difference('Regiman.count', -1) do + delete :destroy, id: @regiman + end + + assert_redirected_to regimen_path + end +end diff --git a/test/functional/tags_controller_test.rb b/test/functional/tags_controller_test.rb new file mode 100644 index 0000000..20c804b --- /dev/null +++ b/test/functional/tags_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class TagsControllerTest < ActionController::TestCase + setup do + @tag = tags(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:tags) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create tag" do + assert_difference('Tag.count') do + post :create, tag: { tag_name: @tag.tag_name } + end + + assert_redirected_to tag_path(assigns(:tag)) + end + + test "should show tag" do + get :show, id: @tag + assert_response :success + end + + test "should get edit" do + get :edit, id: @tag + assert_response :success + end + + test "should update tag" do + put :update, id: @tag, tag: { tag_name: @tag.tag_name } + assert_redirected_to tag_path(assigns(:tag)) + end + + test "should destroy tag" do + assert_difference('Tag.count', -1) do + delete :destroy, id: @tag + end + + assert_redirected_to tags_path + end +end diff --git a/test/functional/weekly_diets_controller_test.rb b/test/functional/weekly_diets_controller_test.rb new file mode 100644 index 0000000..e2004f4 --- /dev/null +++ b/test/functional/weekly_diets_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class WeeklyDietsControllerTest < ActionController::TestCase + setup do + @weekly_diet = weekly_diets(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:weekly_diets) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create weekly_diet" do + assert_difference('WeeklyDiet.count') do + post :create, weekly_diet: { carb_goal: @weekly_diet.carb_goal, carbs_eaten: @weekly_diet.carbs_eaten, dairy_eaten: @weekly_diet.dairy_eaten, dairy_goal: @weekly_diet.dairy_goal, fruit_eaten: @weekly_diet.fruit_eaten, fruit_goal: @weekly_diet.fruit_goal, protein_eaten: @weekly_diet.protein_eaten, protein_goal: @weekly_diet.protein_goal, sweets_eaten: @weekly_diet.sweets_eaten, sweets_goal: @weekly_diet.sweets_goal, veggie_eaten: @weekly_diet.veggie_eaten, veggie_goal: @weekly_diet.veggie_goal, water_eaten: @weekly_diet.water_eaten, water_goal: @weekly_diet.water_goal } + end + + assert_redirected_to weekly_diet_path(assigns(:weekly_diet)) + end + + test "should show weekly_diet" do + get :show, id: @weekly_diet + assert_response :success + end + + test "should get edit" do + get :edit, id: @weekly_diet + assert_response :success + end + + test "should update weekly_diet" do + put :update, id: @weekly_diet, weekly_diet: { carb_goal: @weekly_diet.carb_goal, carbs_eaten: @weekly_diet.carbs_eaten, dairy_eaten: @weekly_diet.dairy_eaten, dairy_goal: @weekly_diet.dairy_goal, fruit_eaten: @weekly_diet.fruit_eaten, fruit_goal: @weekly_diet.fruit_goal, protein_eaten: @weekly_diet.protein_eaten, protein_goal: @weekly_diet.protein_goal, sweets_eaten: @weekly_diet.sweets_eaten, sweets_goal: @weekly_diet.sweets_goal, veggie_eaten: @weekly_diet.veggie_eaten, veggie_goal: @weekly_diet.veggie_goal, water_eaten: @weekly_diet.water_eaten, water_goal: @weekly_diet.water_goal } + assert_redirected_to weekly_diet_path(assigns(:weekly_diet)) + end + + test "should destroy weekly_diet" do + assert_difference('WeeklyDiet.count', -1) do + delete :destroy, id: @weekly_diet + end + + assert_redirected_to weekly_diets_path + end +end diff --git a/test/integration/.gitkeep b/test/integration/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/test/performance/browsing_test.rb b/test/performance/browsing_test.rb new file mode 100644 index 0000000..3fea27b --- /dev/null +++ b/test/performance/browsing_test.rb @@ -0,0 +1,12 @@ +require 'test_helper' +require 'rails/performance_test_help' + +class BrowsingTest < ActionDispatch::PerformanceTest + # Refer to the documentation for all available options + # self.profile_options = { :runs => 5, :metrics => [:wall_time, :memory] + # :output => 'tmp/performance', :formats => [:flat] } + + def test_homepage + get '/' + end +end diff --git a/test/test_helper.rb b/test/test_helper.rb new file mode 100644 index 0000000..8bf1192 --- /dev/null +++ b/test/test_helper.rb @@ -0,0 +1,13 @@ +ENV["RAILS_ENV"] = "test" +require File.expand_path('../../config/environment', __FILE__) +require 'rails/test_help' + +class ActiveSupport::TestCase + # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order. + # + # Note: You'll currently still have to declare fixtures explicitly in integration tests + # -- they do not yet inherit this setting + fixtures :all + + # Add more helper methods to be used by all tests here... +end diff --git a/test/unit/.gitkeep b/test/unit/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/test/unit/article_test.rb b/test/unit/article_test.rb new file mode 100644 index 0000000..11c8abe --- /dev/null +++ b/test/unit/article_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ArticleTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/unit/avatar_test.rb b/test/unit/avatar_test.rb new file mode 100644 index 0000000..ba744aa --- /dev/null +++ b/test/unit/avatar_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class AvatarTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/unit/child_test.rb b/test/unit/child_test.rb new file mode 100644 index 0000000..180d105 --- /dev/null +++ b/test/unit/child_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ChildTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/unit/exercise_test.rb b/test/unit/exercise_test.rb new file mode 100644 index 0000000..ee5d615 --- /dev/null +++ b/test/unit/exercise_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ExerciseTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/unit/feature_test.rb b/test/unit/feature_test.rb new file mode 100644 index 0000000..804a74c --- /dev/null +++ b/test/unit/feature_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class FeatureTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/unit/helpers/articles_helper_test.rb b/test/unit/helpers/articles_helper_test.rb new file mode 100644 index 0000000..b341344 --- /dev/null +++ b/test/unit/helpers/articles_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class ArticlesHelperTest < ActionView::TestCase +end diff --git a/test/unit/helpers/avatars_helper_test.rb b/test/unit/helpers/avatars_helper_test.rb new file mode 100644 index 0000000..2304d09 --- /dev/null +++ b/test/unit/helpers/avatars_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class AvatarsHelperTest < ActionView::TestCase +end diff --git a/test/unit/helpers/children_helper_test.rb b/test/unit/helpers/children_helper_test.rb new file mode 100644 index 0000000..ec4ce23 --- /dev/null +++ b/test/unit/helpers/children_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class ChildrenHelperTest < ActionView::TestCase +end diff --git a/test/unit/helpers/exercises_helper_test.rb b/test/unit/helpers/exercises_helper_test.rb new file mode 100644 index 0000000..5e9f89d --- /dev/null +++ b/test/unit/helpers/exercises_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class ExercisesHelperTest < ActionView::TestCase +end diff --git a/test/unit/helpers/features_helper_test.rb b/test/unit/helpers/features_helper_test.rb new file mode 100644 index 0000000..10945ee --- /dev/null +++ b/test/unit/helpers/features_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class FeaturesHelperTest < ActionView::TestCase +end diff --git a/test/unit/helpers/leaderboards_helper_test.rb b/test/unit/helpers/leaderboards_helper_test.rb new file mode 100644 index 0000000..b8b77f6 --- /dev/null +++ b/test/unit/helpers/leaderboards_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class LeaderboardsHelperTest < ActionView::TestCase +end diff --git a/test/unit/helpers/monitor_child_relations_helper_test.rb b/test/unit/helpers/monitor_child_relations_helper_test.rb new file mode 100644 index 0000000..12539f6 --- /dev/null +++ b/test/unit/helpers/monitor_child_relations_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class MonitorChildRelationsHelperTest < ActionView::TestCase +end diff --git a/test/unit/helpers/monitor_profiles_helper_test.rb b/test/unit/helpers/monitor_profiles_helper_test.rb new file mode 100644 index 0000000..4623c6e --- /dev/null +++ b/test/unit/helpers/monitor_profiles_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class MonitorProfilesHelperTest < ActionView::TestCase +end diff --git a/test/unit/helpers/regimen_helper_test.rb b/test/unit/helpers/regimen_helper_test.rb new file mode 100644 index 0000000..bd79e18 --- /dev/null +++ b/test/unit/helpers/regimen_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class RegimenHelperTest < ActionView::TestCase +end diff --git a/test/unit/helpers/tags_helper_test.rb b/test/unit/helpers/tags_helper_test.rb new file mode 100644 index 0000000..4b1935f --- /dev/null +++ b/test/unit/helpers/tags_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class TagsHelperTest < ActionView::TestCase +end diff --git a/test/unit/helpers/weekly_diets_helper_test.rb b/test/unit/helpers/weekly_diets_helper_test.rb new file mode 100644 index 0000000..0fca648 --- /dev/null +++ b/test/unit/helpers/weekly_diets_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class WeeklyDietsHelperTest < ActionView::TestCase +end diff --git a/test/unit/leaderboard_test.rb b/test/unit/leaderboard_test.rb new file mode 100644 index 0000000..0ef96ac --- /dev/null +++ b/test/unit/leaderboard_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class LeaderboardTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/unit/monitor_child_relation_test.rb b/test/unit/monitor_child_relation_test.rb new file mode 100644 index 0000000..1d315f9 --- /dev/null +++ b/test/unit/monitor_child_relation_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class MonitorChildRelationTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/unit/monitor_profile_test.rb b/test/unit/monitor_profile_test.rb new file mode 100644 index 0000000..03d569b --- /dev/null +++ b/test/unit/monitor_profile_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class MonitorProfileTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/unit/regiman_test.rb b/test/unit/regiman_test.rb new file mode 100644 index 0000000..51d39e8 --- /dev/null +++ b/test/unit/regiman_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class RegimanTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/unit/tag_test.rb b/test/unit/tag_test.rb new file mode 100644 index 0000000..b8498a1 --- /dev/null +++ b/test/unit/tag_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class TagTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/unit/weekly_diet_test.rb b/test/unit/weekly_diet_test.rb new file mode 100644 index 0000000..0cfdb84 --- /dev/null +++ b/test/unit/weekly_diet_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class WeeklyDietTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/vendor/assets/javascripts/.gitkeep b/vendor/assets/javascripts/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/assets/stylesheets/.gitkeep b/vendor/assets/stylesheets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/plugins/.gitkeep b/vendor/plugins/.gitkeep new file mode 100644 index 0000000..e69de29