private Method

InstanceMethods.run_before_filters(chain, index, nesting)

There's no documentation for this item.

Source Code

# File action_controller/filters.rb, line 711
def run_before_filters(chain, index, nesting)
  while chain[index]
    filter, index = skip_excluded_filters(chain, index)
    break unless filter # end of call chain reached

    case filter.type
    when :before
      filter.run(self)  # invoke before filter
      index = index.next
      break if @before_filter_chain_aborted
    when :around
      yielded = false

      filter.call(self) do
        yielded = true
        # all remaining before and around filters will be run in this call
        index = call_filters(chain, index.next, nesting.next)
      end

      halt_filter_chain(filter, :did_not_yield) unless yielded

      break
    else
      break  # no before or around filters left
    end
  end

  index
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.