I'd like to introduce my new series of screencasts called "Rails 101", I realised that while Rails is really taking off, many people are put off by the lack of comprehensive beginner screencasts and the need to shell out masses of money on expensive books.
While these screencasts will be aimed at beginners, I'd hope that more advanced Rails developers will find them useful to fill gaps in their knowledge. Alongside the videos there will also be a transcript so if you don't have the bandwidth or environment to watch videos, you have an alternative.
Let's crack on with the first episode: Introduction to Rails.
We'll cover creating a project in the next screencast as there are a few things you need to hear about before you dig in to coding.
First of all there might be a little confusion with the name of Ruby On Rails, because Ruby on Rails isn't a language. Ruby is the language, Rails is just a framework built on top specifically designed for web applications. So for this reason the framework is often simply related to as Rails.
Both Ruby and Rails are open-source and cross platform, so it doesn't matter if you are running Windows, Linux or Mac OS. However it does seem to be more difficult to setup on Windows, most developers like to use Mac OS so they can use TextMate, and in Leopard Ruby and Rails are bundled as standard.
You'll spend a lot of time in the terminal or command prompt, and this might be scary at first, but it does mean you can open your documents in any text editor, and there is no need for a resource intensive IDE.
Saving time.
Gems and plugins are little bundles of code which anyone can write to share with others, so when you're looking to do something a little complicated like integrate Flickr or Twitter into your application, rather that writing loads of code, simply download a gem or plugin.
The difference between gems and plugins is that gems are available to any ruby code, whereas plugins are Rails specific, so depending on whether the bundle needs to use Rails features or not will define whether it is a plugin or a gem.
You can install gems anywhere within your system, so all you have to do is open terminal and type gem install followed by the name of the gem, whereas plugins are installed into specific Rails applications you are writing, so you need to navigate to the project and then type script/plugin install followed by the url of the plugin.
Database Connectivity.
Rails supports numerous different database types including MySQL, SQL server and Oracle, however the default is SQlite. Personally I find that SQlite for development and testing is great, but for production you want a proper database server so MySQL does the trick nicely.
In Rails 2.1 there is a database console where you can manually run SQL queries while you develop, to boot it up in your terminal simply type script/dbconsole.
Editors.
Finally, you'll see in this set of screencasts and others on the web the command "mate" followed by a full-stop commonly used in the terminal, all this does is open the current directory in TextMate, so if your editor has a similar function you can substitute it in, otherwise just open the folder manually from within your chosen application.
discuss this topic to forum
