我已经遵循了这里的说明:https://github.com/Ink/filepicker-rails
我在config/application.rb中有config.filepicker_rails.api_key = "MyApiKey",并且在我的应用程序布局中通过<%= filepicker_js_include_tag %>调用filepicker.io脚本。
我的admin/geography.rb y.rb文件中包含以下内容:
form do |f|
f.inputs "Town" do
f.input :town
f.input :name
f.filepicker_field :filepicker_url
end
f.actions
end我在我的管理页面上看到的错误是:
RuntimeError in Admin::Geographies#new
Showing /Users/user/.rvm/gems/ruby-2.0.0-p0@Guides/bundler/gems/active_admin-72a9c30cef47/app/views/active_admin/resource/new.html.arb where line #1 raised:
Set config.filepicker_rails.api_key
Extracted source (around line #1):
1: insert_tag renderer_for(:edit)有没有人经历过这种情况或有解决方案?我也尝试过将它移到我的initializers/active_admin.rb文件中,但没有成功,我不知道还能去哪里寻找补救方法。除了github文档之外,似乎没有太多关于RoR Filepicker.io实现的信息。
发布于 2013-09-20 23:14:49
rubygems上的filepicker-rails版本目前不支持Rails4 (正在更新中)。The version on github should work so please grab it from there.
(有关详细信息,请参阅:https://github.com/Ink/filepicker-rails/issues/55)
发布于 2013-10-13 20:20:47
我在https://github.com/maxtilford/filepicker-rails-demo上的演示中也遇到了同样的错误。
在application.rb中硬编码config.filepicker_rails.api_key而不是使用ENV之后,它就能工作了。
https://stackoverflow.com/questions/18412689
复制相似问题