Files
codeocean/app/views/shared/_new_button.html.slim
2018-11-06 16:46:01 +01:00

7 lines
320 B
Plaintext

- if policy(model).new?
// default value for fetch will always be evaluated even if it is not returned
- href_target = local_assigns.fetch(:path, false) || send(:"new_#{model.model_name.singular}_path")
a.btn.btn-success href=href_target
i.fa.fa-plus
= t('shared.new_model', model: model.model_name.human)