Sha256: 2438ba8f205f23e3f4a2918c2fc16eee94377ba53d11cd77882d44a2a5624449
Contents?: true
Size: 1.71 KB
Versions: 13
Compression:
Stored size: 1.71 KB
Contents
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." # end # end # # will basically return # # <span class="show_only_in_edit_mode"> # <p> # This text is shown only in edit mode. # </p> # </span> # # The rest is done via javascript. def show_only_in_edit_mode_span( &block ) content_tag :span, :class => 'show_only_in_edit_mode' do yield end end # Returns a span tag which is only shown when *not* in edit mode. # # do_not_show_in_edit_mode_span do # content_tag :p do # "This text is not shown in edit mode." # end # end # # will basically return # # <span class="do_not_show_in_edit_mode"> # <p> # This text is not shown in edit mode. # </p> # </span> # # The rest is done via javascript. def do_not_show_in_edit_mode_span( &block ) content_tag :span, :class => 'do_not_show_in_edit_mode' do yield end end end end
Version data entries
13 entries across 13 versions & 1 rubygems