Articles

MacRuby Presentation from RubyFest

On Thursday I presented remotely at RubyFest about MacRuby. I put together a 30 minute video and short demo app.

Download MacRuby Presentation at RubyFest, 46 MB

Quest for a Clean Machine

My last machine finally died a slow, painful death, so I have the opportunity to start with a new, fresh machine. As usual, I begin with high hopes of keeping things clean and easy to navigate, but I anticipate failure. In an effort to stave off that failure, I’ll be blogging specific techniques (successful and failed) that I use to try and keep things organized.

My steps so far:

Documentation Explosion

RDoc.info is a web service that generates and hosts documentation for your favorite GitHub-hosted Ruby libraries and Rails plugins. Just add a post-commit hook to your project and it’ll take care of updating your API docs every time you push to the remote.

About About.com and Being Nice (or not)

"I used to think of ruby.about.com as just yet another source of dull and uninspired Ruby content designed to churn ad clicks. But that is because I never noticed that they do an evil, Digg-bar style content hijacking on their outbound links. . . ." — Gregory Brown (@seacreature)

Gregory Brown is up in arms about the way about.com handles outgoing links, and he's absolutely right. You can go

Make it so with RSpec Macros

RSpec macros (like those in the fantastic Remarkable library) ease spec writing for repetitive tasks, but is that process more effort than it’s worth? No—it’s actually quite easy to write and include macros for your specs to do some of the standard heavy lifting.

This is a great resource to get started with how to write the actual macros (or custom matchers) themselves.

E-mail Typo

I added a couple of e-mail links to a few pages earlier, but introduced a typo. The correct e-mail address is

, repleat with the correct number of R's! Sorry about that! (And thanks to the several people who pointed it out so quickly!

Rails 2.2 gotcha - inline subclasses

Due to the way Rails' development mode works, you need to make sure you don't define subclasses in your "concern" files like this:

# status.rb
class Status
  include "status/filtering"
end

and then

# status/filtering.rb
class Status
  module CustomAssociationExtension
  end
end

Instead, you should have a file app/models/status/custom_association_extension.rb so that rails can easily find it.

Rails 3 API and Hadoop, Map Reduce, and Pig to be Presented

We’re extremely excited to announce two of the newest additions to our ever growing speaker list for Aloha on Rails. This conference is shaping up to be a true testament of the breadth and aloha of the Rails community.

Yehuda Katz, core committer and spearheading the Merb/Rails merger, will teach us the principles of the Rails 3 API. He will show us how to read and understand the Rails source code so we can customize the framework just the way we want. The public API for Rails 3 is a major development, and will help stabilize the plugin and extension ecosystem.

Include vs Extend in Ruby

In which I show the difference between include and extend when working with modules in Ruby.

Now that we know the difference between an instance method and a class method, let’s cover the difference between include and extend in regards to modules. Include is for adding methods to an instance of a class and extend is for adding class methods. Let’s take a look at a small example.

ruby script/plugin git does not work in Rails 2.3.2 and Ruby 1.9

Lots of people are scratching there head over why they cannot
install rails plugins using git.

I'm working with Ruby 1.9.1 and Rails 2.3.2. And git is a pretty natural
for working with version control.

MP3 | Rails Fire

MP3

Rails 2.3.4 + SWFUpload: Gracefully Degrading Rails File Uploads

uploader.png Over on the Jetpack Flight Log, Brian Racer demonstrates how to use SWFUpload with Rails 2.3.4 to implement slick, yet gracefully degrading, Rails file uploads powered by Flash. It's an impressive walkthrough post.

Rails Envy Podcast – Episode #096

Episode #096. Dan Benjamin (Playgrounder, Hivelogic) is back this week. We each had some background noise and an awkward moment. But it’s funny.

Rails Envy Podcast – Episode #095: 10/08/2009

Episode #095. Dan Benjamin (Playgrounder, Hivelogic) is back this week and we keep it quick while still packing in the news.

Rails Envy Podcast – Episode #094: 10/02/2009

Episode #094. Dan Benjamin (Playgrounder, Hivelogic) is back this week and we had some help from Adam Keys with stories. Also, I shamelessly steal a Mitch Hedberg joke and apply it to Rackspace.

In case you missed it last week, we’re now accepting stories and feedback to @railsenvy on Twitter. You know, if you feel like letting us know about something.

Rails Envy Podcast – Episode #093

Episode #093. Dan Benjamin (Playgrounder, Hivelogic) is back this week. We’ve got a ton of news this week and just maybe an awkward moment or two. Also, I mis-pronounced John Mettreaux’s name wrong, calling him Jake. Sorry about that.

Update: We’re now accepting stories and feedback to @railsenvy on Twitter. You know, if you feel like letting us know about something.

Rails Envy Podcast – Episode #092: 09/17/2009

Episode #092. I’m joined again by Dan Benjamin and we have quite a fun time. You may know Dan from his compiling Ruby, Rails, and MySQL guides, cork’d, and most recently Playgrounder. We’ve got a ton of news this week and I promise to have a song stuck in your head by the time you finish.

Rails Envy Podcast – Episode #091: 09/10/2009

Episode #091. I’m joined again by Dan Benjamin and we have quite a fun time. You may know Dan from his compiling Ruby, Rails, and MySQL guides, cork’d, and most recently Playgrounder. We’ve got a ton of great content this week and we tried to keep it a bit more brief than last week.

Rails Envy Podcast – Episode #090 – 09/03/2009

Episode #090. I’m joined today by Dan Benjamin and we have quite a fun time. You may know Dan from his compiling Ruby, Rails, and MySQL guides, cork’d, and most recently Playgrounder. Dan’s going to be hosting the podcast for a little while now and I’m thrilled to have him as a co-host.

File upload in ruby on rails.

There are lots of plugins available for upload files in ruby on rails.

file_column plugin:
attachment_fu
flex_image
upload_column
and many more

Accoding to  me, all these file are more useful for image uplaoding not other files like voice file, pdf and other.
So I made a defination which check following things and then upload a file on defined location.
1. File extension.
2. Mime [...]

Protecting your Paperclip downloads

Way back last November when I first blogged about Paperclip I included a brief mention of hiding files behind a controller rather than simply putting them in the public directory for all to see.

Syndicate content