Configuration of value methods #356
-
I tried to find documentation of how to generally configure value methods for roda, and i am wondering about the syntax. i tried to adjust the links pushed to
(i know this is not necessary since the activated features will push their defined links into the array themselves, but this is just an example.) maybe i'm not versed enough in the language, is this something obvious based on how value methods are defined? i could only find the place where it's defined as an empty array on that module: https://github.com/jeremyevans/rodauth/blob/f46561d301d5baa40d208dea20d1cd22faefdf39/lib/rodauth/features/login.rb#L153 could you help me understand this? i know it's pretty much a roda related question, but i think the configuration syntax is specific to your gem? i'm generally trying to figure out if there is a common way to manipulate these value methods, or if it's specific to each individually. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
There are only two styles of configuration methods for Rodauth: "auth methods" and "auth value methods". The former requires you to pass a block (and sometimes has arguments), while the latter accepts both a block and a value (and doesn't have arguments).\ The Rodauth feature documentation makes a clear distinction whether a configuration method is an "auth method" or an "auth value method", by grouping them together under the corresponding heading. # auth value method
login_notice_flash "Successful login"
# OR
login_notice_flash { "Successful login" }
# auth method
before_login_route do
# ...
end |
Beta Was this translation helpful? Give feedback.
There are only two styles of configuration methods for Rodauth: "auth methods" and "auth value methods". The former requires you to pass a block (and sometimes has arguments), while the latter accepts both a block and a value (and doesn't have arguments).\
The Rodauth feature documentation makes a clear distinction whether a configuration method is an "auth method" or an "auth value method", by grouping them together under the corresponding heading.