Class: RailsAdmin::HistoryController
Instance Method Summary
collapse
#get_model, #get_object, #to_model_name
Instance Method Details
#for_model ⇒ Object
6
7
8
9
10
11
12
13
14
|
# File 'app/controllers/rails_admin/history_controller.rb', line 6
def for_model
@authorization_adapter.authorize(:history) if @authorization_adapter
@page_type = @abstract_model.pretty_name.downcase
@page_name = t("admin.history.page_name", :name => @model_config.label.downcase)
@general = true
@history = History.history_for_model(@abstract_model, params[:query], params[:sort], params[:sort_reverse], params[:all], params[:page])
render "show", :layout => request.xhr? ? false : 'rails_admin/application'
end
|
#for_object ⇒ Object
16
17
18
19
20
21
22
23
24
|
# File 'app/controllers/rails_admin/history_controller.rb', line 16
def for_object
@authorization_adapter.authorize(:history) if @authorization_adapter
@page_type = @abstract_model.pretty_name.downcase
@page_name = t("admin.history.page_name", :name => "#{@model_config.label.downcase} '#{@model_config.with(:object => @object).object_label}'")
@general = false
@history = History.history_for_object(@abstract_model, @object, params[:query], params[:sort], params[:sort_reverse], params[:all], params[:page])
render "show", :layout => request.xhr? ? false : 'rails_admin/application'
end
|