Rails || Merb
14 Jan 2008
After playing around with Merb and data mapper over the holidays, I thought a post on some of the differences that I’ve found between rails and Merb might be helpful to someone thinking about trying Merb out.
If you haven’t already installed Merb, check out Jon’s awesome screencast, that should get you started.
Here’s my list1:
| The Rails way | The Merb way |
|---|---|
| script/server | merb |
| script/console | merb -i |
| redirect_to blog_path(@blog) | redirect url(:blog, @blog) |
| respond_to | provides :xml, :js, :yaml |
| format | case content_type |
| render :xml => @post | render @post |
| render :file => 'public/404.html', :status => 404 | raise NotFound |
| format.html | only_provides :html, :xml |
| logger | Merb.logger |
| before_filter | before |
| render :partial | partial |
| f.text_field :name | text_control :first_name, :label => 'First Name' |
| RAILS_ENV | MERB_ENV post v0.5.0 Merb.environment |
-
This list is by no means a complete list and I can’t guaranty that they won’t change as Merb is in active development, but feel free comment with anything I have missed.
↩
