Module: Locomotive::SnippetsHelper

Defined in:
app/helpers/locomotive/snippets_helper.rb

Instance Method Summary collapse

Instance Method Details

#snippet_main_template_path(snippet) ⇒ String

Give the path to the template of the snippet for the main locale ONLY IF the user does not already edit the snippet in the main locale.

Parameters:

  • snippet (Object)

    The snippet

Returns:

  • (String)

    The path or nil if the main locale is enabled



11
12
13
14
15
16
17
# File 'app/helpers/locomotive/snippets_helper.rb', line 11

def snippet_main_template_path(snippet)
	if not_the_default_current_locale?
		snippet_path(snippet, content_locale: current_site.default_locale, format: :json)
	else
		nil
	end
end