Skip to content

Instantly share code, notes, and snippets.

@carllerche
Created April 8, 2010 23:02
Show Gist options
  • Save carllerche/360655 to your computer and use it in GitHub Desktop.
Save carllerche/360655 to your computer and use it in GitHub Desktop.
class HelloController < ApplicationController
respond_to :html
class MyResponder < ActionController::Responder
def to_html
# controller
# options
# resource
# resource_location
# default_render
# render :text => resource
end
end
def index
respond_with("Hello")
# respond_with("Hello") do |f|
# f.html { render :text => "Goodbye" }
# end
end
def self.responder
MyResponder
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment