Created
March 30, 2010 14:47
-
-
Save ku1ik/349158 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Merb controller | |
class Users < Application | |
def foo | |
"Foo'ed!" # result: string rendered | |
end | |
def bar | |
render "Rabarbar!" # result: "Rabarbar!" text inside layout rendered | |
end | |
def baz # result: nil (nothing rendered - empty response body) | |
end | |
end | |
# Rails controller | |
class UsersController < ApplicationController | |
def foo | |
render :text => "Foo'ed!" # result: given text rendered | |
end | |
def bar | |
render "rabarbar" # result: "rabarbar" template rendered | |
end | |
def baz # result: "baz" template rendered | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment