Author Archives: Ashiq Alibhai

About Ashiq Alibhai

Ashiq Alibhai, PMP, has been a Rails aficionado since 2007, and developed web applications since early 2003, where he learned PHP in one summer. As the driving-force behind RailsRocket and the Launchpad project, he seeks to share the ease of development with Rails far and wide.

PlainRL 1.0 Released

PlainRL 1.0 is out! Download it now and give it a try–a full, working, albeit plain RogueLike game written entirely in Ruby. Continue reading

Posted in Development, Projects | Tagged , | 3 Comments

Internationalizing Your Rails Application in 34 Languages eBook

We’re very pleased to announce our very on Rails eBook: Internationalizing Your Rails Application in 34 Languages! The goal of this eBook is to help you get your Rails application internationalized–and to kick it off with not one or two, but 34 different languages–all without the expense of hiring a translator! Continue reading

Posted in Deployment | Tagged , , | 8 Comments

rake secret?

Bort and Restful Authentication, require you to edit the REST_AUTH_SITE_KEY. What does this mean? Rake has a ‘secret’ target which you can call; it generates a key. What about the ‘secret’ value in environment.rb? Added in Rails 2.0, as part of moving session state to the client side, this key encrypts session data. Continue reading

Posted in Development | Tagged , , , , | 2 Comments

One-Shot Scaffolding Creation

If you’re not that familiar with Rails, you might be creating your application domain entities (models, controllers, business objects, whatever you want to call them) by generating the model, then generating the controller, then populating the fields into the migration, and the new/edit views. There’s a one-line way to do all of this, though. Continue reading

Posted in Development | Tagged , , | Comments Off

Private Member Variables in Ruby

How can you create private member variables in Ruby? If you’re used to the attr_accessor helper, that won’t work–that makes your member variables public. You can use the @ notation, eg. @variable_name. (Attr_accessor just gives you free getters and setters.) Continue reading

Posted in Development | Tagged , , , | 1 Comment

Internationalization (I18n) in Rails 2.2

Rails 2.2 introduces I18n, aka Internationalization, out-of-the-box. Now, it’s very, very easy to write an application that can be translated quickly into another language; all through the new I18n API. You can easily add strings, change strings, even change the language on the fly. We discuss a bit of the evolution of how such a solution came about, which is a common implementation in many programming languages today. Continue reading

Posted in Development | Tagged , , | 5 Comments

Rails 2.1: UTC-Timestamped Migrations

Rails 2.1 introduces UTC-timestamped migrations–instead of a single, three-digit prefix to your number, you now get a timestamp (everything from the current year to the current second). This helps you resolve conflicts of the same-numbered migration showing up in multi-developer environments; but it’s annoying sometimes! How can you turn this off? Through environment.rb! Continue reading

Posted in Development, Projects | Tagged , , | Comments Off

Looping Backwards in Ruby

In Ruby, looping or iterating forwards is a simple task–you can use the bracket notation. But what if you want to loop backwards? Can you do it? Easily? Or what if you don’t know if you’re iterating forwards or backwards? Is there a generic solution you can use for this specific, albeit rare, case? Continue reading

Posted in Development, Projects | 7 Comments

The Controversial Eval Function

eval is a function in Ruby that allows you to execute arbitrary code. You pass in a string containing code, and voila! It’s very useful, for things like holding pointers of a sort to functions; but it’s also dangerous, because script-kiddies can format your hard-drive. So what’s the middle-path use-case of eval? Continue reading

Posted in Development | Tagged , , | 2 Comments

Block Comments in Ruby

How do you comment out a chunk of code? Other programming languages (C++, Java, etc.) have a slash-star style of block comments, like so: /* */ … but what about Ruby? Does Ruby have a mechanism for this, too? The answer is YES; BUT, there’s a catch! If you don’t watch whitespace … Continue reading

Posted in Development | Tagged , , | 2 Comments