Articles

Ignore stuff in svn

If you’re still on svn, here’s how to ignore stuff (like git repos in vendor/plugins")

Outsourcing vs. Offshoring

My experience is that most people think of “outsourcing” and “offshoring” as synonyms. We talk about the general category of outsourcing with slight repugnance, acknowledging that it is occasionally useful for more mundane and unskilled tasks, but it simply won’t work for the more creative tasks that require an American to do it well. (Maybe nobody blatantly says it requires an American, but we know what you’re implying.)

Updating Query Memcached

Since we have been using I18n in Partigi for the last months we have notice that we were always repeating ourselves when localising a sentence like this:

This film has been saved by 4 friends

What is special in this sentece is that, depending on the number of friends that saved the film, the sentence could be "This film has been saved by one friend". It can be solved with pluralize helper, but it requires the counter to be at the beginning of the sentence.

Mephisto 0.8.1: Drax relaunched

Mephisto is officially back! The 0.8.1 release features 157 patches since the start of the month, and several major improvements, including:

Mephisto security advisory

Many web applications suffer from security vulnerabilities, including XSS attacks, CSRF attacks, and a whole catalog of other stuff. A typical vulnerability will give an attacker full administrative access to a site.

Mephisto plugin APIs

Mephisto supports several different kinds of plugins, including:

Benjamin Zander

Thanks to @igrigorik for the link to this wonderful Benjamin Zander talk

Use memoize and to_param for easy rails permalinks

Not sure why anybody on rails 2.2 or above would really need permalink_fu when you can do this:

This is because the params[:id] in you Find(params[:id]) gets to_i called on it, I think. Have to look into that some other time.

You could then go on to memoize this stuff.

How to use link_to object in Rails

So you want to dry up your use of link_to a tiny bit?

In a lot of Rails code you see stuff like link_to user.name, user a ton of times in one application.

Some people go ahead and define a link_to_user(user) helper method. While this is sometimes necessary, in a lot of cases it is not.

Instead, to dry this up, you can simply define to_s for the class of object that you’re linking to, and then just use link_to user, user or whatever object you’re dealing with.

Like this:

sql validations

Dear Rails developers,

Please don’t use sql validations, like null false or length 3.

These are a huge hassle, as they add a layer to activerecord validations that becomes surprising 3 months later.

They are also annoying to get rid of.

That user_id that you thought HAD to be there (so you set null false) might turn out 3 months from now to be non-required, and then whoever is maintaining the code gets a sql error, and then they have to change the column and it’s waste of time. Just use validates_presence_of.

Articles | Rails Fire

Articles

What's New in Edge Rails: Application Generators


This feature is scheduled for: Rails v2.3/3.0

I’m way late to the party on this one, but it’s such a great feature that the least I can do is provide some link love for Edge Rails’ new application template feature.

European Ruby Konference 2009 in Barcelona

I'm glad to announce that we have dates and venue for the next Euruko 2009 in Barcelona, May 9 and 10 in the Citilab, a beatiful place that hosted other big international conferences like DrupalConf or OpenOffice.org Conference.

You can see the official announce in the Euruko web page, we'll open the call for papers in the next weeks, stay in touch!

Ruby on Rails - Are you a Member?

Large Enterprises that use Windows are typically in a Domain environment.
Often application access is controlled by group membership in ActiveDirectory.

The easy and fast way of finding this out, is via ruby-net-ldap, a native ruby implmenation.

So first install ruby-net-ldap
gem install ruby-net-ldap

You will get:

C:\>gem install ruby-net-ldap
Successfully installed ruby-net-ldap-0.0.4
1 gem installed
Installing ri documentation for ruby-net-ldap-0.0.4...
Installing RDoc documentation for ruby-net-ldap-0.0.4...

Spam filtering in rails using Akismet

SPAM!!!! is a very big problem for all big applications. If you are having a site which allows users to comment on ur posts and so on then you might get affected by spamming.

Akismet is something which is helping us to avoid spamming on our sites.

There is a rails plugin available at http://github.com/jfrench/rakismet/tree/master

You can download this and configure akismet in your rails app. more information is provided in read me file of the plugin.

IF you want to see the actual implementation you can watch a screencast on

SQL functions in WHERE clauses are evil

Once we get up an running with the basic SQL syntax, doing inserts, updates, deletes and simple selects we start to learn about the SQL functions, the default ones like LOWER, COUNT, AVG and then the functions that are specific for the database you’re using. We learn them and start to feel that your fingers are itching to try them, to use them in the real world. Why would you learn them if you can’t use them anyway?

Ruby on Rails Handout

A while ago I gave away my Ruby on Rails handout for beginners. It was a PDF that contained the real basics for getting started or at least understanding the fundamentals of what Ruby on Rails is all about.

Rails for .NET Developers As A Wordle

The title of this post says it all. Click for a larger view:

Get the pdf or just paper.

Saying Goodbye to New York, Speaking at nyc.rb

As my extended silence here has probably indicated, New York has been keeping me busy. It's been a crazy, hectic, and wonderful couple of months. I learned a lot, met some great people, and ate way too much pizza. I've also achieved that particular New York state of mind where I'm no longer phased by anything. However, this is my last week in New York before I return home to my beautiful city of San Francisco. I'm going to miss a lot about New York, but not the winter weather. Seriously, 25 degrees is not a reasonable temperature, and whoever thought so should be fired.

Saying Goodbye to New York, Speaking at nyc.rb

As my extended silence here has probably indicated, New York has been keeping me busy. It's been a crazy, hectic, and wonderful couple of months. I learned a lot, met some great people, and ate way too much pizza. I've also achieved that particular New York state of mind where I'm no longer phased by anything. However, this is my last week in New York before I return home to my beautiful city of San Francisco. I'm going to miss a lot about New York, but not the winter weather. Seriously, 25 degrees is not a reasonable temperature, and whoever thought so should be fired.

Edge Mephisto supports Rails 2.2

The development version of Mephisto now runs under Rails 2.2.2.

Particular thanks go to Isaac Kearse, who fixed scores of test-case failures and bugs. Thanks also go to James McCarthy and George Murphy for their patches, and to Rick, for his invaluable advice and support. This was a round-the-clock effort: I’d wake up in the morning and find a whole stack of patches waiting to be merged.

Here’s what we still need to do before releasing Mephisto 0.8.1:

The Rails 3 Upgrade Handbook by Jeremy McAnally | Rails Fire

The Rails 3 Upgrade Handbook by Jeremy McAnally

Send to friend

r3ug.pngRails expert Jeremy McAnally (Ruby Inside's "Top Hitter" of 2008) has been interested in Rails 3 for a long time, and he's dropped a lot of time into producing the Rails 3 Upgrade Handbook, a $12 119 page PDF (no DRM!) e-book that runs through the ins and outs of bringing a Rails 2.x application up to Rails 3.0 standards.

Forgetting the 6 pages of cover and contents, Jeremy's Rails 3 Upgrade Handbook is 113 pages of awesome. The Rails 2 and Merb journey to Rails 3 is covered at a high level to start things off, but you're soon brought down to actually getting your Rails application upgraded to Rails 3.0. There are a few freely available blog posts out there that cover some of the topics this e-book looks at, but if you want a single "how to upgrade a Rails 2.x app to Rails 3.0" guide in one, and without any hassle, the Rails 3 Upgrade Handbook is a must buy.

Want to get a basic feel for how it looks? Jeremy has a PDF with some sample pages, but here are a couple of screengrabs too.. you should see it's a slick production:

rug1.png

rug2.png

$12 though? Is everyone just selling products nowadays? Well.. Jeremy first contacted me a week ago to get my impressions of the book and talk about pricing. He was first considering selling it at around $20 but I suggested he lower the price point - not because it's not worth $20 but because it's useful enough that everyone should feel good about buying it. Jeremy went lower than even my suggestion, though, so $12 it is.

If you're interested in Rails 3 and have experience with Rails 2, however, this thing is a good buy at $12 - it'll save you at least $20 of time's worth crawling through the documentation and 101 blog posts, though of course, you can still do that!

If you really want to get value for money out of Jeremy, though, you should also check out his Humble Little Ruby Book. It's free (readable online or as a PDF) and makes a great introduction to Ruby, ideal to pass on to your colleagues, kids, or whoever. If anyone's earned the karma to actually sell a product for once, it's this guy!

Post to Twitter Tweet This Post