Skip to content

Instantly share code, notes, and snippets.

@MSNexploder
Created August 21, 2013 23:42
Show Gist options
  • Save MSNexploder/6301589 to your computer and use it in GitHub Desktop.
Save MSNexploder/6301589 to your computer and use it in GitHub Desktop.
Just some quick thoughts...
class FoosController < ApplicationController
before_filter :foobar
class Bar
before_filter :find_bar
def new
...
end
def create
...
end
private
def find_bar
...
end
end
def show
...
end
private
def foobar
...
end
end
@MSNexploder
Copy link
Author

Pro

  • Support for both - "simple" methods and nested classes
  • Should be easy to route
  • Auto reloading this should be easy
  • ...

Cons

  • Magic!!
  • Tons of nested classes - really?!
  • ...

Questions

  • Would this be a good solution after all?
  • How much magic should be involved? (e.g. calling outer methods "just works", filter chains)
  • ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment