

I'm learning RoR and finding it confusing. Any advice? - solipsist

I've been learning Ruby on Rails for the past few weeks and, while I have found it to be a fun experience, there are a few aspects to it that still confuse me. Thus, I haven't really got the hang of it yet. I'm plan to stick with it, but I wanted to see if anyone had advice on how I can make it the best experience possible.<p>The problem I've been having is getting used to the many shortcuts Rails offers. These shortcuts do a lot of things automatically in the background and minimize the code we have to write. While they probably work great for RoR pros, they are terribly confusing when it comes to learning the framework.<p>I've been working out of the book <i>Ruby on Rails Tutorial: Learn Rails by Example</i>. It includes a lot of shortcuts such as <i>resources :resource</i> in routes.rb, <i>model_path(@model)</i> instead of <i>model_path(@model.id)</i>, and many other shortcuts in the <i>form_for()</i> helper method. These shortcuts could easily be interchanged with manual implementations that make more sense at a glance, so there isn't necessarily a problem. However, these shortcuts are referenced in books and online and are what beginners are being exposed to. For a lot of the shortcuts, I have no idea how to implement them manually (which would be nice for flexibility).<p>It's overwhelming the amount of things that can be done automatically for you when it comes to Rails, which is what most books teach. They give me the impression that I am limited to what I can do in Rails. This is not true, but right now I do not have the knowledge to manually do a lot of the things that I have been taught to do using shortcuts.<p>Has anyone had a similar experience when learning RoR? Are there any good online references or books that avoid the shortcuts (besides the documentation)?<p>P.S. I am still not fully confident about how things are named in Rails. I'll create a resource with a name I've chosen, and then Rails will automatically generate views, routes, paths, and url's based off that. I sometimes have to guess and take a 'leap of faith' when deciding what names to reference as I was not the one who created them.
======
garry
I highly recommend reading the source. Download the source, and read through
the implementations, especially around routing. For most open source, not just
Rails, this is often your best bet. I rarely use any open source software out-
of-box without digging around the source.

This can be confusing with Ruby because it can be tough to figure out where
methods are, due to module loading. I usually load the whole Rails source in
Textmate and then use something like the Grep In Project plugin so that it's
easier to search around for specific methods.

You'll never get the detail you really want out of just reading documentation.

------
maheswaran
The problem is that every single tutorial on RoR talks about dirty and useless
scaffolding and resource features.

Just forget about resources and model path bullshit while learning RoR

Start with active record then learn basic mvc routes, controller and views.
Pretend RoR is just php and get comfortables with the things you usually do in
php. Then try to learn form_for and all the other bullshit out there.

From my personnal experience, never use any fancy features like form_for and
all in a serious projects. When they upgrade rails your project will gets
screwed. Stick to basics.

