Module: RedisDictionary::ApplicationHelper
- Defined in:
- app/helpers/redis_dictionary/application_helper.rb
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
Can search for named routes directly in the main app, omitting the “main_app.” prefix
22
23
24
25
26
27
28
|
# File 'app/helpers/redis_dictionary/application_helper.rb', line 22
def method_missing method, *args, &block
if main_app_url_helper?(method)
main_app.send(method, *args)
else
super
end
end
|
Instance Method Details
#humanize_key(key) ⇒ Object
16
17
18
|
# File 'app/helpers/redis_dictionary/application_helper.rb', line 16
def humanize_key(key)
key.split('.').last.gsub('_', ' ').gsub(/\b('?[a-z])/) { $1.capitalize }
end
|
#show_title? ⇒ Boolean
12
13
14
|
# File 'app/helpers/redis_dictionary/application_helper.rb', line 12
def show_title?
@show_title
end
|
#title(page_title, show_title = true) ⇒ Object
5
6
7
8
9
10
|
# File 'app/helpers/redis_dictionary/application_helper.rb', line 5
def title(page_title, show_title = true)
@show_title = show_title
if @show_title
content_for(:title) { h(page_title.to_s) }
end
end
|