diff --git a/.idea/.generators b/.idea/.generators new file mode 100644 index 0000000..aa3c1a6 --- /dev/null +++ b/.idea/.generators @@ -0,0 +1,8 @@ + + diff --git a/.idea/.rakeTasks b/.idea/.rakeTasks new file mode 100644 index 0000000..6cb4d5a --- /dev/null +++ b/.idea/.rakeTasks @@ -0,0 +1,7 @@ + + diff --git a/.idea/guoren.iml b/.idea/guoren.iml new file mode 100644 index 0000000..d318404 --- /dev/null +++ b/.idea/guoren.iml @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..de6e841 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/Development__guoren.xml b/.idea/runConfigurations/Development__guoren.xml new file mode 100644 index 0000000..0585515 --- /dev/null +++ b/.idea/runConfigurations/Development__guoren.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/Production__guoren.xml b/.idea/runConfigurations/Production__guoren.xml new file mode 100644 index 0000000..0d25565 --- /dev/null +++ b/.idea/runConfigurations/Production__guoren.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/spec__guoren.xml b/.idea/runConfigurations/spec__guoren.xml new file mode 100644 index 0000000..9dfd121 --- /dev/null +++ b/.idea/runConfigurations/spec__guoren.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/test__guoren.xml b/.idea/runConfigurations/test__guoren.xml new file mode 100644 index 0000000..ae53fc4 --- /dev/null +++ b/.idea/runConfigurations/test__guoren.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..f2aa764 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,829 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + project + + + + + + + + + + + + + + + + + + + + + + + + + + + 1482408182630 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Gemfile b/Gemfile index 67af890..f5bcd2d 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' - +gem 'rake' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.0.0', '>= 5.0.0.1' # Use sqlite3 as the database for Active Record @@ -25,6 +25,8 @@ gem 'jbuilder', '~> 2.5' # gem 'redis', '~> 3.0' # Use ActiveModel has_secure_password gem 'bcrypt', '~> 3.1.7' +# for windows +gem 'bcrypt-ruby', '~> 3.0.0', :require => "bcrypt" # Use Capistrano for deployment # gem 'capistrano-rails', group: :development diff --git a/Gemfile.lock b/Gemfile.lock index 92c9ada..4a1d941 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -40,6 +40,8 @@ GEM tzinfo (~> 1.1) arel (7.1.4) bcrypt (3.1.11) + bcrypt (3.1.11-x64-mingw32) + bcrypt-ruby (3.0.1) builder (3.2.2) byebug (9.0.6) coffee-rails (4.2.1) @@ -54,6 +56,7 @@ GEM erubis (2.7.0) execjs (2.7.0) ffi (1.9.14) + ffi (1.9.14-x64-mingw32) globalid (0.3.7) activesupport (>= 4.1.0) i18n (0.7.0) @@ -81,6 +84,8 @@ GEM nio4r (1.2.1) nokogiri (1.6.8.1) mini_portile2 (~> 2.1.0) + nokogiri (1.6.8.1-x64-mingw32) + mini_portile2 (~> 2.1.0) puma (3.6.2) rack (2.0.1) rack-test (0.6.3) @@ -132,6 +137,7 @@ GEM activesupport (>= 4.0) sprockets (>= 3.0.0) sqlite3 (1.3.12) + sqlite3 (1.3.12-x64-mingw32) thor (0.19.1) thread_safe (0.3.5) tilt (2.0.5) @@ -140,6 +146,8 @@ GEM turbolinks-source (5.0.0) tzinfo (1.2.2) thread_safe (~> 0.1) + tzinfo-data (1.2016.10) + tzinfo (>= 1.0.0) uglifier (3.0.3) execjs (>= 0.3.0, < 3) web-console (3.4.0) @@ -153,9 +161,11 @@ GEM PLATFORMS ruby + x64-mingw32 DEPENDENCIES bcrypt (~> 3.1.7) + bcrypt-ruby (~> 3.0.0) byebug coffee-rails (~> 4.2) jbuilder (~> 2.5) @@ -163,6 +173,7 @@ DEPENDENCIES listen (~> 3.0.5) puma (~> 3.0) rails (~> 5.0.0, >= 5.0.0.1) + rake sass-rails (~> 5.0) spring spring-watcher-listen (~> 2.0.0) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index c7e76ea..d699c54 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -17,6 +17,17 @@ class UsersController < ApplicationController render 'edit' end + + def update + if @user.update_attributes(user_params) + flash[:success]="profile updated" + redirect_to @user + else + render 'edit' + end + end + + private def user_params diff --git a/app/views/layouts/_nav.html.erb b/app/views/layouts/_nav.html.erb index 4d1a452..a26c8ff 100644 --- a/app/views/layouts/_nav.html.erb +++ b/app/views/layouts/_nav.html.erb @@ -5,7 +5,7 @@