diff --git a/backend/app/controllers/volunteer/profiles_controller.rb b/backend/app/controllers/volunteer/profiles_controller.rb index 1395003..06fcf49 100644 --- a/backend/app/controllers/volunteer/profiles_controller.rb +++ b/backend/app/controllers/volunteer/profiles_controller.rb @@ -10,10 +10,15 @@ def update render json:@volunteer end + def all + @volunteers = Volunteer.all + render json:@volunteers + end + private def set_volunteer - @volunteer = Volunteer.find(params[:id]) + @volunteer = Volunteer.find(params[:id]) if params[:id] end end diff --git a/backend/config/routes.rb b/backend/config/routes.rb index a9b9180..3e335cc 100644 --- a/backend/config/routes.rb +++ b/backend/config/routes.rb @@ -3,6 +3,8 @@ registrations: 'volunteer/registrations', passwords: 'volunteer/passwords'} + get '/volunteers/all' => 'volunteer/profiles#all' + get '/volunteers/:id' => 'volunteer/profiles#show' put '/volunteers/:id' => 'volunteer/profiles#update' diff --git a/backend/log/development.log b/backend/log/development.log new file mode 100644 index 0000000..a3ef19c --- /dev/null +++ b/backend/log/development.log @@ -0,0 +1,188 @@ + + +Started GET "/volunteers/all" for ::1 at 2015-10-04 12:55:56 -0700 + ActiveRecord::SchemaMigration Load (6.8ms) SELECT "schema_migrations".* FROM "schema_migrations" + +ActionController::RoutingError (undefined local variable or method `only' for Volunteer::ProfilesController:Class): + app/controllers/volunteer/profiles_controller.rb:2:in `' + app/controllers/volunteer/profiles_controller.rb:1:in `' + + + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.8ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/templates/routes/_route.html.erb (2.2ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/templates/routes/_table.html.erb (11.4ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (10.2ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb within rescues/layout (63.1ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/_markup.html.erb (0.5ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/_inner_console_markup.html.erb within layouts/inlined_string (0.4ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/_prompt_box_markup.html.erb within layouts/inlined_string (0.4ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/style.css.erb within layouts/inlined_string (0.6ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/console.js.erb within layouts/javascript (25.4ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/main.js.erb within layouts/javascript (0.3ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/error_page.js.erb within layouts/javascript (0.4ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/index.html.erb (53.5ms) + + +Started GET "/volunteers/all" for ::1 at 2015-10-04 12:56:58 -0700 + +TypeError (no implicit conversion of Symbol into Integer): + app/controllers/volunteer/profiles_controller.rb:2:in `[]' + app/controllers/volunteer/profiles_controller.rb:2:in `' + app/controllers/volunteer/profiles_controller.rb:1:in `' + + + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/templates/rescues/_source.erb (3.1ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (2.4ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.6ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (22.0ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/_markup.html.erb (0.5ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/_inner_console_markup.html.erb within layouts/inlined_string (0.3ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/_prompt_box_markup.html.erb within layouts/inlined_string (0.4ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/style.css.erb within layouts/inlined_string (0.4ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/console.js.erb within layouts/javascript (17.5ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/main.js.erb within layouts/javascript (0.2ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/error_page.js.erb within layouts/javascript (0.5ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/index.html.erb (39.6ms) + + +Started GET "/volunteers/all" for ::1 at 2015-10-04 12:57:16 -0700 + +TypeError (no implicit conversion of Symbol into Integer): + app/controllers/volunteer/profiles_controller.rb:2:in `[]' + app/controllers/volunteer/profiles_controller.rb:2:in `' + app/controllers/volunteer/profiles_controller.rb:1:in `' + + + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/templates/rescues/_source.erb (2.9ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.4ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (0.9ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (15.1ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/_markup.html.erb (0.3ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/_inner_console_markup.html.erb within layouts/inlined_string (0.2ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/_prompt_box_markup.html.erb within layouts/inlined_string (0.2ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/style.css.erb within layouts/inlined_string (0.2ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/console.js.erb within layouts/javascript (12.3ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/main.js.erb within layouts/javascript (0.2ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/error_page.js.erb within layouts/javascript (0.6ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/index.html.erb (28.0ms) + + +Started GET "/volunteers/all" for ::1 at 2015-10-04 12:58:07 -0700 + ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations" + +TypeError (no implicit conversion of Symbol into Integer): + app/controllers/volunteer/profiles_controller.rb:2:in `[]' + app/controllers/volunteer/profiles_controller.rb:2:in `' + app/controllers/volunteer/profiles_controller.rb:1:in `' + + + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/templates/rescues/_source.erb (3.2ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.4ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (8.5ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (25.4ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/_markup.html.erb (0.4ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/_inner_console_markup.html.erb within layouts/inlined_string (0.4ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/_prompt_box_markup.html.erb within layouts/inlined_string (0.7ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/style.css.erb within layouts/inlined_string (0.5ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/console.js.erb within layouts/javascript (24.0ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/main.js.erb within layouts/javascript (0.3ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/error_page.js.erb within layouts/javascript (0.6ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/index.html.erb (50.5ms) + ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" + ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (4.9ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete +FROM pg_constraint c +JOIN pg_class t1 ON c.conrelid = t1.oid +JOIN pg_class t2 ON c.confrelid = t2.oid +JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid +JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid +JOIN pg_namespace t3 ON c.connamespace = t3.oid +WHERE c.contype = 'f' + AND t1.relname = 'departments' + AND t3.nspname = ANY (current_schemas(false)) +ORDER BY c.conname + +  (1.8ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete +FROM pg_constraint c +JOIN pg_class t1 ON c.conrelid = t1.oid +JOIN pg_class t2 ON c.confrelid = t2.oid +JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid +JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid +JOIN pg_namespace t3 ON c.connamespace = t3.oid +WHERE c.contype = 'f' + AND t1.relname = 'projects' + AND t3.nspname = ANY (current_schemas(false)) +ORDER BY c.conname + +  (1.5ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete +FROM pg_constraint c +JOIN pg_class t1 ON c.conrelid = t1.oid +JOIN pg_class t2 ON c.confrelid = t2.oid +JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid +JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid +JOIN pg_namespace t3 ON c.connamespace = t3.oid +WHERE c.contype = 'f' + AND t1.relname = 'skills' + AND t3.nspname = ANY (current_schemas(false)) +ORDER BY c.conname + +  (1.4ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete +FROM pg_constraint c +JOIN pg_class t1 ON c.conrelid = t1.oid +JOIN pg_class t2 ON c.confrelid = t2.oid +JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid +JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid +JOIN pg_namespace t3 ON c.connamespace = t3.oid +WHERE c.contype = 'f' + AND t1.relname = 'volunteers' + AND t3.nspname = ANY (current_schemas(false)) +ORDER BY c.conname + +  (1.4ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete +FROM pg_constraint c +JOIN pg_class t1 ON c.conrelid = t1.oid +JOIN pg_class t2 ON c.confrelid = t2.oid +JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid +JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid +JOIN pg_namespace t3 ON c.connamespace = t3.oid +WHERE c.contype = 'f' + AND t1.relname = 'weeklyhours' + AND t3.nspname = ANY (current_schemas(false)) +ORDER BY c.conname + + + +Started GET "/volunteers/all" for ::1 at 2015-10-04 12:58:51 -0700 + ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations" +Processing by Volunteer::ProfilesController#all as HTML + Volunteer Load (1.2ms) SELECT "volunteers".* FROM "volunteers" WHERE "volunteers"."id" = $1 LIMIT 1 [["id", nil]] +Completed 404 Not Found in 26ms (ActiveRecord: 4.1ms) + +ActiveRecord::RecordNotFound (Couldn't find Volunteer with 'id'=): + app/controllers/volunteer/profiles_controller.rb:21:in `set_volunteer' + + + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/templates/rescues/_source.erb (6.0ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (2.4ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.3ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (30.7ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/_markup.html.erb (0.5ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/_inner_console_markup.html.erb within layouts/inlined_string (0.4ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/_prompt_box_markup.html.erb within layouts/inlined_string (0.2ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/style.css.erb within layouts/inlined_string (0.5ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/console.js.erb within layouts/javascript (20.1ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/main.js.erb within layouts/javascript (0.5ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/error_page.js.erb within layouts/javascript (0.4ms) + Rendered /Users/yumiko/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/web-console-2.2.1/lib/web_console/templates/index.html.erb (54.8ms) + + +Started GET "/volunteers/all" for ::1 at 2015-10-04 12:59:14 -0700 +Processing by Volunteer::ProfilesController#all as HTML + Volunteer Load (0.4ms) SELECT "volunteers".* FROM "volunteers" +Completed 200 OK in 35ms (Views: 31.6ms | ActiveRecord: 1.9ms) + + +Started GET "/volunteers/all" for ::1 at 2015-10-04 12:59:58 -0700 +Processing by Volunteer::ProfilesController#all as HTML + Volunteer Load (37.8ms) SELECT "volunteers".* FROM "volunteers" +Completed 200 OK in 206ms (Views: 167.0ms | ActiveRecord: 37.8ms) diff --git a/mobile/www/js/app.js b/mobile/www/js/app.js index f6d886c..fd64da5 100644 --- a/mobile/www/js/app.js +++ b/mobile/www/js/app.js @@ -46,6 +46,11 @@ angular.module('starter', ['ionic', 'starter.controllers', 'starter.services','n controller: 'ProgressCtrl' }) + .state('all', { + url:'/all', + templateUrl: 'templates/volunteers.html', + controller: 'allCtrl' + }) // setup an abstract state for the tabs directive .state('tab', { url: '/tab', diff --git a/mobile/www/js/controllers.js b/mobile/www/js/controllers.js index 0a5391e..5a5983e 100644 --- a/mobile/www/js/controllers.js +++ b/mobile/www/js/controllers.js @@ -28,6 +28,15 @@ angular.module('starter.controllers', []) }; }) +.controller('allCtrl', function($scope, $http) { + $http.get('http://localhost:3000/volunteers/all') + .success(function (data, status, headers) { + console.log(data); + $scope.volunteers = data.profiles; + }) + +}) + .controller('ProgressCtrl', function($scope) { var percentage = document.getElementById('project-percentage'); $scope.value = percentage.value; diff --git a/mobile/www/templates/volunteers.html b/mobile/www/templates/volunteers.html new file mode 100644 index 0000000..9a4e729 --- /dev/null +++ b/mobile/www/templates/volunteers.html @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + SCHEDULE + + + + + PROGRESS + + + + + ANALYSIS + + + + + SETTING + + + + + ABOUT US + + + + + + +
+ + + {{volunteer.first_name}} {{volunteer.last_name}}
+ {{volunteer.email}} +
+
+
+ +
+