Module: Localeapp::Routes::Translations
- Included in:
- Localeapp::Routes
- Defined in:
- lib/localeapp/routes/translations.rb
Instance Method Summary collapse
- #create_translation_endpoint(options = {}) ⇒ Object
- #translations_endpoint(options = {}) ⇒ Object
- #translations_url(options = {}) ⇒ Object
Instance Method Details
#create_translation_endpoint(options = {}) ⇒ Object
15 16 17 |
# File 'lib/localeapp/routes/translations.rb', line 15 def create_translation_endpoint( = {}) [:post, translations_url()] end |
#translations_endpoint(options = {}) ⇒ Object
11 12 13 |
# File 'lib/localeapp/routes/translations.rb', line 11 def translations_endpoint( = {}) [:get, translations_url()] end |
#translations_url(options = {}) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/localeapp/routes/translations.rb', line 4 def translations_url(={}) [:format] ||= 'yml' url = http_scheme.build(.merge(:path => translations_path([:format]))) url.query = [:query].map { |k,v| "#{k}=#{v}" }.join('&') if [:query] url.to_s end |