1. Create controller

First of all you need to have a controller and include helper methods

class Pagelets::CurrentTime::CurrentTimeController < Pagelets::BaseController

  pagelet_resource only: [:show]

  def show


Note:pagelet_resource is a shortcut for routesresource :current_time

2. Use it as pagelet

Then you can use pagelet helper provided in your views:

<%= pagelet :pagelets_current_time %>

Note: pagelet name is the same as pagelets_current_time_path() route

3. Result

Loading ...