From 2807ccc69a54805e3914bcc21716f9bafbebef39 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 10 Sep 2007 00:53:13 +0000 Subject: Moved ActionController::Macros::InPlaceEditing into the in_place_editor plugin on the official Rails svn (closes #9513) [lifofifo] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7442 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../action_controller/macros/in_place_editing.rb | 33 ---------------------- 1 file changed, 33 deletions(-) (limited to 'actionpack/lib/action_controller/macros/in_place_editing.rb') diff --git a/actionpack/lib/action_controller/macros/in_place_editing.rb b/actionpack/lib/action_controller/macros/in_place_editing.rb index d04f1ce1de..e69de29bb2 100644 --- a/actionpack/lib/action_controller/macros/in_place_editing.rb +++ b/actionpack/lib/action_controller/macros/in_place_editing.rb @@ -1,33 +0,0 @@ -module ActionController - module Macros - module InPlaceEditing #:nodoc: - def self.included(base) #:nodoc: - base.extend(ClassMethods) - end - - # DEPRECATION WARNING: This method will become a separate plugin when Rails 2.0 ships. - # - # Example: - # - # # Controller - # class BlogController < ApplicationController - # in_place_edit_for :post, :title - # end - # - # # View - # <%= in_place_editor_field :post, 'title' %> - # - # For help on defining an in place editor in the browser, - # see ActionView::Helpers::JavaScriptHelper. - module ClassMethods - def in_place_edit_for(object, attribute, options = {}) - define_method("set_#{object}_#{attribute}") do - @item = object.to_s.camelize.constantize.find(params[:id]) - @item.update_attribute(attribute, params[:value]) - render :text => @item.send(attribute) - end - end - end - end - end -end -- cgit v1.2.3