         @_afterFilterRedirect = url
     else
       if Batman.typeOf(url) is 'Object'
-        url.controller = @ if not url.controller
+        url.controller = this if not url.controller
 
       Batman.redirect url
 

        Batman.developer.error("Please define `routingKey` on the prototype of #{Batman.functionName(@constructor)} in order for your controller to be minification safe.") if Batman.config.minificationErrors
        Batman.functionName(@constructor).replace(/Controller$/, '')

  _optionsFromFilterArguments = (options, nameOrFunction) ->
    if not nameOrFunction
      nameOrFunction = options
      options = {}
    else
      if typeof options is 'string'
        options = {only: [options]}
      else
        options.only = [options.only] if options.only and Batman.typeOf(options.only) isnt 'Array'
        options.except = [options.except] if options.except and Batman.typeOf(options.except) isnt 'Array'
    options.block = nameOrFunction
    options

  @beforeFilter: ->
    Batman.initializeObject this
    options = _optionsFromFilterArguments(arguments...)
    filters = @_batman.beforeFilters ||= []
    filters.push(options)

  @afterFilter: ->
    Batman.initializeObject this
    options = _optionsFromFilterArguments(arguments...)
    filters = @_batman.afterFilters ||= []
    filters.push(options)

  @afterFilter (params) ->
    if @autoScrollToHash && params['#']?

  _viewClassForAction: (action) ->
    classPrefix = @get('routingKey').replace('/', '_')
    Batman.currentApp?[Batman.helpers.camelize("#{classPrefix}_#{action}_view")] || Batman.View
