Archive for the ‘Rails’ Category
If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!
What do you get when the power of Ruby on Rails is combined with flexibility of Merb web framework? Rails 3 of course!
We have a very happy news: Rails 3 Beta is ready for testing. The improvements are numerous: ActiveRecord, ActionController, ActionView, and ActionMailer, ActiveSupport have all been redesigned. ActiveRecord got pimped with ActiveRelation scoped queries.
Some components have been refactored into their own: ActionDispatch, ActiveModel. Even better, all components can be used alone and you don’t have to require the entire Rails framework.
Author: ceefour | Filed under: Rails
A Ruby on Rails web application I’ve been developing uses Dojo-based full AJAX frontend. I learned some new tricks during development, relearned old pitfalls, and found some mistakes that I’d like to share with you.
Our team decided to implement the webapp in a non-conventional approach, using Dojo Toolkit-based full AJAX frontend, without using any ActionView functionality. It turned that it went quite well, but there are some things that we weren’t aware of and now we know how to deal with it, and you will too. 
Communication between backend and frontend is done using JSON REST API. Since there is pratically no view code in the server-side app, theoretically it would be more appropriate to use Sinatra instead of Rails. But we opted for Rails because of familiarity with all its eccentricasies and exoticism. It’s not so much about learning the Sinatra framework, but more on what if we need to hack things out? (which we have personally proven to be time consuming)
Author: ceefour | Filed under: Rails
Tags: Ajax, API, Cloud standards, controller, Dojo, JavaScript programming language, JSON, Representational State Transfer, resource model REST conventions, Ruby on Rails, Software architecture, web application, Web application frameworks, web framework
Sometimes when developing a Ruby on Rails web application, you want to use an ActionView helper method inside your controller. The following tip is from Gabriel Gironda .
This is incredibly straightforward and more of an occasional convenience, but I thought I’d throw it out there anyway.
One use case is to use pluralize() in a flash message and not have to do it by hand using the inflector. You could include ActionView::Helpers::TextHelper in the controller, but that fills your namespace with crap.
Put this in the class ApplicationController instead:
Author: ceefour | Filed under: Rails
While using Ruby for your projects, you may need some references.
These are some references that might help you in using Ruby:
General Syntax Rules
- Comments start with a pound/sharp (#) character and go to EOL.
- Ruby programs are sequence of expressions.
- Each expression is delimited by semicolons(;) or newlines unless obviously incomplete (e.g. trailing ‘+’).
- Backslashes at the end of line does not terminate expression.
Reserved words
alias and BEGIN begin break case class def defined
do else elsif END end ensure false for if
in module next nil not or redo rescue retry
return self super then true undef unless until when
while yield
Type
Author: ceefour | Filed under: HTML, Rails, Reviews, Ruby, Tools
Ruby is a high level, object-oriented open source scripting language. It has excellent support for regular expressions as a language feature.
In Ruby, a regular expression is written in the form of /pattern/modifiers where “pattern” is the regular expression itself, and “modifiers” are a series of characters indicating various options. The “modifiers” part is optional. This syntax is borrowed from Perl.
Ruby supports the following modifiers:
- /i makes the regex match case insensitive.
- /m makes the dot match newlines. Ruby indeed uses /m, whereas Perl and many other programming languages use /s for “dot matches newlines”.
Author: ceefour | Filed under: Ajax, Rails, Ruby, Tools

Advanced Rails offers you an in-depth look at techniques for dealing with databases, security, performance, web services and much more.
O’Reilly Media, Inc. published an intermediate-to-expert Rails book, authored by Brad Ediger:
Chapters in this book help you understand not only the tricks and techniques used within the Rails framework itself, but also how to make use of ideas borrowed from other programming paradigms. Advanced Rails pays particular attention to building applications that scale — whether “scale” means handling more users, or working with a bigger and more complex database.
You’ll find plenty of examples and code samples that explain:
Author: ceefour | Filed under: Books, News, Plugins, Rails, Reviews, Ruby, Web 2.0
Tags: book, Books, Rails, Ruby

Morph Labs is currently beta-testing their next-generation solution in application deployment, delivery, and management, the Morph Application Platform.
Acquiring hardware and configuring software to support web apps are things of the past. Morph Labs brings you the next-generation solution in application deployment, delivery, and management. Reduce your time to market and lower your startup costs no matter if you are an ISV, a developer or a business.
About Morph Labs
Morph Labs Inc. www.morphexchange.com is a Philippine-based Web 2.0 technology company focused on providing innovative technologies and applications to support Software as a Service (SaaS) globally.
Author: ceefour | Filed under: Cool, HTML, News, Rails, Ruby, Tools, Web 2.0
Tags: 284, 289, 296, 299, 300, 302
I’d like to express a warm notice that AdaRuby.com might be down intermittently as we’ll be having major rearrangement and server upgrades of our hosting facilities in the coming days.

The upside is, when it’s done (and oh YES it will be done!), I’ll be providing you interesting information on the stuff that we’re doing, especially our experience regarding the hosting services that we have been using all this time.
Looking forward to hearing you share your experience as well!
Author: ceefour | Filed under: News, Opinions, Rails, Rails Hosting, Tips
Tags: 305, 317, 321, 324, 328, 335, 355, 356
Canadian Web Hosting provides shared, VPS, and dedicated web hosting for Canadian sites. They operate from a 1st Class Colocation facility located at Harbour Center in downtown Vancouver, BC, Canada. The advantage to international (i.e. non-Canadian) hosting services are obvious: they are much faster to access from Canada (with an added bonus that you pay in your native Canadian Dollars currency!
Hence, if your customers and/or your business is based on Canada, hosting your Rails site with them might be a perfect fit.
Author: ceefour | Filed under: News, Rails, Rails Hosting, Ruby, Web 2.0
Tags: 296, 313, 314, 317, 328, 351, 355, 357, 365, 367
A common stumbling block for beginner Rails developers is learning the basics required to write plugins. This is made more complicated by the fact that Ruby is inherently dynamic and offers many techniques for code reuse.
Luckily, if you can write Rails applications you can write plugins by simply drawing on a handful of basic patterns.
Why write plugins?
Writing a plugin will:
- Help make sharing code more efficient, whether it’s between projects or within the same project
- Allow you to publish generic code to the community
- Save time and increase your confidence by testing once and reusing many times
Author: ceefour | Filed under: Beginner, Plugins, Rails, Tips, Tools, Tutorials
Tags: 294, 296, 344