1
0
Fork 0
dokkan-data-rails/app/controllers/admin/versions_controller.rb

17 lines
365 B
Ruby
Raw Normal View History

class Admin::VersionsController < Admin::BaseController
before_action :set_version, only: [:show]
def show
type = @version.class.to_s.underscore
instance_variable_set('@' + type, @version)
render "admin/#{type.pluralize}/show"
end
private
def set_version
@version = PaperTrail::Version.find(params[:id]).reify(has_one: true)
end
end