简体   繁体   English

用实用语言学习Ruby on Rails

[英]Learning Ruby on Rails with Pragmatic book

I only have a background knowledge of java and C, and a bit of unix (learned from the first year Comp Sci) and i do know bit about HTML/CSS... anyways so i've started using the book and the book said that we don't need to know html or ruby or css and that book would be kinda teaching all that as we go along.. 我只具有Java和C的背景知识,以及一些Unix(从Comp Sci的第一年学到的东西),而且我确实了解HTML / CSS……无论如何,所以我已经开始使用这本书了,书说我们不需要了解html或ruby或css,而随着我们的前进,这本书就可以教授所有内容。

And i'm at the part where we create a cart for the online store website, but i find that they just add a ton of html/css of ruby codes without really talking about it, and moving on.. I heard that this book was the best of there for ruby, i just focus on the stuff they mention, but i was wondering if i'm supposed to actually just look at other stuff when they add the CSS or HTML tags or ruby codes... i feel that this book is flying, without much explanation.. 我正在为在线商店网站创建购物车,但是我发现他们只是添加了大量的html / css红宝石代码,而没有真正谈论它,然后继续前进..我听说这本书对于ruby来说是最好的,我只是专注于他们提到的东西,但是我想知道我是否应该在添加CSS或HTML标签或ruby代码时实际上只是看看其他东西...我觉得这本书飞翔,没有太多解释。

Should i just keep going with the book, or go back and study every line of all those codes they just put in the program? 我应该继续阅读本书,还是回去研究他们刚刚在程序中输入的所有代码的每一行?

I used this book in my first job and failed miserably. 我在第一份工作中使用了这本书,却惨败。 It was my first time and and didn't knew Ruby but was asked by my team leader to just go by this book. 这是我的第一次,不了解Ruby,但是我的团队负责人要求他阅读本书。 And I miserably failed to do anything other than the said methods in the book. 可悲的是,除了书中所说的方法,我没有做任何其他事情。

I suggest if you want to t have good grasp at web development, you need to know HTML, CSS and Javascript at a very decent level. 我建议,如果您想很好地掌握Web开发,则需要非常了解HTML,CSS和Javascript。 After thatstudy Ruby. 之后研究Ruby。 Then you can go through this book. 然后,您可以阅读这本书。

Now there was once an article online by a prominent fellow in the rails community saying something worse about this book. 现在,在Rails社区中,有一位著名学者在网上发表过一篇文章,说这本书有些糟糕。 But since it isn't online anymore I assume that the blogger realised he was wrong and the book is indeed good. 但是由于不再在线,所以我认为博客作者意识到他错了,这本书的确不错。 So just go about and find it for yourself. 所以就自己去找吧。 But as I said go through all the other necessary topics I mentioned before you jump into rails. 但是正如我所说的,在进入轨道之前,请仔细阅读我提到的所有其他必要主题。

The HTML/CSS should be easy to pick up, but if you're having trouble following the Ruby code, I'd suggest you start with a Ruby off-Rails book. HTML / CSS应该很容易掌握,但是如果您在使用Ruby代码时遇到麻烦,建议您从Ruby off-Rails一书开始。 The Pickaxe book comes to mind. 我想到了书。 You can find the 1st edition online. 您可以在线找到第一版。 Also the Ruby Way helped me to "get" the Ruby way of doing things. 另外,Ruby Way还帮助我“获得”了Ruby的处事方式。

I've used the this book, is good but as you said they some things lack explanation. 我用过这本书,很好,但是正如您所说的,其中有些事情没有解释。 Usually the best thing you can do is pretty much use google or stackoverflow to lookup this things that you just don't understand. 通常,您可以做的最好的事情是使用google或stackoverflow查找您根本不了解的东西。 I was pretty much like you, 0 HTML or Rails, but after 2 weeks of reading code and looking for explanations on the web I can now pretty much understand all of the code, and afterwards everything is pretty straightforward. 我非常像您,是0 HTML或Rails,但是经过2个星期的阅读代码并在网络上寻找解释之后,我现在几乎可以理解所有代码了,之后一切都非常简单。 My best recomendation is that you modify all of the code they give you, this will force you too lookup everything you don't understand. 我最好的建议是,您修改他们给您的所有代码,这将迫使您也查找您不了解的所有内容。 The good thing is that the code on the book is pretty good, and they try to teach you good programming practices on the way so stick to the book. 好的是,书中的代码非常好,并且他们会尝试坚持使用书的方式来教您好的编程实践。

I would continue with the book, it really is good. 我会继续读这本书,真的很好。 However, you might want to look at some other books as well including (but not limited to) Simply Rails 2 and Learning Rails . 但是,您可能还想看看其他一些书籍,包括(但不限于) Simply Rails 2Learning Rails

I found the Pragmatic book to be a good start and the other two to complement it rather well. 我发现这本实用的书是一个好的开始,而另外两本很好地补充了它。 After that, just have some fun digging into some of the internals. 在那之后,请尽情探索一些内部结构。

I would study the code thoroughly. 我会仔细研究代码。 I think you'll find that (if you keep working at it) ROR is pretty amazing. 我认为您会发现(如果继续努力的话)ROR非常惊人。

I think your best bet will be to keep going at a steady pace on the book - going into more detail if you get lost, and if necessary grab a snapshot from online to keep pace if you break things. 我认为您最好的选择是保持书中的稳定进度-如果您迷路了,请详细介绍,如果有必要,请从网上获取快照以保持进度。

From there I would start branching out into many of the other excellent resources available. 从那里,我将开始扩展到许多其他可用的优秀资源。 Pragmatic Programmers have a book called Advanced Rails Recipes that I hear is also fairly good. 实用程序员有一本书,叫做《 高级Rails食谱》 ,我听说还不错。

Since Rails is still moving rather quickly your best bet will likely be, once you have a handle on things, to start following some of the latest news. 由于Rails仍在快速发展,因此您最好的选择就是一旦掌握了一切,就可以开始关注一些最新消息。 Ruby Alltop might be a good place to start looking for more resources. Ruby Alltop可能是开始寻找更多资源的好地方。 I would suggest going through as many Railscasts as you can - they are pretty much the definitive place to pickup Rails concepts quickly. 我建议您尽可能多地浏览Railscasts-它们几乎是快速采纳Rails概念的权威之地。

I would highly recommend supplementing the books with screencasts. 我强烈建议您使用截屏视频对书籍进行补充。 Ryan Bates in particular has done an enormous amount of Rails screencasts at Railscasts , which are freely available. 特别是Ryan BatesRailscasts上进行了大量的Rails截屏,可免费获得。 He has also done some paid screencasts for the Pragmatic Programmers site which are much more in-depth, and very helpful. 他还为Pragmatic Programmers网站做了一些付费的截屏视频,这些视频更加深入而且非常有帮助。

Creating multi-model forms was a bit of an early sticking point for me, and Ryan's Pragmatic Screencast series on forms was very helpful. 对我来说,创建多模型表单是一个早期的坚持点,Ryan 在表单上实用屏幕广播系列非常有帮助。 I would also recommend the ActiveRecord series . 我还建议使用ActiveRecord系列

I started Rails when it was 1.3. 我从1.3开始启动Rails。 I followed the second edition of Agile web development with Rails . 使用Rails关注第二版敏捷Web开发 I was facing hard time finding how the things were happening. 我很难找到事情的进展。 As I did not have any experience of web development this was more painful. 由于我没有任何Web开发经验,因此这更加痛苦。 I followed the book and created the depot application twice but I still did not get very much from this book. 我遵循了本书,并两次创建了软件仓库应用程序,但是从本书中我仍然没有得到多少。

I was having trouble understanding the Ruby code mainly. 我主要在理解Ruby代码时遇到了麻烦。 As said by "listrophy" on #rubyonrails 如#rubyonrails上的“ listrophy”所说

Using rails without knowing ruby is like trying to write a menu at a chinese restaurant with only an english-chinese dictionary. 在不知道红宝石的情况下使用rails就像试图在只有英文-中文字典的中餐馆编写菜单。

You should get yourself up and running with Ruby first only then you should dig into Rails. 您应该首先使用Ruby并开始运行,然后再深入研究Rails。 I highly recommend you the Ruby for Rails book by David Black but for Ruby only. 我强烈推荐您David Black撰写的Ruby for Rails书,但仅适用于Ruby。 Read part 2 and part 3 only from this book. 仅从本书中阅读第2部分和第3部分。 The things about Rails in this book is crap IMNSHO. 本书中有关Rails的内容是废话IMNSHO。 When you are done with Ruby from this book, carry on your journey with the Agile rails book. 当您学习完本书中的Ruby时,请继续学习Agile rails本书。

When you are done with all this, you can check out The Rails Way, The Ruby Way, Pro ActiveRecord books.... The list goes on and on... :) 完成所有这些操作后,您可以查看The Rails Way,The Ruby Way,Pro ActiveRecord等书籍。...清单不胜枚举... :)

The depot application in the Agile book is a great example of a sample Rails application. 敏捷书中的仓库应用程序是示例Rails应用程序的一个很好的例子。 However I suggest you to check out Open Source Rails for some more sample apps. 但是,我建议您查看Open Source Rails以获得更多示例应用程序。 Rails Guides also have some very good tutorials on rails. Rails指南也有一些关于Rails的很好的教程。 As said by everyone else Railscasts by Ryan Bates has some very high quality free rails screencasts. 正如其他人所说,Ryan Bates的Railscasts提供了一些非常高质量的免费rails屏幕广播。

FYI I have a little knowledge about HTML and very little about CSS. 仅供参考,我对HTML有一点了解,而对CSS却了解很少。 You can not learn these technologies by following some book. 您不能通过阅读某些书来学习这些技术。 You will learn these with the experience and time. 您将通过经验和时间来学习这些内容。 Although some books can give you a good start. 尽管有些书可以为您提供良好的开端。 But I do recommend you to learn Javascript-Ajax and stuff. 但我确实建议您学习Javascript-Ajax和其他内容。 For this purpose you should use libraries like Prototype or Jquery. 为此,您应该使用Prototype或Jquery之类的库。 I recommend Jquery as this is much more easier to learn and also more powerful. 我推荐Jquery,因为它更易于学习,功能也更强大。

HTH :) HTH :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM