csmosx-haml_scaffold 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +6 -0
- data/Manifest.txt +0 -1
- data/README.rdoc +9 -1
- data/Rakefile +0 -1
- data/generators/haml_scaffold/templates/_form.html.haml.erb +7 -8
- data/generators/haml_scaffold/templates/_object.html.haml.erb +3 -3
- data/generators/haml_scaffold/templates/controller.rb.erb +4 -75
- data/generators/haml_scaffold/templates/view_edit.html.haml.erb +6 -5
- data/generators/haml_scaffold/templates/view_index.html.haml.erb +4 -4
- data/generators/haml_scaffold/templates/view_new.html.haml.erb +4 -3
- data/generators/haml_scaffold/templates/view_show.html.haml.erb +2 -2
- data/lib/haml_scaffold/version.rb +2 -2
- metadata +1 -2
- data/generators/haml_scaffold/templates/stylesheet.sass +0 -11
data/History.txt
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
=== 1.1.1 / 2009-08-11
|
2
|
+
|
3
|
+
* Updated controller & views to use resource_controller gem
|
4
|
+
* Removed requirement of old version of will_paginate
|
5
|
+
* Deleted creation of stylesheets/sass folder and application.sass
|
6
|
+
|
1
7
|
=== 1.1.0 / 2009-07-30
|
2
8
|
|
3
9
|
* 3 major enhancements
|
data/Manifest.txt
CHANGED
@@ -11,7 +11,6 @@ generators/haml_scaffold/templates/functional_test.rb.erb
|
|
11
11
|
generators/haml_scaffold/templates/helper.rb.erb
|
12
12
|
generators/haml_scaffold/templates/helper_test.rb.erb
|
13
13
|
generators/haml_scaffold/templates/layout.html.haml.erb
|
14
|
-
generators/haml_scaffold/templates/stylesheet.sass
|
15
14
|
generators/haml_scaffold/templates/view_edit.html.haml.erb
|
16
15
|
generators/haml_scaffold/templates/view_index.html.haml.erb
|
17
16
|
generators/haml_scaffold/templates/view_new.html.haml.erb
|
data/README.rdoc
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
= Haml Scaffold ( csmosx fork )
|
2
|
+
|
3
|
+
=== Changes in this fork
|
4
|
+
|
5
|
+
* Updated controller & views to use {resource_controller}[http://github.com/csmosx/resource_controller/tree/master] gem
|
6
|
+
* removed requirement of old version of will_paginate
|
7
|
+
* deleted creation of stylesheets/sass folder and application.sass
|
8
|
+
|
1
9
|
= Haml Scaffold
|
2
10
|
|
3
11
|
A collection of hacks to the Rails scaffold generator, to make it output
|
@@ -79,4 +87,4 @@ Also, don't forget to Hamlize your Rails app:
|
|
79
87
|
{Norman Clarke}[mailto:norman@njclarke.com]
|
80
88
|
|
81
89
|
This work is derived from code in {Ruby on Rails}[http://rubyonrails.org/] and
|
82
|
-
is released under its same license, the MIT License.
|
90
|
+
is released under its same license, the MIT License.
|
data/Rakefile
CHANGED
@@ -9,7 +9,6 @@ $hoe = Hoe.new("haml_scaffold", HamlScaffold::Version::STRING) do |p|
|
|
9
9
|
p.description = "Rails scaffolding with Haml rather than ERB, and various other improvements."
|
10
10
|
p.url = 'http://haml-scaffold.rubyforge.org/'
|
11
11
|
p.extra_deps << ['haml', '>= 2.0.6']
|
12
|
-
#p.extra_deps << ['will_paginate', '>= 2.2.2']
|
13
12
|
p.extra_deps << ['mocha', '>= 0.9.0']
|
14
13
|
p.extra_dev_deps << ['newgem', ">= #{::Newgem::VERSION}"]
|
15
14
|
p.remote_rdoc_dir = "/"
|
@@ -1,10 +1,9 @@
|
|
1
|
-
|
2
|
-
= f.error_messages
|
1
|
+
= f.error_messages
|
3
2
|
<% for attribute in attributes -%>
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
%p
|
4
|
+
= f.label :<%= attribute.name %>
|
5
|
+
%br
|
6
|
+
= f.<%= attribute.field_type %> :<%= attribute.name %>
|
8
7
|
<% end -%>
|
9
|
-
|
10
|
-
|
8
|
+
%p
|
9
|
+
= f.submit "Submit"
|
@@ -5,6 +5,6 @@
|
|
5
5
|
%strong <%= attribute.column.human_name %>:
|
6
6
|
=h <%= singular_name %>.<%= attribute.name %>
|
7
7
|
<% end -%>
|
8
|
-
= link_to 'Show',
|
9
|
-
= link_to 'Edit',
|
10
|
-
= link_to 'Destroy',
|
8
|
+
= link_to 'Show', object_path(object)
|
9
|
+
= link_to 'Edit', edit_object_path(object)
|
10
|
+
= link_to 'Destroy', object_path(object), :confirm => 'Are you sure?', :method => :delete
|
@@ -1,80 +1,9 @@
|
|
1
|
-
class <%= controller_class_name %>Controller <
|
2
|
-
|
3
|
-
before_filter :find_<%= file_name %>
|
4
|
-
|
5
|
-
<%= file_name.pluralize.upcase %>_PER_PAGE = 20
|
6
|
-
|
7
|
-
def create
|
8
|
-
@<%= file_name %> = <%= class_name %>.new(params[:<%= file_name %>])
|
9
|
-
respond_to do |format|
|
10
|
-
if @<%= file_name %>.save
|
11
|
-
flash[:notice] = '<%= class_name %> was successfully created.'
|
12
|
-
format.html { redirect_to @<%= file_name %> }
|
13
|
-
format.xml { render :xml => @<%= file_name %>, :status => :created, :location => @<%= file_name %> }
|
14
|
-
else
|
15
|
-
format.html { render :action => "new" }
|
16
|
-
format.xml { render :xml => @<%= file_name %>.errors, :status => :unprocessable_entity }
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def destroy
|
22
|
-
respond_to do |format|
|
23
|
-
if @<%= file_name %>.destroy
|
24
|
-
flash[:notice] = '<%= class_name %> was successfully destroyed.'
|
25
|
-
format.html { redirect_to <%= file_name.pluralize %>_path }
|
26
|
-
format.xml { head :ok }
|
27
|
-
else
|
28
|
-
flash[:error] = '<%= class_name %> could not be destroyed.'
|
29
|
-
format.html { redirect_to @<%= file_name %> }
|
30
|
-
format.xml { head :unprocessable_entity }
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
def index
|
36
|
-
@<%= table_name %> = <%= class_name %>.paginate(:page => params[:page], :per_page => <%= file_name.pluralize.upcase %>_PER_PAGE)
|
37
|
-
respond_to do |format|
|
38
|
-
format.html
|
39
|
-
format.xml { render :xml => @<%= table_name %> }
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
def edit
|
44
|
-
end
|
45
|
-
|
46
|
-
def new
|
47
|
-
@<%= file_name %> = <%= class_name %>.new
|
48
|
-
respond_to do |format|
|
49
|
-
format.html
|
50
|
-
format.xml { render :xml => @<%= file_name %> }
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
def show
|
55
|
-
respond_to do |format|
|
56
|
-
format.html
|
57
|
-
format.xml { render :xml => @<%= file_name %> }
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
def update
|
62
|
-
respond_to do |format|
|
63
|
-
if @<%= file_name %>.update_attributes(params[:<%= file_name %>])
|
64
|
-
flash[:notice] = '<%= class_name %> was successfully updated.'
|
65
|
-
format.html { redirect_to @<%= file_name %> }
|
66
|
-
format.xml { head :ok }
|
67
|
-
else
|
68
|
-
format.html { render :action => "edit" }
|
69
|
-
format.xml { render :xml => @<%= file_name %>.errors, :status => :unprocessable_entity }
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
1
|
+
class <%= controller_class_name %>Controller < ResourceController::Base
|
73
2
|
|
74
3
|
private
|
75
4
|
|
76
|
-
def
|
77
|
-
|
5
|
+
def collection
|
6
|
+
@collection ||= end_of_association_chain.paginate(:page => params[:page])
|
78
7
|
end
|
79
8
|
|
80
|
-
end
|
9
|
+
end
|
@@ -1,6 +1,7 @@
|
|
1
|
-
%h2 Editing <%= singular_name %>
|
2
|
-
|
1
|
+
%h2 Editing <%= singular_name.classify %>
|
2
|
+
- form_for(@object, :url => object_path) do |f|
|
3
|
+
= render :partial => 'form', :locals => {:f => f}
|
3
4
|
%ul
|
4
|
-
%li= link_to 'Show',
|
5
|
-
%li= link_to 'Back',
|
6
|
-
%li= link_to 'Destroy',
|
5
|
+
%li= link_to 'Show', object_path(@object)
|
6
|
+
%li= link_to 'Back', object_path
|
7
|
+
%li= link_to 'Destroy', @object, :confirm => 'Are you sure?', :method => :delete
|
@@ -1,8 +1,8 @@
|
|
1
|
-
%h2 Listing <%=
|
2
|
-
-
|
1
|
+
%h2 Listing <%= controller_class_name %>
|
2
|
+
- unless @<%= plural_name %>.empty?
|
3
3
|
.<%= plural_name %>
|
4
4
|
= render :partial => "<%= singular_name %>", :collection => @<%= plural_name %>
|
5
5
|
= will_paginate(@<%= plural_name %>)
|
6
6
|
- else
|
7
|
-
%p There are no <%=
|
8
|
-
= link_to 'New <%= singular_name %>',
|
7
|
+
%p There are no <%= controller_class_name %> to show yet.
|
8
|
+
= link_to 'New <%= singular_name.classify %>', new_object_path
|
@@ -1,4 +1,5 @@
|
|
1
|
-
%h2 New <%= singular_name %>
|
2
|
-
|
1
|
+
%h2 New <%= singular_name.classify %>
|
2
|
+
- form_for(@object, :url => collection_path) do |f|
|
3
|
+
= render :partial => 'form', :locals => {:f => f}
|
3
4
|
%ul
|
4
|
-
%li= link_to 'Back',
|
5
|
+
%li= link_to 'Back', collection_path
|
@@ -7,5 +7,5 @@
|
|
7
7
|
=h @<%= singular_name %>.<%= attribute.name %>
|
8
8
|
<% end -%>
|
9
9
|
%ul
|
10
|
-
%li= link_to 'Edit',
|
11
|
-
%li= link_to 'Back',
|
10
|
+
%li= link_to 'Edit', edit_object_path
|
11
|
+
%li= link_to 'Back', collection_path
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: csmosx-haml_scaffold
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Norman Clarke
|
@@ -77,7 +77,6 @@ files:
|
|
77
77
|
- generators/haml_scaffold/templates/helper.rb.erb
|
78
78
|
- generators/haml_scaffold/templates/helper_test.rb.erb
|
79
79
|
- generators/haml_scaffold/templates/layout.html.haml.erb
|
80
|
-
- generators/haml_scaffold/templates/stylesheet.sass
|
81
80
|
- generators/haml_scaffold/templates/view_edit.html.haml.erb
|
82
81
|
- generators/haml_scaffold/templates/view_index.html.haml.erb
|
83
82
|
- generators/haml_scaffold/templates/view_new.html.haml.erb
|