Class: Brut::FrontEnd::Routing::FormHandlerRoute
- Defined in:
- lib/brut/front_end/routing.rb
Instance Attribute Summary
Attributes inherited from Route
#handler_class, #http_method, #path_template
Instance Method Summary collapse
-
#initialize(path_template) ⇒ FormHandlerRoute
constructor
A new instance of FormHandlerRoute.
Methods inherited from Route
#==, #path, #path_params, #url
Constructor Details
#initialize(path_template) ⇒ FormHandlerRoute
Returns a new instance of FormHandlerRoute.
375 376 377 378 379 380 381 |
# File 'lib/brut/front_end/routing.rb', line 375 def initialize(path_template) super(Brut::FrontEnd::HttpMethod.new(:post),path_template) unnecessary_class = self.locate_handler_class("Form","With", on_missing: nil) if !unnecessary_class.nil? raise ArgumentError,"#{path_template} should only have #{handler_class} defined, however #{unnecessary_class} was found. If #{path_template} should be a form submission, use `form \"#{path_template}\"` instead of `action \"#{path_template}\"`. Otherwise, delete #{unnecessary_class}" end end |