Create rails_admin_path_for_resource helper
This commit is contained in:
parent
4b52f900f2
commit
3570171b25
|
@ -169,4 +169,8 @@ module ApplicationHelper
|
|||
def list_title(list)
|
||||
generate_title list.name
|
||||
end
|
||||
|
||||
def rails_admin_path_for_resource(resource)
|
||||
[rails_admin_path, resource.model_name.param_key, resource.id].join('/')
|
||||
end
|
||||
end
|
||||
|
|
|
@ -39,6 +39,6 @@
|
|||
%i.fa.fa-exclamation-triangle
|
||||
= t 'views.actions.report'
|
||||
- if current_user.has_role? :administrator
|
||||
%a.dropdown-item{ href: "#{rails_admin_path}/answer/#{a.id}", target: '_blank' }
|
||||
%a.dropdown-item{ href: rails_admin_path_for_resource(a), target: '_blank' }
|
||||
%i.fa.fa-gears
|
||||
View in Kontrollzentrum
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
%i.fa.fa-exclamation-triangle
|
||||
= t 'views.actions.report'
|
||||
- if current_user.has_role? :administrator
|
||||
%a.dropdown-item{ href: "#{rails_admin_path}/question/#{a.question.id}", target: '_blank' }
|
||||
%a.dropdown-item{ href: rails_admin_path_for_resource(a.question), target: '_blank' }
|
||||
%i.fa.fa-gears
|
||||
View in Kontrollzentrum
|
||||
%h6.text-muted.media-heading.answerbox__question-user
|
||||
|
|
|
@ -29,6 +29,6 @@
|
|||
%i.fa.fa-ban
|
||||
= t 'views.actions.ban'
|
||||
- if current_user.has_role? :administrator
|
||||
%a.dropdown-item{ href: "#{rails_admin_path}/user/#{user.id}", target: '_blank' }
|
||||
%a.dropdown-item{ href: rails_admin_path_for_resource(user), target: '_blank' }
|
||||
%i.fa.fa-cogs
|
||||
"View in Kontrollzentrum"
|
||||
|
|
Loading…
Reference in New Issue