eBooru/app/controllers/note_versions_controller.rb

21 lines
592 B
Ruby
Raw Permalink Normal View History

# frozen_string_literal: true
class NoteVersionsController < ApplicationController
2019-11-26 17:03:43 -05:00
respond_to :html, :json
2013-03-19 08:10:10 -04:00
def index
@note_versions = NoteVersion.search(search_params).paginate(params[:page], limit: params[:limit])
2013-03-29 15:37:28 -04:00
respond_with(@note_versions) do |format|
format.html { @note_versions = @note_versions.includes(:updater) }
2013-03-29 15:37:28 -04:00
end
end
private
def search_params
permitted_params = %i[updater_id updater_name post_id note_id is_active body_matches]
permitted_params += %i[ip_addr] if CurrentUser.is_admin?
permit_search_params permitted_params
end
end