Rubanok

Services & Skills

Share on

The typical usage is to describe all the possible collection manipulation for REST index action, e.g. filtering, sorting, searching, pagination, etc..

So, instead of:

class CourseSessionController < ApplicationController
  def index
    @sessions = CourseSession
      .search(params[:q])
      .by_course_type(params[:course_type_id])
      .by_role(params[:role_id])
      .paginate(page_params)
      .order(ordering_params)
  end
end

You have:

class CourseSessionController < ApplicationController
  def index
    @sessions = rubanok_process(
      # pass input
      CourseSession.all,
      # pass params
      params,
      # provide a processor to use
      with: CourseSessionsProcessor
    )
  end
end

Or we can try to infer all the configuration for you:

class CourseSessionController < ApplicationController
  def index
    @sessions = rubanok_process(CourseSession.all)
  end
end
Author

Further reading

In the same orbit

Explore more open source projects

Let's solve your hard problems

Martians at a glance
18
years in business

We're experts at helping developer products grow, with a proven track record in UI design, product iterations, cost-effective scaling, and much more. We'll lay out a strategy before our engineers and designers leap into action.

If you prefer email, write to us at surrender@evilmartians.com