Skip to content

Instantly share code, notes, and snippets.

@topfunky
Created November 4, 2008 21:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save topfunky/22215 to your computer and use it in GitHub Desktop.
Save topfunky/22215 to your computer and use it in GitHub Desktop.
# OUTPUT
# Called with: foo : html : flatapp_rc5
# Called with: flatapp_rc5 : html : flatapp_rc5
# Called with: application : html : flatapp_rc5
class FlatappRc5 < Merb::Controller
def _template_location(action, type = nil, controller = controller_name)
puts "Called with: " + [action, type, controller_name].join(" : ")
# This works better for taking advantage of views/application.html.erb
controller == "application" ? "application.#{type}" : "#{action}.#{type}"
end
def index
"Hello, I am flat Merb application. I only have one single file for the application, single file for configs and routes, and a directory for views."
end
def foo
render
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment