Method: Hanami::ApplicationConfiguration#controller_pattern
- Defined in:
- lib/hanami/application_configuration.rb
#controller_pattern(value) ⇒ Object #controller_pattern ⇒ String
Defines a relative pattern to find controllers.
By default this equals to "Controllers::%{controller}::%{action}" That means controllers must be structured like this: Bookshelf::Controllers::Dashboard::Index, where Bookshelf is the application module, Controllers is the first value specified in the pattern, Dashboard the controller and Index the action.
This pattern MUST always contain "%{controller}" and %{action}. This pattern SHOULD be used accordingly to #view_pattern value.
This is part of a DSL, for this reason when this method is called with an argument, it will set the corresponding instance variable. When called without, it will return the already set value, or the default.
1133 1134 1135 1136 1137 1138 1139 |
# File 'lib/hanami/application_configuration.rb', line 1133 def controller_pattern(value = nil) if value @controller_pattern = value else @controller_pattern ||= 'Controllers::%{controller}::%{action}' end end |