background preloader

74 Quality Ruby on Rails Resources and Tutorials

74 Quality Ruby on Rails Resources and Tutorials
Learning Rails from scratch can be a pain. But don't fret, this guide provides the best Rails resources the Web has to offer. Ruby on Rails is quickly becoming one of the most popular modern programming language framework combinations. Related Articles: Fortunately for you, we've compiled a list of the best Rails resources the Web has to offer. Installation Sometimes, the most time consuming part of learning a new programming language is simply installing a working version of the software. Manual Installation If you're interested in getting Rails to work on your own, you'll need to follow the following steps: Ruby – First you need to download Ruby. Why do all of the work when someone else will do it for you? Instant Rails – One-click Rails installer for Windows. These step-by-step guides will walk you through the installation process. How-tos Installation – If you get stuck, or want to try to install Ruby to a more obscure operating system, look here. Tutorials Beginner Tutorials Try Ruby!

19 Rails Tricks Most Rails Coders Don’t Know New to Rails 3? Check out the Ruby on Rails 3 Tutorial book and screencast. A book and screencast series showing you how to develop and deploy industrial-strength Rails apps in a direct, step by step way. Please note that this post is over four years old - it's from 2006! When looking at my own Rails code and that of the community as a whole, I often see places where certain Rails techniques could have been used, but weren't. Benchmark logic in your controller actions - It's really easy. User.benchmark("adding and deleting 1000 users") do 1000.times do User.create(:name => 'something') x = User.find_by_name('something') x.destroy endend Of course, your code would be a lot better ;-) The regular SQL logs are not shown when within the benchmark sections. acts_as_nested_set - Almost everyone is familiar with acts_as_tree, but acts_as_nested_set snuck into Rails quietly. You can learn a little more here. Get lots of info about requests - Checking request.post?

Ruby Procs And Lambdas (And The Difference Between Them) As you know, I am a big believer in knowing the basics. I find it is especially valuable to go back to the fundamentals of whatever skill you're trying to master periodically, as you gain more experience. Somehow you're always able to extract something valuable from the experience due to the extra insight you've acquired along the way. Recently I've been looking more closely at some Ruby concepts that I may have glossed over when I was learning the language initially, so I will likely be writing about this in some of my upcoming posts. I thought I would begin with one of the most powerful features of Ruby – procs (and lambdas :)). What's So Good About Procs? You know how everything in Ruby is an object, well, as it turns out that's not quite true. Procs And Lambdas In Detail There are three ways to create a Proc object in Ruby. Using Proc.new. Those are all the different ways to get a Proc object in Ruby (either a proc or a lambda). Procs Are First Class (Functions That Is)

21 Ruby Tricks You Should Be Using In Your Own Code Writing for Ruby Inside, I get to see a lot of Ruby code. Most is good, but sometimes we forget some of Ruby's shortcuts and tricks and reinvent the wheel instead. In this post I present 21 different Ruby "tricks," from those that most experienced developers use every day to the more obscure. Whatever your level, a refresh may help you the next time you encounter certain coding scenarios. Note to beginners: If you're still learning Ruby, check out my Beginning Ruby book. 2009 Update: This post was written in early 2008 and looking back on it, there are a couple of tricks that I wouldn't recommend anymore - or to which extra warnings need to be added. 1 - Extract regular expression matches quickly A typical way to extract data from text using a regular expression is to use the match method. email = "Fred Bloggs <fred@bloggs.com>"email.match(/<(.*?) Ultimately, using the String#[] approach is cleaner though it might seem more "magic" to you. x = 'this is a test' x[/[aeiou].+? puts x == 10 ?

Ruby Regular Expressions A regular expression is a special sequence of characters that helps you match or find other strings or sets of strings using a specialized syntax held in a pattern. A regular expression literal is a pattern between slashes or between arbitrary delimiters followed by %r as follows: Syntax: /pattern//pattern/im # option can be specified%r! Example: #! This will produce the following result: Line1 contains Cats Regular-expression modifiers: Regular expression literals may include an optional modifier to control various aspects of matching. Like string literals delimited with %Q, Ruby allows you to begin your regular expressions with %r followed by a delimiter of your choice. # Following matches a single slash character, no escape required%r|/| # Flag characters are allowed with this syntax, too%r[</(.*)>]i Regular-expression patterns: Except for control characters, (+ ? Following table lists the regular expression syntax that is available in Ruby. Regular-expression Examples: Literal characters: #!

Home - hydra - GitHub A MiniTest::Spec Tutorial: Elegant Spec-Style Testing That Comes With Ruby Despite RSpec's awesomeness, Test::Unit remains the most popular Ruby testing tool out there outside of Rails apps. I've recently been code walking through a lot of Ruby libraries for my Ruby Reloaded course and the typical arrangement is Test::Unit, sometimes coupled with Shoulda or Contest for some extra syntactic sweetness. Part of the reason for Test::Unit's enduring popularity is its presence in the Ruby standard library but, also, its general 'lightness' and speed. When you're writing a large app, using a powerful full-featured system like RSpec has significant benefits (particularly stakeholder involvement in writing the specs). But when you're working on a library that might spread far and wide and is aimed solely at developers, the pros of Test::Unit shine through. Enter MiniTest Note: Ruby 1.8 users can run gem install minitest to get MiniTest too but it's not part of the standard library there. What Does MiniTest::Spec Look Like? Nothing too unusual there, I hope. Give It A Try

AJAX on Rails 2.1 Tutorial Advertisements Ajax stands for Asynchronous JavaScript and XML. Ajax is not a single technology; it is a suite of several technologies. Ajax incorporates the following: XHTML for the markup of web pagesCSS for the stylingDynamic display and interaction using the DOMData manipulation and interchange using XMLData retrieval using XMLHttpRequestJavaScript as the glue that meshes all this together Ajax enables you to retrieve data for a web page without having to refresh the contents of the entire page. When you interact with an Ajax-powered web page, it loads an Ajax engine in the background. For a complete detail on AJAX you can go through our AJAX Tutorial Rails has a simple, consistent model for how it implements Ajax operations. Here is a typical sequence of activities: While discussing rest of the Rails concepts, we have taken an example of Library. In this example we will provide, list, show and create operations on subject table. This is bit new here. We will action see it in a moment.

airblade&#039;s css_dryer at master - GitHub Blog — All about Ruby programming. The Wonderful Tech Wizards of Oz Photo by David Jackmanson / Flickr The Information and Communication Technology sector is the fifth highest paying career group in Australia, with entry salaries starting at $88,000 and median salaries of $100,000. This ranking is both because of, and contributes to, Australia’s growing IT leadership. Over 50 software companies are listed on the Australian Stock Exchange. The growth of technology centers created by governmental planners and business networks, such as the Bentley Technology Park in Western Australia (adjacent to Curtin University of Technology), the Digital Harbour at Docklands in Melbourne, and the Macquarie Park in Sydney (including the Research Park and Macquarie University), combined with respected universities and the roll-out of the National Broadband Network, all demonstrate the IT successes of the Aussies! School ‘Em at Home! And Hook ‘Em All Up!

Ruby on Rails Tutorial: Learn Rails by Example | Ruby on Rails 3 Tutorial book and screencasts | by Michael Hartl Michael Hartl Contents Foreword My former company (CD Baby) was one of the first to loudly switch to Ruby on Rails, and then even more loudly switch back to PHP (Google me to read about the drama). This book by Michael Hartl came so highly recommended that I had to try it, and the Ruby on Rails Tutorial is what I used to switch back to Rails again. Though I’ve worked my way through many Rails books, this is the one that finally made me “get” it. The linear narrative is such a great format. Enjoy! Derek Sivers (sivers.org) Founder, CD Baby Acknowledgments The Ruby on Rails Tutorial owes a lot to my previous Rails book, RailsSpace, and hence to my coauthor Aurelius Prochazka. I’d like to acknowledge a long list of Rubyists who have taught and inspired me over the years: David Heinemeier Hansson, Yehuda Katz, Carl Lerche, Jeremy Kemper, Xavier Noria, Ryan Bates, Geoffrey Grosenbach, Peter Cooper, Matt Aimonetti, Gregg Pollack, Wayne E. About the author Copyright and license 1.1 Introduction

Related: