Skip to content

Instantly share code, notes, and snippets.

@leucos
Created September 28, 2012 08:56
Show Gist options
  • Select an option

  • Save leucos/3798737 to your computer and use it in GitHub Desktop.

Select an option

Save leucos/3798737 to your computer and use it in GitHub Desktop.
Inject methods and routes in controller from helper
class SomeStuff < Ramaze::Controller
helper :versionner
def index
"Hello world"
end
end
module Ramaze
module Helper
module Versionner
def self.included(c)
Ramaze::Log.info "mixed into #{c}"
c.class_eval {
define_method(:version) {
Ramaze::Log.info "In version"
"3.1415"
}
}
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment