Skip to content

Commit

Permalink
Controllers now dispatch methods instead of having the methods called…
Browse files Browse the repository at this point in the history
… directly from the application.
  • Loading branch information
mtodd committed Jun 24, 2008
1 parent 8b1a6c0 commit 395f97f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/halcyon/application.rb
Expand Up @@ -149,7 +149,7 @@ def dispatch(env)
# if no errors have occured up to this point, the route should be fully
# valid and all exceptions raised should be treated as
# <tt>500 Internal Server Error</tt>s, which is handled by <tt>call</tt>.
controller.send(action)
controller._dispatch(action)
end

# Filters unacceptable requests depending on the configuration of the
Expand Down
7 changes: 7 additions & 0 deletions lib/halcyon/controller.rb
Expand Up @@ -17,6 +17,13 @@ def initialize(env)
@request = Rack::Request.new(@env)
end

def _dispatch(action)
apply_filters(:before, action)
response = send(action)
apply_filters(:after, action)
response
end

class << self

# Not implemented.
Expand Down

0 comments on commit 395f97f

Please sign in to comment.