Fix error, submission, hints and help views

This commit is contained in:
Sebastian Serth
2018-09-30 13:16:07 +02:00
parent 15b1670511
commit 9666683bd7
18 changed files with 88 additions and 79 deletions

View File

@@ -1,4 +1,6 @@
- if policy(model).new?
a.btn.btn-success href=local_assigns.fetch(:path, send(:"new_#{model.model_name.singular}_path"))
// 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)