lib/in_place_macros_helper.rb
# Renders the value of the specified object and method with in-place editing capabilities.
Renders the value of the specified object and method with in-place editing capabilities.
Renders the value of the specified object and method with in - place editing capabilities .
def in_place_editor_field(object, method, tag_options = {}, in_place_editor_options = {})
    tag = ::ActionView::Helpers::InstanceTag.new(object, method, self)
    tag_options = {:tag => "span", :id => "#{object}_#{method}_#{tag.object.id}_in_place_editor", :class => "in_place_editor_field"}.merge!(tag_options)
    in_place_editor_options[:url] = in_place_editor_options[:url] || url_for({ :action => "set_#{object}_#{method}", :id => tag.object.id })
    if helper_formatter = in_place_editor_options.delete(:helper_formatter)
      item = @template.instance_variable_get("@#{object}")
      value = item.send(method)
      content = content_tag(tag_options.delete(:tag), @template.send( helper_formatter, value), tag_options)
    else
      content = tag.to_content_tag(tag_options.delete(:tag), tag_options)
    end
    content + in_place_editor(tag_options[:id], in_place_editor_options)
  end
def in_place_editor_field ( object , method , tag_options = { } , in_place_editor_options = { } ) tag = :: ActionView :: Helpers :: InstanceTag . new ( object , method , self ) tag_options = { :tag => "span" , :id => "#{object}_#{method}_#{tag.object.id}_in_place_editor" , :class => "in_place_editor_field" } . merge! ( tag_options ) in_place_editor_options [ :url ] = in_place_editor_options [ :url ] || url_for ( { :action => "set_#{object}_#{method}" , :id => tag . object . id } ) if helper_formatter = in_place_editor_options . delete ( :helper_formatter ) item = @template . instance_variable_get ( "@#{object}" ) value = item . send ( method ) content = content_tag ( tag_options . delete ( :tag ) , @template . send ( helper_formatter , value ) , tag_options ) else content = tag . to_content_tag ( tag_options . delete ( :tag ) , tag_options ) end content + in_place_editor ( tag_options [ :id ] , in_place_editor_options ) end
Renders the value of the specified object and method with in-place editing capabilities.
Renders the value of the specified object and method with in - place editing capabilities .
# in_place_editor_options[:load_text_url] ||= { :controller => object.pluralize, :action => 'show', :id => tag.object.id, :attribute => method.to_s } 
object
method
tag_options
in_place_editor_options