dramsay-simple_scaffold 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +1 -1
- data/VERSION.yml +1 -1
- data/generators/simple_scaffold/templates/controller.rb +7 -8
- data/simple_scaffold.gemspec +53 -0
- metadata +9 -8
data/README.markdown
CHANGED
data/VERSION.yml
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
class <%= controller_class_name %>Controller < ApplicationController
|
2
|
+
before_filter :find_<%= table_name %>, :except => [:index, :new, :create]
|
2
3
|
|
3
4
|
def index
|
4
5
|
@<%= table_name %> = <%= class_name %>.find(:all)
|
5
6
|
end
|
6
7
|
|
7
8
|
def show
|
8
|
-
@<%= file_name %> = <%= class_name %>.find(params[:id])
|
9
9
|
end
|
10
10
|
|
11
11
|
def new
|
@@ -13,12 +13,9 @@ class <%= controller_class_name %>Controller < ApplicationController
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def edit
|
16
|
-
@<%= file_name %> = <%= class_name %>.find(params[:id])
|
17
16
|
end
|
18
17
|
|
19
18
|
def create
|
20
|
-
@<%= file_name %> = <%= class_name %>.new(params[:<%= file_name %>])
|
21
|
-
|
22
19
|
if @<%= file_name %>.save
|
23
20
|
flash[:notice] = '<%= class_name %> was successfully created.'
|
24
21
|
redirect_to(@<%= file_name %>)
|
@@ -28,8 +25,6 @@ class <%= controller_class_name %>Controller < ApplicationController
|
|
28
25
|
end
|
29
26
|
|
30
27
|
def update
|
31
|
-
@<%= file_name %> = <%= class_name %>.find(params[:id])
|
32
|
-
|
33
28
|
if @<%= file_name %>.update_attributes(params[:<%= file_name %>])
|
34
29
|
flash[:notice] = '<%= class_name %> was successfully updated.'
|
35
30
|
redirect_to(@<%= file_name %>)
|
@@ -39,9 +34,13 @@ class <%= controller_class_name %>Controller < ApplicationController
|
|
39
34
|
end
|
40
35
|
|
41
36
|
def destroy
|
42
|
-
@<%= file_name %> = <%= class_name %>.find(params[:id])
|
43
37
|
@<%= file_name %>.destroy
|
44
|
-
|
45
38
|
redirect_to(<%= table_name %>_url)
|
46
39
|
end
|
40
|
+
|
41
|
+
private
|
42
|
+
|
43
|
+
def find_<%= table_name %>
|
44
|
+
@<%= file_name %> = <%= class_name %>.find(params[:id])
|
45
|
+
end
|
47
46
|
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{simple_scaffold}
|
5
|
+
s.version = "0.0.2"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Doug Ramsay"]
|
9
|
+
s.date = %q{2009-06-15}
|
10
|
+
s.email = %q{doug@intridea.com}
|
11
|
+
s.extra_rdoc_files = [
|
12
|
+
"LICENSE",
|
13
|
+
"README.markdown"
|
14
|
+
]
|
15
|
+
s.files = [
|
16
|
+
".document",
|
17
|
+
".gitignore",
|
18
|
+
"LICENSE",
|
19
|
+
"README.markdown",
|
20
|
+
"Rakefile",
|
21
|
+
"VERSION.yml",
|
22
|
+
"generators/simple_scaffold/simple_scaffold_generator.rb",
|
23
|
+
"generators/simple_scaffold/templates/controller.rb",
|
24
|
+
"generators/simple_scaffold/templates/controller_spec.rb",
|
25
|
+
"generators/simple_scaffold/templates/migration.rb",
|
26
|
+
"generators/simple_scaffold/templates/model.rb",
|
27
|
+
"generators/simple_scaffold/templates/model_spec.rb",
|
28
|
+
"lib/simple_scaffold.rb",
|
29
|
+
"simple_scaffold.gemspec",
|
30
|
+
"test/simple_scaffold_test.rb",
|
31
|
+
"test/test_helper.rb"
|
32
|
+
]
|
33
|
+
s.has_rdoc = true
|
34
|
+
s.homepage = %q{http://github.com/dramsay/simple_scaffold}
|
35
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
36
|
+
s.require_paths = ["lib"]
|
37
|
+
s.rubygems_version = %q{1.3.2}
|
38
|
+
s.summary = %q{TODO}
|
39
|
+
s.test_files = [
|
40
|
+
"test/simple_scaffold_test.rb",
|
41
|
+
"test/test_helper.rb"
|
42
|
+
]
|
43
|
+
|
44
|
+
if s.respond_to? :specification_version then
|
45
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
46
|
+
s.specification_version = 3
|
47
|
+
|
48
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
49
|
+
else
|
50
|
+
end
|
51
|
+
else
|
52
|
+
end
|
53
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dramsay-simple_scaffold
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Doug Ramsay
|
@@ -9,12 +9,12 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-06-
|
12
|
+
date: 2009-06-15 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
16
16
|
description:
|
17
|
-
email:
|
17
|
+
email: doug@intridea.com
|
18
18
|
executables: []
|
19
19
|
|
20
20
|
extensions: []
|
@@ -26,18 +26,19 @@ files:
|
|
26
26
|
- .document
|
27
27
|
- .gitignore
|
28
28
|
- LICENSE
|
29
|
+
- README.markdown
|
29
30
|
- Rakefile
|
30
31
|
- VERSION.yml
|
31
|
-
- lib/simple_scaffold.rb
|
32
|
-
- test/simple_scaffold_test.rb
|
33
|
-
- test/test_helper.rb
|
34
32
|
- generators/simple_scaffold/simple_scaffold_generator.rb
|
35
33
|
- generators/simple_scaffold/templates/controller.rb
|
36
34
|
- generators/simple_scaffold/templates/controller_spec.rb
|
37
35
|
- generators/simple_scaffold/templates/migration.rb
|
38
36
|
- generators/simple_scaffold/templates/model.rb
|
39
37
|
- generators/simple_scaffold/templates/model_spec.rb
|
40
|
-
-
|
38
|
+
- lib/simple_scaffold.rb
|
39
|
+
- simple_scaffold.gemspec
|
40
|
+
- test/simple_scaffold_test.rb
|
41
|
+
- test/test_helper.rb
|
41
42
|
has_rdoc: true
|
42
43
|
homepage: http://github.com/dramsay/simple_scaffold
|
43
44
|
post_install_message:
|
@@ -63,7 +64,7 @@ rubyforge_project:
|
|
63
64
|
rubygems_version: 1.2.0
|
64
65
|
signing_key:
|
65
66
|
specification_version: 3
|
66
|
-
summary:
|
67
|
+
summary: TODO
|
67
68
|
test_files:
|
68
69
|
- test/simple_scaffold_test.rb
|
69
70
|
- test/test_helper.rb
|