草庐IT

remoting

全部标签

ruby-on-rails - 我该怎么办 :remote location validation with CarrierWave?

我在我的Rails3示例应用程序上使用CarrierWave。我想验证远程位置上传,因此当用户提交无效URL(空白或非图像)时,我不会收到标准错误异常:CarrierWave::DownloadErrorinImageController#createtryingtodownloadafilewhichisnotservedoverHTTP这是我的模型:classPaintingtrue,:length=>{:minimum=>5,:maximum=>100}validates:image,:presence=>trueend这是我的Controller:classPaintingsC

ruby - 无法加载此类文件——脚本/rails : Getting this error while remote debugging through RubyMine

我在通过RubyMineIDE进行远程调试时遇到以下错误。$bundleexecrdebug-ide--port1234--script/railsserverFastDebugger(ruby-debug-ide0.4.9)listenson:1234/home/amit/.rvm/gems/ruby-1.9.3-p125/gems/ruby-debug-ide19-0.4.12/lib/ruby-debug-ide.rb:123:in`debug_load'/home/amit/.rvm/gems/ruby-1.9.3-p125/gems/ruby-debug-ide19-0.4.

jquery - 在 rails 中通过 remote_function 中的表单生成器?

我有选择框,在更改时我需要获取值,并通过远程函数从数据库中获取一些字段名称,然后根据从选择框中选择的选项进一步生成这些字段。问题是字段在f.form_for中,所以正在使用具有选择框的formbuilderf。所以当我在Controller中通过ajax呈现部分时,我收到错误消息,因为我没有引用到本地表单生成器f。有谁知道我如何或是否可以获取对表单生成器的引用,或者是否可以在远程函数调用中传递它,然后在部分中传递给我的本地人?非常感谢,任何帮助都会很棒,因为很长一段时间以来一直停留在这个问题上!干杯rake 最佳答案 我遇到了同样的

ruby-on-rails - Rails 2 到 Rails 3 : using link_to instead of link_to_remote (including remote and update)

我确定这是一个快速简单的答案。我正在将Rails项目从版本2升级到版本3,并根据Rails3更新将link_to_remote的负载替换为link_to。甚至像:这样简单的事情:get_time},:remote=>true,:update=>'current_time'%>好像不行。请求(使用get方法)正常进行,呈现的html是:CheckTimeRoutes.rb条目:get"monitoring/get_time"正如我所说,我确信这对我来说是一个非常明显的问题! 最佳答案 新的link_to:remote=>true不支持

ruby-on-rails - 在 Ruby on Rails 中更改 request.remote_ip 的值

出于测试目的,我想更改request.remote_ip的返回值。在我的开发机器上,它总是返回127.0.0.1,但我想给自己不同的假IP来测试我的应用程序的正确行为,而不是先将它部署到实时服务器!谢谢。 最佳答案 如果您希望在整个应用程序中使用此功能,那么在您的app/helpers/application_helper.rb中覆盖remote_ip方法可能会更好/更容易:classActionDispatch::Request#rails2:ActionController::Requestdefremote_ip'1.2.3.

ruby-on-rails - 由于 :remote=>true,表单提交了两次

我的表单提交了两次,经过仔细检查,这是由':remote=>true'引起的。我删除了它,我的项目运行良好。谁能告诉我为什么?以及如何使用':remote=>true'?我的ruby代码:true,:id=>'new_product_group_form')do%>[:product_scopes,:groups,group_name]),scopes.keys.mapdo|scope_name|[t(:name,:scope=>[:product_scopes,:scopes,scope_name]),scope_name]end]end)%>"/>浏览器中的最终html代码。Add

ruby-on-rails - ! [remote rejected] master -> master(pre-receive hook declined)

这个问题在这里已经有了答案:remoterejectedmaster->master(pre-receivehookdeclined)(29个答案)关闭8年前。Tasks:TOP=>assets:precompile(Seefulltracebyrunningtaskwith--trace)!!Precompilingassetsfailed.!!Pushrejected,failedtocompileRubyappTogit@heroku.com:tranquil-crag-9767.git![remoterejected]master->master(pre-receivehook

ruby-on-rails - Rails 中的 request.remote_ip 和 request.ip 有什么区别?

如题所示,两种方法都可以获取到客户端的ip。我想知道是否有任何差异。谢谢。源码里有"/usr/local/rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.3/lib/action_dispatch/http/request.rb"257L,8741Cdefip@ip||=superend#OriginatingIPaddress,usuallysetbytheRemoteIpmiddleware.defremote_ip@remote_ip||=(@env["action_dispatch.remote_ip"]||ip).to_send但我真

javascript - electron 的 remote.getGlobal() 在 window.location.replace() 之后返回 "undefined"

我一直在摆弄Electron的远程模块。在我的主进程中,我创建了这个变量:global.storage={};我的渲染器进程是用一个名为startup.html的文件初始化的。win.loadURL('file://'+__dirname+'/startup.html')在那里,我包含了一个包含以下函数的javascript文件:functionenterMain(value){remote.getGlobal('storage').exmpl=value;window.location.replace('./general.html');}我传递的值是“hello”,当调用...co

javascript - kaminari 通过 ajax 分页,remote = true 不影响 rails 3 中的 View

你好,我正在使用kaminarigem进行分页,我想通过ajax进行分页。index.html.haml#abc=render:partial=>'anything/anything_lists',collection:@anything_upcoming,as::anything_schedule#paginator=paginate@anything_upcoming,:remote=>true,:param_name=>"anything_upcoming_page"index.js.haml$('#abc').html('#{escape_javascriptrender(pa