SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2009
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    simply rails 2-ruby reference docs

    Patrick tells you to consult the ruby reference doc for definitions... put in ri plus the word you need defined,I put it in run but that hasn't worked too well. so I look around...I look at the first edition of ruby programing and then I look at the API again, both don't seem to explain much, for example there are hundreds of classes listed in the API, so I click on one...and all the information I see doesn't explain the purpose of the class or the instance methods. Where is there info that explains the purpose of each class and method.

  2. #2
    SitePoint Evangelist
    Join Date
    Feb 2006
    Location
    Worcs. UK
    Posts
    404
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The Ruby core API is pretty good (compared to those I have used with other languages). However, some of the classes don't have particularly expansive documentation. In general, the commonly used classes have the best documentation. For example if you select 'Date' from the centre pane at the top you'll see this page:

    http://www.ruby-doc.org/core/classes/Date.html

    This gives a description of the use of the class at the top, a list of available methods and then some details of each method.

    Similarly if you select 'String' you get:

    http://www.ruby-doc.org/core/classes/String.html

    My experience is that the documentation is fairly good on the classes you use as a beginner, and by the time you need to look up the less used classes, you'll have a better hang of how it all works and the more isoteric entries will make more sense. When I started I was reading the top of the API pages all the time, but now I rarely do as I find all I need to look at are the method details.

    Also the Rails API is a little easier to use (if for no other reason, because the selectors are down the left side and therefore longer and easier to scroll through).

    I'd also recommend using Firefox's Find option (on the Edit menu) to look for key words on the core API page as I've found that the quickest way to find info on certain methods.

    If you want more detail I don't think there is much better than Dave Thomas' "Programming Ruby" book. To be honest the API parts of the online version aren't as easy to access as the paper version.

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2009
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks, that was helpfull. I found the first edition of that ruby book free on line. how much better is the newer versions?

  4. #4
    SitePoint Evangelist
    Join Date
    Feb 2006
    Location
    Worcs. UK
    Posts
    404
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes. The books is available here:

    http://www.ruby-doc.org/docs/ProgrammingRuby/

    Actually, looking at it again, the reference section of the on-line version is much better than I remember it. The key is to use the bottom left pane to find the command/method you are looking for. Also once you've identified a method of interest, it is worth scrolling to the top of the page to read general information about the class or module it belongs to.

    One thing missing from the on-line version is the index. It seems like a small ommision but I think its actually significant. Via the index, you can look up an item and not only find where it is mentioned in the reference, but also in the more descriptive sections of the books. Once you get used to using it, you realise the high page numbers will be in the reference section, and low page numbers in the more descriptive section. So via the index you can choose to look up information about a method in either the desciptive section or the reference.

    I love books so do not have an unbiased opinion. For me on line resources are good, but I alway like to have books to refer to. Sometimes its quicker to find information in them. They are certainly better when you want to read a large chunk. So I'd always recommend buying a copy of Programming Ruby. It is the book I grab off my bookshelf most often (along with "Agile web development with Rails")

    As far as which version to use, I use the second addition Ruby 1.8 version, and that hasn't caused me problems. There is a version to use with Ruby 1.9. If I was buying new, I'd probably get this. But if budget was tight, I'd look for a second hand version of issue 2. Amazons listing copies for less than $5.

  5. #5
    SitePoint Enthusiast
    Join Date
    Sep 2009
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for the advice, I went with the pdf version of the new 1.9 book. he says it would be easy to upgrade my 1.8 to 1.9 . But I am wonderering if it is alright with the instant rails I have to do that.

  6. #6
    SitePoint Evangelist
    Join Date
    Feb 2006
    Location
    Worcs. UK
    Posts
    404
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is currently recommended to use Ruby 1.8.7 with Rails. However, with the speed that things move on with Rails, it won't be long before they move to 1.9. So getting up to speed with 1.9 will mean you are ahead of the curve - which is a good thing.

    The more I use Rails, the more I believe the most important area to study is the underlying Ruby language. The more you understand Ruby, the clearer your code will become, and the more flexible and easier to manage your applications will become. In my experience all study of pure Ruby is good for improving your Rails application development skills.

    To be honest, I am not a fan of Instant Rails. It's fine if you want to fire up Rails to have a quick look at it. However, once you want to do more than that, I think Instant Rails is just adding unnecessary complication. It is so easy to install Rails without Instant Rails.

    For example, to install Rails on Windows all that is needed is:
    • Install Ruby (easiest method via one-click Ruby installer) ensuring Gems in also installed.
    • gem install rails
    • install a database of choice.

    Using this method it is much easier to pick and choose which version of Rails and Ruby you wish to use.

    If you really cannot handle the thought of relying on the command line to fire up mongrel instances and manage the database, then a better way forward IMO, is to use NetBeans. That will give you GUI management of the systems and a whole lot more:

    http://netbeans.org/features/ruby/index.html


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •