-
Notifications
You must be signed in to change notification settings - Fork 1
Dynamic Link Generator
Sean C Davis edited this page Sep 5, 2016
·
1 revision
NotifyOn's comes with a dynamic link generator to help make your configuration a little simpler, since we can't call the the URL helper directly from the notify_on
options.
You can specify the relevant URL using a _path
or _url
helper, just as you would in your controllers and views. There are really only three differences.
First, the argument must be a string (does not apply to Bulk Configuration). So, instead of this:
:link => messages_path
You need to do this:
:link => 'messages_path'
Second, arguments in the path must be called using symbols. This way you can use a string as an argument. So, not this:
:link => 'author_path(author)'
But this:
:link => 'author_path(:author)'
And last, a reference to the trigger itself is written as :self
. For example:
:link => 'author_message_path(:author, :self)'