Module: Granite::Projector::Helpers
- Extended by:
- ActiveSupport::Concern
- Included in:
- Granite::Projector
- Defined in:
- lib/granite/projector/helpers.rb
Instance Method Summary collapse
- #action_path(action, **options) ⇒ Object
- #action_url(action, **options) ⇒ Object
- #view_context ⇒ Object (also: #h)
Instance Method Details
#action_path(action, **options) ⇒ Object
30 31 32 |
# File 'lib/granite/projector/helpers.rb', line 30 def action_path(action, **) action_url(action, **, only_path: true) end |
#action_url(action, **options) ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/granite/projector/helpers.rb', line 20 def action_url(action, **) action_path = controller_actions[action.to_sym].fetch(:as, action) params = required_params.merge(projector_action: action_path) Rails.application.routes.url_for( .reverse_merge().merge!(params), corresponding_route.name ) end |
#view_context ⇒ Object Also known as: h
15 16 17 |
# File 'lib/granite/projector/helpers.rb', line 15 def view_context Granite.view_context end |