sending a default tag will call the method on the page. Ignoring the default text in the tags.

{% editable_short_text coolertitle, default: title %}{% endeditable_short_text %}
This commit is contained in:
Dirk Kelly 2011-03-02 11:28:54 +08:00
parent 74277b48ed
commit 95cd56cba2

View File

@ -26,7 +26,7 @@ module Locomotive
:block => @context[:current_block].try(:name),
:slug => @slug,
:hint => @options[:hint],
:default_content => @nodelist.first.to_s,
:default_content => default_content,
:assignable => @options[:assignable],
:disabled => false,
:from_parent => false
@ -57,6 +57,15 @@ module Locomotive
raise 'FIXME: has to be overidden'
end
def default_content
if @options[:default].present?
@context[:page].send(@options[:default])
else
@nodelist.first.to_s
end
end
end
end