Files
danbooru/app/controllers/mod_actions_controller.rb
evazion 2564e885c8 controllers: refactor only param includes.
Add extra includes needed by the `only` param inside `respond_with`.
2020-02-15 06:17:22 -06:00

18 lines
458 B
Ruby

class ModActionsController < ApplicationController
respond_to :html, :xml, :json
def index
@mod_actions = ModAction.paginated_search(params)
@mod_actions = @mod_actions.includes(:creator) if request.format.html?
respond_with(@mod_actions)
end
def show
@mod_action = ModAction.find(params[:id])
respond_with(@mod_action) do |fmt|
fmt.html { redirect_to mod_actions_path(search: { id: @mod_action.id }) }
end
end
end