4 ms·
Here's what worked for me: 1) Do the grunt work: Make sure you have a basic understanding of Ruby syntax, especially how Hashes and method arguments work. The
by mwmanning 19y ago
Here's what worked for me:
1) Do the grunt work:
Make sure you have a basic understanding of Ruby syntax, especially how Hashes and method arguments work. The code in most Rails books, and even the code generated by Rails itself uses lots of syntactical shortcuts (ex. not putting () around method arguments, not putting {} around hashes). This can be really confusing since the majority of Rails methods take in at least one Hash as an argument. It's critical that you understand what your data structures are and what's being passed.
2) Dive in:
Find a simple project to do. Make it something close to the Depot application (or whatever the example app is in the newest version of AWDwR), but not exactly the same.
3) Documentation:
I heavily use the Ruby core documentation (http://ruby-doc.org/core/ http://ruby-doc.org/core/) and the Rails api (http://api.rubyonrails.org/ http://api.rubyonrails.org/). These are absolutely critical when you're debugging and you need to know what's going on behind the curtain.
If you're going to be working on a train without an Internet connection, I would strongly suggest that you get yourself a local copy of the Rails api by running the command "rake doc:rails" and that you get really friendly with the "ri" command which gives you Ruby documentation.
4) Tinker, tinker, tinker.
Look at other people's code. Install plugins and try to understand how they work. Constantly tweak your app to do something new or improve something it already does.