草庐IT

calendar_event_path

全部标签

ruby-on-rails - Rails model_path 路由错误,没有路由匹配 "model.2";应该是 "model/2"

我的路由路径似乎有问题。通常我应该能够做类似的事情我继续我的一天。无论出于何种原因,我都无法理解我的user_path不返回/user/:id就像我期望的那样。相反,它返回/user.:id为了对此进行测试,我使用以下代码加载了一部分。app/view/users/_test.html.rb这返回了本地主机:3000/测试#1/user.1/users/new/users/1/edit/user.1我不知道是什么导致了这种情况发生。edit_user_path(@user)工作完美,但节目没有。我读过RailsRoutingGuide从上到下大约三遍,我无法弄清楚。我发现最接近我的问题

ruby-on-rails - 为什么在 Ruby Event Machine 中使用线程?

既然说eventmachine是单线程的基于事件模型的异步I/O库(类似node.js),使用eventloop来处理并发请求,真的有必要关心和使用threading吗ruby应用层代码(即处理请求时的railsController)?我更习惯于node.js模型,您实际上只需将代码包装在回调中,然后一切都会为您处理。(对产生新线程的kqueue、epoll等的select()系统调用在较低级别的C++实现中处理),而且,ECMAscript本质上没有线程。最近在学习EventMachine的时候看到了这段ruby代码:Thread=Thread.currentThread.new{E

ruby - 为什么我的 Ruby Git 脚本 Hook 使用错误的 $PATH 运行?

我正在使用RVM。我为一个项目写了一个Gitpre-commit钩子(Hook):#!/usr/bin/envrubyputsRUBY_VERSIONputs`echo$PATH`exit(1)Git运行时输出:$gitci-m'foo'1.8.7/usr/libexec/git-core:/usr/bin:/usr/local/heroku/bin:/Users/mgoerlich/.rvm/gems/ruby-2.0.0-p195@global/bin:/Users/mgoerlich/.rvm/rubies/ruby-2.0.0-p195/bin:/Users/mgoerlich

ruby-on-rails - 如何在 Rails 3 的功能测试中使用 polymorphic_path

我正在尝试在Rails3的功能测试中使用polymorphic_path。起初我会得到NoMethodError:undefinedmethod`polymorphic_path'for#然后我添加了includeRails.application.routes.url_helpersundefinedmethoderror停止了,但是现在常规路径,例如article_path(article)停止工作了:NameError:undefinedlocalvariableormethod`default_url_options'for#.rvm/gems/ruby-1.9.2-p290/

ruby - Windows 7 - 如何解决 “You need to have Ruby and Sass installed and in your PATH for this task to work” 警告?

大多数答案和解决方案都与OSX相关,它集中在Windows7中:我已经全局安装了Grunt&GruntCLI。然后我在项目文件夹中执行了npminstall以安装所有依赖项。到目前为止没有问题,但是当我尝试运行“gruntbuild”命令时,我在我的项目中收到了这个警告:Warning:YouneedtohaveRubyandSassinstalledandinyourPATHforthistasktowork.Moreinfo:https://github.com/gruntjs/grunt-contrib-sassUse--forcetocontinue.

ruby - 将 RVM 与 virtualenv 一起使用时为 "Warning! PATH is not properly set up"

我收到这个错误:Warning!PATHisnotproperlysetup,'/home/oscar/.rvm/gems/ruby-2.1.2/bin'isnotatfirstplace,usuallythisiscausedbyshellinitializationfiles-checkthemfor'PATH=...'entries,itmightalsohelptore-addRVMtoyourdotfiles:'rvmgetstable--auto-dotfiles',tofixtemporarilyinthisshellsessionrun:'rvmuseruby-2.1.

ruby-on-rails - 带有 path_prefix 的浅层路由?

最近我在我的一个应用程序中更改了一些嵌套资源以使用浅层路由。它运行良好,我已经能够简化我的View和Controller。但是,我之前一直在使用path_prefix:map.with_options:path_prefix=>"blog"do|blog|blog.resources:postsdo|posts|posts.resources:commentsendend请注意,所有路由都按预期以“/blog”为前缀。#$rakeroutes#postsGET/blog/posts(.:format){:controller=>"posts",:action=>"index"}#POS

ruby - 无法进行原生交互 : Could not load native events component for Selenium-webdriver 2. 35.0和Firefox 23.0.1组合

为了自动执行其中一项测试,我必须执行拖放操作。因此,我尝试通过以下方式实现它:driver.action.drag_and_drop(source,target).perform但它会导致错误:Selenium::WebDriver::Error::InvalidElementStateError:Cannotperformnativeinteraction:Couldnotloadnativeeventscomponent.我在以下配置上运行了这个测试:火狐23.0.1SeleniumWebDriver2.35.0我选择以上组合是因为changelog说-使用SeleniumWebD

ruby-on-rails - 确定 Journey::Path::Pattern 是否匹配当前页面

我正在尝试使用概述的方法thispost结合url_for来确定当前路径是否在已安装的引擎中,但我很难弄清楚如何使用Journey::Path::Pattern(这是另一篇文章中概述的mounted_pa​​th方法返回的内容)。classRails::Enginedefself.mounted_pathroute=Rails.application.routes.routes.detectdo|route|route.app==selfendroute&&route.pathendend除了theofficialdocumentation,似乎没有太多关于它的讨论。,这不是特别有用。

ruby-on-rails - Heroku "at=error code=H10 desc="应用程序崩溃“method=GET path=/favicon.ico”

我有一个简单的Rails应用程序,可以在本地主机(MacOSX)上正常运行,但是当我将它部署到Heroku时,我看到一个页面出现此错误:应用程序错误应用程序发生错误,无法提供您的页面。请稍后重试。如果您是应用程序所有者,请查看您的日志以了解详细信息。我真的不知道我在这里做什么;我无法理解herokulogs的输出:2013-04-08T03:25:02+00:00app[web.1]:=>BootingWEBrick2013-04-08T03:25:02+00:00app[web.1]:=>Rails3.2.12applicationstartinginproductiononhttp