# NewB questions

**URL:** <https://www.ruby-forum.com/t/newb-questions/141244>\
**Category:** Rails\
**Created:** [June 23, 2008, 11:44pm UTC](https://www.ruby-forum.com/t/newb-questions/141244 "2008-06-23T23:44:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pruckelshaus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/82dd89/32.png) [@pruckelshaus](https://www.ruby-forum.com/u/pruckelshaus)\
**Post date:** [June 23, 2008, 11:44pm UTC](https://www.ruby-forum.com/t/newb-questions/141244/1 "2008-06-23T23:44:19Z")

</div>

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:

1. 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.
2. 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?
3. 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).
4. 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

---

<div class="post-metadata">

**Author:** ![pruckelshaus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/82dd89/32.png) [@pruckelshaus](https://www.ruby-forum.com/u/pruckelshaus)\
**Post date:** [June 24, 2008, 1:54am UTC](https://www.ruby-forum.com/t/newb-questions/141244/2 "2008-06-24T01:54:00Z")

</div>

1. All SQL commands are handled by Rails unless you explicitly tell it  
to do  
something in SQL.
2. new\_recipe\_path is a method generated by calling map.resources  
:recipes  
in your config/routes.rb file. For more information see here:  
[frozenplague.net](http://frozenplague.net/2008/01/06/restful-routing-an-overview/)
3. Just nest the method calls: link\_to(image\_tag(“woop.jpg”),  
new\_recipe\_path)
4. You can set constants in config/environment.rb, right at the bottom  
of  
the file (that’s my favourite spot)

–  
Appreciated my help?  
Recommend me on Working With Rails  
[http://workingwithrails.com/person/11030-ryan-bigg](http://workingwithrails.com/person/11030-ryan-bigg)

---

<div class="post-metadata">

**Author:** ![pruckelshaus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/82dd89/32.png) [@pruckelshaus](https://www.ruby-forum.com/u/pruckelshaus)\
**Post date:** [June 24, 2008, 6:43pm UTC](https://www.ruby-forum.com/t/newb-questions/141244/3 "2008-06-24T18:43:08Z")

</div>

Pete Ruckelshaus wrote:

> 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:

Hi Pete,

Have you picked up a book for learning Rails? That would be very good  
investment, not only of a few of your dollars, but a number of your  
hours. Agile Web D. with Rails is a great resource. It is  
currently being updated for Rails 2.x.x, so if you get the older one, it  
will be for Rails 1.2. There are some differences that could trip you  
up, but there have been some posts here and elsewhere describing the  
differences and making it possible to use the older book with newer  
Rails. Or, you could just install Rails 1.2.6 and not worry about it.

Peace,  
Phillip
