lib/edit_mode/helper.rb in edit_mode-0.0.2 vs lib/edit_mode/helper.rb in edit_mode-0.0.3
- old
+ new
@@ -1,7 +1,29 @@
module EditMode
module EditModeHelpers
+ # Returns a span tag which contains a group of editable elements
+ # which should only be shown in edit mode.
+ #
+ # edit_mode_group_span do
+ # # tool buttons: edit, save, cancel
+ # # ...
+ # end
+ #
+ # will basically return
+ #
+ # <span class="edit_mode_group">
+ # ...
+ # </span>
+ #
+ # The rest is done via javascript.
+ def edit_mode_group_span( &block )
+ content_tag :span, :class => 'edit_mode_group' do
+ yield
+ end
+ end
+
+
# Returns a span tag which is only shown in edit mode.
#
# show_only_in_edit_mode_span do
# content_tag :p do
# "This text is shown only in edit mode."