diff options
Diffstat (limited to 'app/helpers/backends_helper.rb')
-rw-r--r-- | app/helpers/backends_helper.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/app/helpers/backends_helper.rb b/app/helpers/backends_helper.rb new file mode 100644 index 0000000..6888611 --- /dev/null +++ b/app/helpers/backends_helper.rb @@ -0,0 +1,20 @@ +module BackendsHelper + def new_backend_path(backend_class) + route_helper("new_#{backend_class.name.demodulize.underscore}_backend_path") + end + + def show_backend_path(backend) + route_helper( + "#{backend.class.name.demodulize.underscore}_backend_path", + backend.id + ) + end + + def route_helper(name, *args) + Rails + .application + .routes + .url_helpers + .send(name, *args) + end +end |