#1 楼 @jimrokliu 是指不加:
config.paths.add "app/api", glob: "**/*.rb"
config.autoload_paths += Dir["#{Rails.root}/app/api/*"]
这个吗?试过了,错误也是一样的。
运行:rake routes --trace
** Invoke routes (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
Rails::Application::RoutesReloader#execute_if_updated delegated to updater.execute_if_updated, but updater is nil: #<Rails::Application::RoutesReloader:0x007fede744afc0 @paths=["/rfacility/config/routes.rb"], @route_sets=[#<ActionDispatch::Routing::RouteSet:0x007fede4859240>]>
/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:10:in `rescue in execute_if_updated'
/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:6:in `execute_if_updated'
/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec'
/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run'
/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:in `each'
/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers'
/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!'
/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
/rfacility/config/environment.rb:5:in `<top (required)>'
/.rvm/gems/ruby-2.0.0-p247/gems/backports-3.3.4/lib/backports/tools.rb:328:in `require'
/.rvm/gems/ruby-2.0.0-p247/gems/backports-3.3.4/lib/backports/tools.rb:328:in `require_with_backports'
/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application.rb:189:in `require_environment!'
/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application.rb:249:in `block in run_tasks_blocks'
/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.1.0/lib/rake/task.rb:236:in `call'
/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.1.0/lib/rake/task.rb:236:in `block in execute'
/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.1.0/lib/rake/task.rb:231:in `each'
/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.1.0/lib/rake/task.rb:231:in `execute'
/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.1.0/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.1.0/lib/rake/task.rb:197:in `block in invoke_prerequisites'
/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.1.0/lib/rake/task.rb:195:in `each'
/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.1.0/lib/rake/task.rb:195:in `invoke_prerequisites'
/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.1.0/lib/rake/task.rb:174:in `block in invoke_with_call_chain'
/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.1.0/lib/rake/task.rb:161:in `invoke'
/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.1.0/lib/rake/application.rb:149:in `invoke_task'
/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.1.0/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.1.0/lib/rake/application.rb:106:in `each'
/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.1.0/lib/rake/application.rb:106:in `block in top_level'
/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.1.0/lib/rake/application.rb:115:in `run_with_threads'
/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.1.0/lib/rake/application.rb:100:in `top_level'
/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.1.0/lib/rake/application.rb:78:in `block in run'
/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.1.0/bin/rake:33:in `<top (required)>'
/.rvm/gems/ruby-2.0.0-p247/bin/rake:23:in `load'
/.rvm/gems/ruby-2.0.0-p247/bin/rake:23:in `<main>'
/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `eval'
/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => routes => environment
李开复是个挺有争议的人。 我想了解一下,不喜欢他的人是因为什么不喜欢他,喜欢他的人又因为什么喜欢他?
保修期没有过的,是不是可以去续保的?
好像现在也有这个活动哦。
楼主可以修改后提交一个 fork 的嘛,那么好有贡献的机会。
#9 楼 @cqcn1991 可以看这个:http://railscasts.com/episodes/405-angularjs 我只是大概了解过 angular,开始用起来用爽,但是后面发现很多坑。到后面选择了 ember,但是 ember 入门比较难。 如果是 ember 的例子就非 discourse 莫属了:https://github.com/discourse/discourse js mvc 用的就是 ajax,但是他把这些概念封装好了。例如本来你要获取一个 model 的值,你写 ajax 的话要:
$.get('test/1', function(data) {
$('.result').html(data);
});
就是到一个 api 接口发送请求,而如果使用了 js mvc(ember)后:
App.Test.find(params.test_id)
经过这样的封装就非常易懂,而且写起来很方便。 而 mvc 还有一个优势是使用了模板,就不需要写大量的 dom,例如:
$("p").click(function () {
var htmlStr = $(this).html();
$(this).text(htmlStr);
});
而 ember 下的 handlebars 就是和 html 一样,然后就上面的例子,当点击 p 的时候,就读取这个 handlebars,然后就自动插入{{outlet}}
的地方,就不需要写各种 dom 的。
#1 楼 @zhulinpinyu 为什么从 angular 到 backbone? #2 楼 @everett gon 指的是?angular 和 ember 确实 2 选 1 就可以了,我的疑问是是否还要学个 backbone
#8 楼 @kingwkb 似乎这个问题刚解决,在 3 天前 https://github.com/JangoSteve/remotipart/commit/972e815045ba5b816814d10837fc8781d40fd5d9 可能要使用 github 上的版本
#3 楼 @kingwkb 你是结合 devise 一起使用的吗? 我是根据https://github.com/JangoSteve/remotipart#example来做的。但是会有这样的问题。
#1 楼 @zhangyuan 奇怪,为什么一般的 remote: true 是不需要带 csrf token 的,偏偏这种情况下需要这样。
您好,建议您直接在线申请:登陆 online.unionpay.com 点击主页“特约商户”标签页 - 点击左侧的“商户入网申请”,按照要求填写相关信息提交后,五个工作日会有相关工作人员与您联系。
@zj0713001 啊?那你不是做了国内的吗?是公司搞定了手续,然后你就直接调用他的 api 了?