background preloader

ROR Tuts

Facebook Twitter

Minecraft Mod with RubyBukkit. The other day I went to CoderDojoDC and it seemed like every kid there was obsessed with Minecraft.

Minecraft Mod with RubyBukkit

I recently interviewed Charles Nutter, who mentioned you could mod Minecraft with JRuby. I wanted to get some experience with it so I could help the kids out, so I figured I’d give it a shot. It wasn’t hard! I did this with Ubuntu linux. YMMV with other OS’s, but it shouldn’t be that much different. Gather your forces. Ruby on Rails Guides. Rails 4 Countdown to 2013. An Introduction to Ruby On Rails Presented At a Boston Ruby Group Project Night - Ruby on Rails Consultants Based in Boston, MA. Learn rails. Ruby on Rails Edge Guides. Ruby, Rails and JavaScript Tutorial Catalog.

RubySource » For Ruby & Rails Developers. Unholy Rails: External Scripts, jQuery Plugins, and Page-Specific JavaScript. By Daniel Kehoe Last updated 31 December 2012 Rails and JavaScript topics: How to include external JavaScript files and jQuery plugins in Rails 3.1 or newer.

Unholy Rails: External Scripts, jQuery Plugins, and Page-Specific JavaScript

BroadcastingAdam. 19 Rails Tricks Most Rails Coders Don’t Know. New to Rails 3?

19 Rails Tricks Most Rails Coders Don’t Know

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. The screencast series includes 12 lessons over more than 15 hours! Get the best "over the shoulder" experience of following what a top Rails 3 developer does when building an app today. Click here to learn more.

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. Rails Development - 10 pro tips. 5 mistakes that make you look like a Rails n00b. Update: As pointed out in the comments & elsewhere, these bad practices are common to those learning many (most?)

5 mistakes that make you look like a Rails n00b

Programming languages, and are not necessarily specific to Rails. My experience is just with teaching Rails, where I see these often, so that’s the context in which I can assert that they are common. The Best Way to Learn Rails. I come from a PHP background, but these days, I'm a full-time Rails developer.

The Best Way to Learn Rails

The difficulty for most people who make the switch lies in the learning curve that’s involved. Once you've become proficient in a language or framework, switching to a new one feels like an unnecessary (and time-consuming) challenge. However, learning Ruby and Rails is actually pretty easy! It's an incredibly powerful framework, and has a huge community pushing it along. #310 Getting Started with Rails - RailsCasts - Vimperator - FF13 - Developper. Dec 26, 2011 | 7 minutes | Tools.

#310 Getting Started with Rails - RailsCasts - Vimperator - FF13 - Developper

Rails 4 Whirlwind Tour. Ruby on Rails Tutorial: Learn Rails by Example book and screencasts by Michael Hartl. Ruby on Rails: Documentation. Video Presentations. Ruby on Rails Screencasts - RailsCasts. Rails best practices list. Split your cap tasks into different files. Posted by flyerhzm on September 10, 2012 Your capistrano deploy.rb file might become complicated with the growth of your application, contain more and more cap tasks, it would be better to split these tasks into different files according to the functionalities, which makes it easy to maintain, and they are more likely to be reused in the future.

split your cap tasks into different files

I worked on a large project, it contains a lot of capistrano tasks, which makes it more and more difficult to maintain. Before After application grows, I saw too much tasks written in config/deploy.rb file, it was messy. e.g. After Inspired by require external capistrano recipes (like bundler and rvm), I prefer splitting the tasks into different files according to the functionalities, like We have 3 capistrano recipes, asset_pipeline, cron and sitemap, each with one functionality, and then you can easily load them in config/deploy.rb. Use after_commit. Posted by flyerhzm on May 02, 2012 Most developers use AR callbacks after_create/after_update/after_destroy to generate background job, expire cache, etc., but they don't realize these callbacks are still wrapped in database transaction, they probably got unexpected errors on production servers.

use after_commit

A relational database, like mysql, provides transactions to wrap several operations in one unit, make them all pass or all fail. All isolation levels except READ UNCOMMITTED don't allow read data changes until they are committed in other transaction. If you don't realize it, you probably introduce some unexpected errors. Optimize db migration. Nowadays it's easy to reach millions users for a startup website due to sns success, that means the tables on production server are huge, if you want to alter table structure, like add a new column, it may takes tens of minutes or several hours to execute.

Optimize db migration

If you want to add a new column and drop an existing column to one existing table, by default rails migration will run two alter sql statements, one for add and the other for drop, so it takes double time, but if we merge/optimize the two alter sql statements into one, it saves the migration time dramatically. The followings two are the typical cases to optimize the db migrations. Case 1: add a new column but drop it later db/migrate/20110930100808_add_status_to_users class AddStatusToUsers < ActiveRecord::Migration def self.up add_column :users, :status, :string endend. #382 Tagging. #366 Sidekiq. Sidekiq allows you to move jobs into the background for asynchronous processing.

#366 Sidekiq

It uses threads instead of forks so it is much more efficient with memory compared to Resque. Download: source codeProject Files in Zip (59.6 KB)mp4Full Size H.264 Video (30.6 MB)m4vSmaller H.264 Video (13.4 MB)webmFull Size VP8 Video (14.5 MB)ogvFull Size Theora Video (29.4 MB) #387 Cache Digests. The cache_digests gem (also included in Rails 4) will automatically add a digest to the fragment cache key based on the template. If a template changes the cache will auto-expire. But watch out for the gotchas! Download: source codeProject Files in Zip (61 KB)mp4Full Size H.264 Video (16.2 MB)m4vSmaller H.264 Video (8.08 MB)webmFull Size VP8 Video (10.9 MB)ogvFull Size Theora Video (16.8 MB) Setting up a Rails Server and Deploying with Capistrano on Fedora from Scratch.

This article and video tutorial will teach you how to setup a basic Fedora server for Rails and PostgreSQL deployments. First, we'll setup Apache and PostgreSQL. Then, we'll use phpPgAdmin to create our application's user and databases. After that, we'll setup the Ruby platform using Passenger to run our application. Once all the components are installed, we'll prep our application for deployment using Capistrano. Router Basics. The core of any Ruby on Rails web application is the data to be accessed. Instead of giving you a thin layer over the HTTP server and saying "have at it! " and forcing you to invent your own (possibly wrong, or at least inconsistent) interfaces to this data, Ruby on Rails has a sane default that you probably want for 99% of all of your data: resources.

But before you can understand resources, you need to understand routing and CRUD. Routing. Zero-to-Sixty: Creating and Deploying a Rails App in Under an Hour. Twice a month, we revisit some of our readers' favorite posts from throughout the history of Nettuts+. This tutorial was first published in January, 2010. How to Build an Unobtrusive Login System in Rails. An unobtrusive login system is one that gets out of the user’s way. It will make your application nicer and more polished. This article will guide you through the process of setting up user logins, then ajaxifying the process by moving the form into a modal box that communicates with the server. Additionally, this article will show you how to create the setup using jQuery and Prototype so you can choose your favorite library. Advanced Caching in Rails: Revised.

I've decided to finally update my advanced caching post. The original is over a year old. Super Charge your Rails App with Rack Cache and Memcache. Slow is sweeping the nation: slow food, slow living, and slow reading. Build A Rails Stack - Chef - Opscode Open Source Wiki. Environment Setup First, let's configure the local workstation. OMG, Ninjas! - Quick Tip: Easily create single page applications with Sprockets.

For a new side project, I needed an easier way to create (and serve) a Single Page Application. Les Hill — Backbone.js and Rails (Part 1 of 2) “Down Mexico Way” Asset Pipeline. 1 What is the Asset Pipeline? The asset pipeline provides a framework to concatenate and minify or compress JavaScript and CSS assets. It also adds the ability to write these assets in other languages and pre-processors such as CoffeeScript, Sass and ERB. Rake - Ruby Tutorials. Rack from the Beginning. This post is out of date and contains some technical errors. Checkout the Rack Bootcamp for an update version with new sections. Rack is the HTTP interface for Ruby. Ruby on Rails E-commerce.

Pg_power - ActiveRecord extension for PostgreSQL - Sergey Potapov. Would you like a Mobile App with That? Shopify/active_merchant.

Ruby