diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2007-09-10 00:53:13 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2007-09-10 00:53:13 +0000 |
commit | 2807ccc69a54805e3914bcc21716f9bafbebef39 (patch) | |
tree | e8f6a1863b6f59f710c7a97b04edebbba005a656 /actionpack/lib/action_controller | |
parent | ddf385a55445f22221d64c9ead43470e2c56af2e (diff) | |
download | rails-2807ccc69a54805e3914bcc21716f9bafbebef39.tar.gz rails-2807ccc69a54805e3914bcc21716f9bafbebef39.tar.bz2 rails-2807ccc69a54805e3914bcc21716f9bafbebef39.zip |
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
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/macros/in_place_editing.rb | 33 |
1 files changed, 0 insertions, 33 deletions
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 |