草庐IT

michael-gruz

全部标签

ruby-on-rails - 我如何解决 "bad argument (expected URI object or URI string)"? Ruby on Rails,Michael Hartl 教程

我正在关注RubyonRailsTutorial作者:MichaelHartl。我到达了Chapter11.37但我的测试失败了。我收到以下错误:Failure/Error:xhr:post,:create,relationship:{followed_id:other_user.id}ArgumentError:badargument(expectedURIobjectorURIstring)我是RubyonRails的新手,所以我真的不知道出了什么问题。有人可以帮助解决此错误吗?controllers/relationships_controller.rb:classRelatio

ruby-on-rails - Michael Hartl 的 Rails 教程 : Rspec's "Expected response to be a redirect to ..." is wrong

在MichaelHartl的(精彩的)Rails教程中,我遇到了一个意外的Rspec测试失败的形式:"Expectedresponsetobearedirecttohttp://test.host/signin>butwasaredirecttohttp://test.host/signin?notice=Please+sign+in+to+access+this+page.>."(在第10.3节中找到它。)因此,从错误本身,您可以看出服务器正在重定向到适当的页面,除了有一个额外的通知“请登录”。测试代码如下所示:describe"GET'index'"dodescribe"forno

ruby-on-rails - Railstutorial(Michael Hartl): Exercise 4. 6

我没有从Hartl的Rails教程中得到以下练习的答案:ByreplacingthequestionmarksinListing4.10withtheappropriatemethods,combinesplit,shuffle,andjointowriteafunctionthatshufflesthelettersinagivenstring.list4.10:>>defstring_shuffle(s)>>s.split('').?.?>>end=>nil>>string_shuffle("foobar")有人可以帮帮我吗?提前致谢! 最佳答案
12