Friday, January 27, 2012

Ruby/Rails is confusing for noobs

Here are my questions about Ruby/Rails:

  • After automagically generating the model/view/controller code for a given object, I then want to customize the HTML/CSS/JS for some of its views.  What's the right way to do this?  Do I directly edit the files like "show.html.erb"?  If I do, then don't I lose the ability to automagically update them when I add fields to that object?
  • ERB vs HAML appears to be a religious war... has anyone cleanly summarized the pros and cons?  I would rather not choose randomly, nor spend two hours reading articles about this just so I can decide.
  • Rails 3.2 came out on Jan 20.  Should I use it?  Are Rails releases typically well-tested upon release, or do they typically have bugs that I should hang back and let other people find?
  • Speaking of Rails 3.2, the wonderful site http://api.rubyonrails.org/ seems to have already switched to showing the 3.2 API.  But I'm using 3.1... how can I see the 3.1 API documentation?  Shit, just noticed that http://guides.rubyonrails.org/ switched over to 3.2 as well.  Must I therefore switch?
  • To generate the 3.1 documentation on my own machine, are these the steps I must follow?  http://www.nullislove.com/2007/05/29/rails-documentation/  This post is from 2007, I expect things have changed since then!  Here's more confusing garbage from 2007: http://www.ruby-forum.com/topic/113997  Sadly all the top hits appear to be from 2007.
  • Where do I put the static images that my site is serving?  /public/images or /app/assets/images?  I would like to use image_tag to generate my image tags.  http://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html claims that "By default, Rails links to these assets on the current host in the public folder" , but in my own system the generated image_tag has a src of "/assets/img.png" which ends up being served from the directory /app/assets/images.  So, the docs are lying, they are not linked to the public folder.  Or is my setup misconfigured somehow?  Which files in my setup control this behavior?

Here are the meta-questions:
  • Where can I find best-practice source code for non-trivial sites built in Ruby/Rails?  I could then mine that code as a source of examples.
  • Where are the best up-to-date tutorials and references for Ruby/Rails?  Videos don't count because they're not searchable and their effective bit-rate is excruciatingly low, compared to well-written text.  http://guides.rubyonrails.org/ is nice but appears to leave many important questions and issues unanswered
  • Where can I best find out how to do X with Ruby/Rails?  For example I want to use jquerymobile for my UI.  What's the best way to integrate jquerymobile into Ruby/Rails?  Should I use a Gem?  There appear to be three competing gems for this.  And on further inspection they each seem to be pretty trivial, and potentially out of date.

No comments:

Post a Comment