diff --git a/app/assets/javascripts/users/finish.js b/app/assets/javascripts/users/finish.js index c977b8703..7ac4fb9d5 100644 --- a/app/assets/javascripts/users/finish.js +++ b/app/assets/javascripts/users/finish.js @@ -43,6 +43,7 @@ openFarmApp.controller('finishCtrl', ['$scope', '$http', 'userService', } var userCallback = function(success, user){ + console.log(success, user) $scope.user.sending = false; if (success) { $scope.user = user; diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 78d2886f0..07c9b1ed3 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -34,6 +34,10 @@ def index @users = policy_scope(User) end + def edit + authorize current_user + end + def finish authorize current_user end diff --git a/app/policies/user_policy.rb b/app/policies/user_policy.rb index db07e06f0..22c288591 100644 --- a/app/policies/user_policy.rb +++ b/app/policies/user_policy.rb @@ -20,6 +20,10 @@ def update? @viewed_user == @current_user || @current_user.admin? end + def edit? + @viewed_user == @current_user || @current_user.admin? + end + def finish? @viewed_user == @current_user || @current_user.admin? end diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb new file mode 100644 index 000000000..be74f7112 --- /dev/null +++ b/app/views/users/edit.html.erb @@ -0,0 +1,105 @@ +<% content_for(:start_js) do %> +<%= javascript_include_tag '//maps.google.com/maps/api/js?sensor=false' %> +<% end %> + +