Module: Motr::Cargo::Delivery::Helpers
- Extended by:
- ActiveSupport::Concern
- Included in:
- Motr::CargoContextsController
- Defined in:
- lib/motr/cargo/delivery/helpers.rb
Instance Method Summary collapse
- #cargo_context_path(pack, context, options = {}) ⇒ Object
- #cargo_context_url(pack, context, options = {}) ⇒ Object
- #cargo_contexts_path(pack, options = {}) ⇒ Object
- #cargo_contexts_url(pack, options = {}) ⇒ Object
- #edit_cargo_context_path(pack, context, options = {}) ⇒ Object
- #edit_cargo_context_url(pack, context, options = {}) ⇒ Object
- #scope_class ⇒ Object
- #scope_name ⇒ Object
Instance Method Details
#cargo_context_path(pack, context, options = {}) ⇒ Object
12 13 14 |
# File 'lib/motr/cargo/delivery/helpers.rb', line 12 def cargo_context_path(pack, context, = {}) motr_cargo_context_path(pack.class.name.to_s, pack.id, context.id, ) end |
#cargo_context_url(pack, context, options = {}) ⇒ Object
16 17 18 |
# File 'lib/motr/cargo/delivery/helpers.rb', line 16 def cargo_context_url(pack, context, = {}) motr_cargo_context_url(pack.class.name.to_s, pack.id, context.id, ) end |
#cargo_contexts_path(pack, options = {}) ⇒ Object
20 21 22 |
# File 'lib/motr/cargo/delivery/helpers.rb', line 20 def cargo_contexts_path(pack, = {}) motr_cargo_contexts_path(pack.scope_type, pack.id, ) end |
#cargo_contexts_url(pack, options = {}) ⇒ Object
24 25 26 |
# File 'lib/motr/cargo/delivery/helpers.rb', line 24 def cargo_contexts_url(pack, = {}) motr_cargo_contexts_url(pack.scope_type, pack.id, ) end |
#edit_cargo_context_path(pack, context, options = {}) ⇒ Object
28 29 30 |
# File 'lib/motr/cargo/delivery/helpers.rb', line 28 def edit_cargo_context_path(pack, context, = {}) edit_motr_cargo_context_path(pack.class.name.to_s, pack.id, context.id, ) end |
#edit_cargo_context_url(pack, context, options = {}) ⇒ Object
32 33 34 |
# File 'lib/motr/cargo/delivery/helpers.rb', line 32 def edit_cargo_context_url(pack, context, = {}) edit_motr_cargo_context_url(pack.class.name.to_s, pack.id, context.id, ) end |
#scope_class ⇒ Object
40 41 42 |
# File 'lib/motr/cargo/delivery/helpers.rb', line 40 def scope_class (params[:scope_name] || self.class.to_s.split("::").first.gsub(/controller/i, '').singularize).constantize end |
#scope_name ⇒ Object
36 37 38 |
# File 'lib/motr/cargo/delivery/helpers.rb', line 36 def scope_name (action_name.to_s === 'index' ? scope_class.to_s.pluralize : scope_class.to_s).underscore end |