Hal:
Ruby is just another programming language, like Perl or BASIC. It can do anything you put your mind to.
Rails, itself, is a totally separate package. With this package it allows you to create an application and separate the applications you develop into three distinct parts (let's focus on web applications):
- Model - think of this as "an object per table" (when using SQL). So you have a model, and you load it. What did you just do? You ran a SELECT query on that table to grab every attribute and store it in a OOP class. So you can do things like User.firstname = 'trache' and then user.save and boom, you've just run an UPDATE query on the table itself.
This also includes anything "business logic". Usernames not supposed to be greater than 20 characters? This stuff goes here. This ensures data integrity... up to a point.
- Views - These are templates. Think of PHP, only the Way It Was Meant To Be(tm). You know, when you're "supposed" to have an HTML file with HTML code, and then opening and closing PHP tags to print variables out when you want to?
- Controller - This is where all the action occurs. You hit a controller and it loads data (models). Then, once you've done your action (displayed a form, gathered input from the web and acted on it) you then work on your output. The controller spits out a view with the template you want using the data you want to put into it.
Wipe hands on pants.
Well, that's a simple way of me attempting to explain it. I know it gets complicated, and it may not be correct, but hopefully you get the gist.
Quote:
Originally Posted by ratbastid
Oh My God, you've so hit what I hate about PHP. Literally, unless you've go the docs right there with you, you can forget coding anything--because this string function might be spelled "string_doaction" or "strfdoaction" or "strDoAction".... God help us all. After working exclusively in PHP every day for over three years, I still only have memorized the proper spelling of a few dozen functions.
|
Let's not forget to mention that the documentation that is supplied on php.net is a moving target. You would think that people would branch the documentation and LOCK it so no one can change it with each version. But, they change the way things work, break compatibility, and you're left to experiment to see what values you get returned to you when all you want to do is
code your damned application.
Oh, and the fact that the code that
is left by "programmers" underneath all the function documentation is very, very poor.
Oh my. Now I'm pissed off. Please, someone offer some Ruby advice/code/tutorials/sites/anything to make me calm down and get off my soap box.