in_place_editing 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +21 -0
- data/in_place_editing.gemspec +1 -1
- data/lib/in_place_editing/controller_methods.rb +1 -1
- metadata +2 -2
- data/README +0 -14
data/README.rdoc
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
= in_place_editing
|
2
|
+
|
3
|
+
A Rails plugin for in-place editing fields.
|
4
|
+
|
5
|
+
= Installation
|
6
|
+
|
7
|
+
gem install in_place_editing
|
8
|
+
|
9
|
+
= Usage
|
10
|
+
|
11
|
+
In your controller define what model and fields you want in-place editing support for.
|
12
|
+
|
13
|
+
class BlogController < ApplicationController
|
14
|
+
in_place_edit_for :post, :title
|
15
|
+
end
|
16
|
+
|
17
|
+
In a view tell it where to place the JS and data.
|
18
|
+
|
19
|
+
<%= in_place_editor_field :post, 'title' %>
|
20
|
+
|
21
|
+
Copyright (c) 2007 David Heinemeier Hansson, released under the MIT license
|
data/in_place_editing.gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "in_place_editing"
|
6
|
-
s.version = "1.1.
|
6
|
+
s.version = "1.1.1"
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.authors = ["David Heinemeier Hansson", "Jeremy Kemper", "Jose Fernandez", "Pawel Stradomski, Mark Turner"]
|
9
9
|
s.email = ["mark@amerine.net"]
|
@@ -16,7 +16,7 @@ module InPlaceEditing
|
|
16
16
|
module ClassMethods
|
17
17
|
def in_place_edit_for(object, attribute, options = {})
|
18
18
|
define_method("set_#{object}_#{attribute}") do
|
19
|
-
unless [:post, :put].include?(request.
|
19
|
+
unless [:post, :put].include?(request.method_symbol) then
|
20
20
|
return render(:text => 'Method not allowed', :status => 405)
|
21
21
|
end
|
22
22
|
@item = object.to_s.camelize.constantize.find(params[:id])
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: in_place_editing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -22,7 +22,7 @@ extensions: []
|
|
22
22
|
extra_rdoc_files: []
|
23
23
|
files:
|
24
24
|
- .gitignore
|
25
|
-
- README
|
25
|
+
- README.rdoc
|
26
26
|
- Rakefile
|
27
27
|
- in_place_editing.gemspec
|
28
28
|
- init.rb
|
data/README
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
InPlaceEditing
|
2
|
-
==============
|
3
|
-
|
4
|
-
Example:
|
5
|
-
|
6
|
-
# Controller
|
7
|
-
class BlogController < ApplicationController
|
8
|
-
in_place_edit_for :post, :title
|
9
|
-
end
|
10
|
-
|
11
|
-
# View
|
12
|
-
<%= in_place_editor_field :post, 'title' %>
|
13
|
-
|
14
|
-
Copyright (c) 2007 David Heinemeier Hansson, released under the MIT license
|