Hi,
A project came up that has made me realize that it’s time to learn RoR.
I’ve got everything up and running (Ruby 1.8.6, Rails 2.1, MySQL 5,
Webrick) and am using Aptana with RadRails for development. I’ve
installed the “recipes” demo application and have been poking around for
the past couple of hours, and now I have a few questions about how
things work:
- Where’s the SQL? I see the methods that get the data in
recipes_controller.rb, but can’t for the life of me figure out how Rails
gets the info from the database, SQL-wise. - On the main recipes page, there is a link to create a “new recipe”
with this code: <%= link_to ‘New recipe’, new_recipe_path %>. I’m
assuming new_recipe_path is a variable set somewhere, but I can’t find
where it’s being set? - How do I extend Rails? I like the idea of things like <%= link_to
… %>, but say I want to do something like this: <%= link_image_to
image_path(“new.png”), new_recipe_path %> (i.e. make the link an image
rather than text, which I can’t find in the API so assume does not
exist). - Where do I set constants for the entire app,
/app/controllers/application.rb?
One thing that has also occurred to me while looking at the sample app
and a number of online resources is that Ruby on Rails is somewhat
limited in its scope; in other words, it seems great for fairly
straightforward applications, but for “big and ugly” apps like auctions,
online ticket sales, and that sort of thing, it might not be the best
tool to use. Is this a fair assessment? My other primary programming
languages are Java and ColdFusion; CF gets bashed a lot for being web
development on training wheels, but sometimes that’s what I like about
it…however, I’ve been able to build some rather complex apps with it.
Thanks for any answers and/or insight you can provide,
Pete