Module ResourceController::Helpers::CurrentObjects
In: lib/resource_controller/helpers/current_objects.rb

Methods

Protected Instance methods

Builds the object, but doesn‘t save it, during the new, and create action.

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 internally to return the model for your resource.

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

Returns the form params. Defaults to params[model_name] (i.e. params["post"])

Returns the current param.

Defaults to params[:id].

Override this method if you‘d like to use an alternate param name.

[Validate]