Class: Wallaby::UrlFor
- Inherits:
-
Object
- Object
- Wallaby::UrlFor
- Defined in:
- lib/services/wallaby/url_for.rb
Overview
Url helper
Class Method Summary collapse
-
.handle(wallaby_engine, options) ⇒ String
Handle wallaby engine url properly.
Class Method Details
.handle(wallaby_engine, options) ⇒ String
Handle wallaby engine url properly.
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/services/wallaby/url_for.rb', line 9 def handle(wallaby_engine, ) # NOTE: DEPRECATION WARNING: You are calling a `*_path` helper with the # `only_path` option explicitly set to `false`. # This option will stop working on path helpers in Rails 5. # Use the corresponding `*_url` helper instead. hash = normalize_params().except(:only_path) case hash[:action] when 'index', 'create' then wallaby_engine.resources_path hash when 'new' then wallaby_engine.new_resource_path hash when 'edit' then wallaby_engine.edit_resource_path hash else wallaby_engine.resource_path hash end end |