mirror of
https://github.com/astuto/astuto.git
synced 2025-12-15 11:17:49 +01:00
16 lines
442 B
Ruby
16 lines
442 B
Ruby
module Admin
|
|
class PostsController < Admin::ApplicationController
|
|
before_action :default_order
|
|
|
|
def default_order
|
|
@order ||= Administrate::Order.new(
|
|
params.fetch(resource_name, {}).fetch(:order, 'updated_at'),
|
|
params.fetch(resource_name, {}).fetch(:direction, 'desc'),
|
|
)
|
|
end
|
|
|
|
# See https://administrate-prototype.herokuapp.com/customizing_controller_actions
|
|
# for more information
|
|
end
|
|
end
|