Module: Voom::Presenters::Helpers::Rails
- Includes:
- ActionView::Helpers::AssetUrlHelper, Currency, ModelTable, Namespace
- Included in:
- Voom::Presenters::Helpers
- Defined in:
- lib/voom/presenters/helpers/rails.rb,
lib/voom/presenters/helpers/rails/currency.rb,
lib/voom/presenters/helpers/rails/model_table.rb
Defined Under Namespace
Modules: Currency, ModelTable
Instance Method Summary
collapse
Methods included from Namespace
#_expand_namespace_
Methods included from ModelTable
#table_for
Methods included from Currency
#cents_to_currency
Instance Method Details
#default_url_options ⇒ Object
11
12
13
|
# File 'lib/voom/presenters/helpers/rails.rb', line 11
def default_url_options
{}
end
|
#presenters_path(presenter, host: false, **params) ⇒ Object
Also known as:
presenter_path
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/voom/presenters/helpers/rails.rb', line 15
def presenters_path(presenter, host: false, **params)
presenter = _expand_namespace_(presenter, namespace)
presenter = presenter.gsub(':', '/')
path = host ? voom_presenters_web_client_app_url(params, host: router.base_url) :
voom_presenters_web_client_app_path(params)
if path.include?('?')
path = path.sub('?', "#{presenter}?")
else
path = "#{path}/" unless path.end_with?('/')
path = path.reverse.sub('/', "/#{presenter}".reverse).reverse
end
path
end
|
#presenters_url(presenter, host: true, **params) ⇒ Object
Also known as:
presenter_url
34
35
36
|
# File 'lib/voom/presenters/helpers/rails.rb', line 34
def presenters_url(presenter, host: true, **params)
presenters_path(presenter, host: host, **params)
end
|