Module: Wallaby::ApplicationHelper
- Defined in:
- lib/helpers/wallaby/application_helper.rb
Instance Method Summary collapse
- #clean_params ⇒ Object
-
#url_for(options = nil) ⇒ Object
override ‘actionview/lib/action_view/routing_url_for.rb#url_for`.
- #wallaby_resourceful_url_for(options = {}) ⇒ Object
Instance Method Details
#clean_params ⇒ Object
2 3 4 |
# File 'lib/helpers/wallaby/application_helper.rb', line 2 def clean_params params.except :resources, :action end |
#url_for(options = nil) ⇒ Object
override ‘actionview/lib/action_view/routing_url_for.rb#url_for`
7 8 9 10 11 12 |
# File 'lib/helpers/wallaby/application_helper.rb', line 7 def url_for( = nil) if .is_a?(Hash) && .slice(:action, :resources).length == 2 return wallaby_resourceful_url_for end super end |
#wallaby_resourceful_url_for(options = {}) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/helpers/wallaby/application_helper.rb', line 14 def wallaby_resourceful_url_for( = {}) # 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. = .except :only_path case [:action] when 'index', 'create' wallaby_engine.resources_path when 'new' wallaby_engine.new_resource_path when 'edit' wallaby_engine.edit_resource_path when 'show', 'update', 'destroy' wallaby_engine.resource_path else wallaby_engine.url_for end end |