草庐IT

xml - Odoo:无法在 TreeView 中编辑记录?

全部标签

ruby-on-rails - 在 Rails 应用程序中记录警告(不是错误),并管理它们

我正在寻找一个好的流程来处理Rails应用程序中的警告/信息类型的消息。例如,用户输入错误密码的次数,模型验证失败的次数等。特别是,我正在寻找一种有效的方法来操作这些指标,因为它们不是异常(exception),但可能表明潜在的错误或功能方面的问题。我正在考虑的解决方案是:记录WARNING或INFO消息并使用Splunk解析它们(不幸的是Splunk非常昂贵)在WARNING环境中发送Airbrake错误 最佳答案 你应该看看Papertrail作为Splunk+Airbrake的替代品。如果您只对日志记录感兴趣,这似乎更合适。

ruby-on-rails - 无法安装乘客模块

我正在尝试为Rails应用程序配置passenger和Nginx。我在执行乘客命令时遇到编译错误。ruby版本:ruby2.3.1p112(2016-04-26修订版54768)[x86_64-linux]Rails版本rails4.2.6错误信息:-#passenger-install-nginx-module/usr/local/rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/specification.rb:2158:in`method_missing':undefinedmethod`this'for#(NoMethodError)f

ruby - instance_eval 的 block 参数 - 记录了吗?目的?

刚刚意识到instance_eval产生self作为关联block的参数(除了1.9.2版本中的错误:http://www.ruby-forum.com/topic/189422)1.9.3p194:003>classC;end1.9.3p194:004>C.new.instance_eval{|*a|a}=>[#]1.9.3p194:005>这是否在某处记录/规范?看着ruby-doc:BasicObject,看不到提到的任何block参数。除了一些纯粹的历史原因之外,是否还有其他原因明确地传递它,而它自己总是被定义?我被这个击中的方式是:l=lambda{}myobj.instan

ruby - 无法在 ruby​​ 2.1.2 下安装 ruby​​-debug-ide gem

我正在尝试在ruby​​2.1.2下安装ruby​​-debug-idegem。这是为了在Rubymine中进行调试。它适用于ruby​​1.9.3但不适用于此版本。这是错误:1.3.5/lib/debugger/ruby_core_source/ruby-2.1.2-p95/***internal.h:209:error:expected‘;’,‘,’or‘)’before‘x’***这是输出。我希望能够以某种方式理解或调试它。顺便说一句,快速修复也很棒:-)Fetching:ruby-debug-ide-0.4.22.gem(100%)Buildingnativeextension

ruby-on-rails - state_machine 仅适用于新记录

我似乎无法获得state_machinegem(http://github.com/pluginaweek/state_machine/)来处理现有记录(它可以在新记录上正常工作)。这是我的模型:classComment:pendingdoevent:publishdotransitionall=>:publishedendendend这是一个演示该问题的IRBsession(我做了ActiveRecord::Base.logger=Logger.new(STDOUT)以使其更易于阅读):>>c=Comment.new=>#>>c.state=>"pending">>c.publish

ruby-on-rails - 无法使用 Capistrano 和 RVM 部署 Rails 应用程序

我有一个使用Capistrano部署的Rails应用程序。我在服务器上安装了RVM,因为我想使用更新版本的Ruby,并将其添加到我的deploy.rb文件中(根据我发现的各种说明):$:.unshift(File.expand_path('./lib',ENV['rvm_path']))require'rvm/capistrano'set:rvm_ruby_string,'1.9.2'set:rvm_type,:user当我运行capdeploy时,会发生这种情况:[staging.example.com]executingcommand**[out::staging.example.

ruby - 来自 Thin 的消息/日志记录

如何阻止RackThin返回以下类型的初始消息?>>Thinwebserver(v1.3.1codenameTripleEspresso)>>Maximumconnectionssetto1024>>isteningon0.0.0.0:3000,CTRL+Ctostop我是这样使用它的:Rack::Handler::Thin.run(Rack::Builder.newdomap("/resource/"){run(Rack::File.new("/"))}map("/")dorun(->env{h=Rack::Utils.parse_nested_query(env["QUERY_ST

ruby-on-rails - 使用 Form Object 时应该如何处理编辑和更新操作?

我有以下表单对象来管理复杂的嵌套表单。表单=simple_form_for(@profile_form,:url=>profiles_path)do|f|...路线resources:profilesControllerclassProfilesController表单对象classProfileFormincludeActiveModel::ValidationsincludeActiveModel::ConversionextendActiveModel::Namingdefinitialize(profile_id=nil)ifprofile_id@profile=Profile

ruby - 我如何记录提供 block 是可选的方法?

我有一个这样记录的函数:###Searchesforstreetnamesinthelocaladdressdatabase.Returnsalist#ofstrings,orinvokestheblockforeachresult.##@param[String,Hash]query##Canbe:##-Asearchstringwithoptinalwildcards.Examples:#-"Bærumsv*"#-"Fornebuve_en"##@param[Integer]limit##Limitstheamountofresults.See{#search_street_add

ruby - 如何在 rails_admin 的编辑表单中隐藏 "Save and Add Another"按钮?

我在我的Rails应用程序中应用了rails_admingem。我想删除特定模型编辑表单中一些不必要的按钮,并添加我自己的自定义按钮。请查看屏幕截图,了解我要删除的内容。 最佳答案 @montells复制https://github.com/sferik/rails_admin/blob/master/app/views/rails_admin/main/_submit_buttons.html.haml这个页面在你的repo中,位于“views/rails_admin/main/_submit_buttons.html.haml”