@ken @kayakjiang 84#问题解决了。代码已push。
➜ build-api-rails git:(master) bundle exe rails c
Loading development environment (Rails 4.2.1)
2.0.0-p481 :001 > User.all.each {|user|
2.0.0-p481 :002 > user.password = '123123'
2.0.0-p481 :003?> user.reset_auth_token!
2.0.0-p481 :004?> }
SyntaxError: /Users/qk/mygithub/build-api-rails/app/models/user.rb:7: syntax error, unexpected keyword_self, expecting '|'
self.authentication_token = SecureRandom.base64(64)
^
/Users/qk/mygithub/build-api-rails/app/models/user.rb:9: syntax error, unexpected keyword_end
/Users/qk/mygithub/build-api-rails/app/models/user.rb:16: syntax error, unexpected end-of-input, expecting keyword_end
from /Users/qk/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:457:in `load'
from /Users/qk/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:457:in `block in load_file'
from /Users/qk/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:647:in `new_constants_in'
from /Users/qk/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:456:in `load_file'
from /Users/qk/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:354:in `require_or_load'
from /Users/qk/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:494:in `load_missing_constant'
from /Users/qk/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:184:in `const_missing'
from (irb):1
from /Users/qk/.rvm/gems/ruby-2.0.0-p481/gems/railties-4.2.1/lib/rails/commands/console.rb:110:in `start'
from /Users/qk/.rvm/gems/ruby-2.0.0-p481/gems/railties-4.2.1/lib/rails/commands/console.rb:9:in `start'
from /Users/qk/.rvm/gems/ruby-2.0.0-p481/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:68:in `console'
from /Users/qk/.rvm/gems/ruby-2.0.0-p481/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /Users/qk/.rvm/gems/ruby-2.0.0-p481/gems/railties-4.2.1/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
一定要支持一下的
➜ build-an-api-rails-demo rails --version
Rails 4.2.1
Started GET "/api/v1/users/1" for ::1 at 2015-06-29 21:10:00 +0800
ArgumentError (Invalid request forgery protection method, use :null_session, :exception, or :reset_session):
app/controllers/api/v1/base_controller.rb:3:in `<class:BaseController>'
app/controllers/api/v1/base_controller.rb:1:in `<top (required)>'
app/controllers/api/v1/users_controller.rb:1:in `<top (required)>'
@cqcn1991 +微信应用
@cqcn1991 整点实在的微信接入什么的吧。
#1 石家庄有个 写 java mybatis 工具包的。