lib/templates/rails/scaffold_controller/controller.rb in stationed-0.4.0 vs lib/templates/rails/scaffold_controller/controller.rb in stationed-0.5.0
- old
+ new
@@ -6,10 +6,10 @@
class <%= controller_class_name %>Controller < ApplicationController
respond_to :html, :json
before_action :set_<%= singular_table_name %>, only: %i[show edit update destroy]
def index
- @<%= plural_table_name %> = policy_scope(<%= orm_class.all(class_name) %>).decorate
+ @<%= plural_table_name %> = policy_scope(<%= orm_class.all(class_name) %>).page(params[:page]).decorate
respond_with @<%= plural_table_name %>
end
def show
authorize @<%= singular_table_name %>