I am new to Rails, and I am finding it extremely opaque. I have a copy of the latest Agile Web Development with Rails, but my worry is that without this book I would be completely lost.
For example, following the depot example in the book, when it comes to adding validation to the model, you do
class Product < ActiveRecord::Base
validates :title, :description, :image_url, :presence => true
end
Seems easy enough, except that without the AWDwR book I would never have figured this out. There is nothing in the ActiveRecord::Base documentation that mentions the validates method.
It seems to me that with Rails you are just supposed to mysteriously know what methods are available at any given point in a project. But if you don't know, how are you supposed to find out (apart from memorizing a 500+ page book)?
I can phrase the question another way: In my Product class, I have available to me a method named validates. How is this method made available to my Products class? Even knowing that it is defined in ActiveModel::Validations::ClassMethods (I know this because I looked it up) I cannot figure out how it has been made available to my Product class.
Opaquesums it up nicely. Notice the plethora of questions on SO about Rails - a lot of them stem from the fact that Rails really does make you feel "out in the cold". The documentation is nowhere near the quality it should be. Everything is scattered, no cohesion. Much as I like Rails, I'm wondering why the documentation isn't better. Maybe because everyone that knows Rails just wants to write their own theories and make money selling books. Wish there was a document structure like MSDN!