Find file
Fetching contributors…
Cannot retrieve contributors at this time
19 lines (13 sloc) 509 Bytes


A lean mixin for ActionController::Base that assists in situations where a resource controller is nested under another resource. Eg:


In this example, retrieving the parent resource is as simple as:

class PasswordsController < ActionController::Base
  find_parent_resource :only => :new

  def new
    @parent_resource # => #<Member id: 24>
    @member # => #<Member id: 24>

See RisosuSan for a bit more in depth documentation.