| Module | ResourceController::Helpers::CurrentObjects |
| In: |
lib/resource_controller/helpers/current_objects.rb
|
Used to fetch the collection for the index method
In order to customize the way the collection is fetched, to add something like pagination, for example, override this method.
Used internally to load the collection in to an instance variable @#{model_name.pluralize} (i.e. @posts)
Used internally to load the member object in to an instance variable @#{model_name} (i.e. @post)
Used to fetch the current member object in all of the singular methods that operate on an existing member.
Override this method if you‘d like to fetch your objects in some alternate way, like using a permalink.
class PostsController < ResourceController::Base
private
def object
@object ||= end_of_association_chain.find_by_permalink(param)
end
end