Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Rails or Ruby documentation?

I'm coming from C#, and recently I started to write some Ruby on Rails applications.

My biggest problem with it is the documentation because I find it extremly difficult to use. For example, finding out how to call generator from my controller took me about 2 hours and then 15 minutes after that I found Rails::Generators.invoke method to figure out what arguments should I pass to this function.

Maybe I use the documentation the wrong way; First I take a wild guess and search in the Netbeans code completion, which is rarely helpful, then I search in Google, then go with the API.

Can some experienced Rails programmer give me some advice?

like image 901
Adrian Serafin Avatar asked Nov 03 '10 08:11

Adrian Serafin


2 Answers

If you're new to rails I recommend you read a book before you dive into the API documentation.

Here are two recommendations:

  • Agile Web Development With Rails - Great introduction and reference on how to use rails.
  • Programming Ruby 1.9: The Pragmatic Programmers' Guide - More on Ruby. Great references!

After you've worked your way through those books, you'll have an idea of how Rails is designed and where to look for stuff.

Both books are great reference books. If you want to access the Rails and Ruby API's online, make sure to checkout RailsApi.com

like image 91
Ariejan Avatar answered Oct 10 '22 08:10

Ariejan


I am describing my own very personal workflow with Ruby/Rails documentation:

  1. You can use ri and rdoc if you are familiar with the console, but...
  2. Personally, I recommend two very good Ruby/Rails documentation sites:

    • apidock.com (no good search, but sometimes fine examples)
    • railsapi.com (very good AJAX search, plus you can customize what documentation you would like to see - by versions and by Gems)
like image 32
Sergey Avatar answered Oct 10 '22 07:10

Sergey