jzajpt-blueberry_scaffold 0.3.3 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.3
1
+ 0.3.4
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{blueberry_scaffold}
5
- s.version = "0.3.3"
5
+ s.version = "0.3.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Ji\305\231\303\255 Zajpt"]
9
- s.date = %q{2009-06-11}
9
+ s.date = %q{2009-06-15}
10
10
  s.description = %q{Scaffold generator featuring i18n, shoulda & factory girl tests.}
11
11
  s.email = %q{jzajpt@blueberryapps.com}
12
12
  s.extra_rdoc_files = [
@@ -162,7 +162,7 @@ class BlueberryScaffoldGenerator < Rails::Generator::Base
162
162
  end
163
163
 
164
164
  def edit_item_path
165
- @namespace ? "edit_#{@namespace}_edit_#{singular_name}_path" : "edit_#{singular_name}_path"
165
+ @namespace ? "edit_#{@namespace}_#{singular_name}_path" : "edit_#{singular_name}_path"
166
166
  end
167
167
 
168
168
  def controller_route
@@ -1,6 +1,6 @@
1
1
  class <%= controller_class_name %> < ApplicationController
2
2
  <% if action? :index -%>
3
- # GET /<%= plural_name %>
3
+ # GET /<%= controller_route %>
4
4
  def index
5
5
  @<%= plural_name %> = <%= class_name %>.paginate(
6
6
  :per_page => 25,
@@ -10,7 +10,7 @@ class <%= controller_class_name %> < ApplicationController
10
10
 
11
11
  <% end -%>
12
12
  <% if action? :show -%>
13
- # GET /<%= plural_name %>/:id
13
+ # GET /<%= controller_route %>/:id
14
14
  def show
15
15
  @<%= singular_name %> = <%= class_name %>.find(params[:id])
16
16
  end
@@ -19,19 +19,19 @@ class <%= controller_class_name %> < ApplicationController
19
19
  <% if action? :new -%>
20
20
  # GET /<%= plural_name %>/new
21
21
  def new
22
- @<%= singular_name %> = <%= class_name %>.new
22
+ @<%= controller_route %> = <%= class_name %>.new
23
23
  end
24
24
 
25
25
  <% end -%>
26
26
  <% if action? :edit -%>
27
- # GET /<%= plural_name %>/:id/edit
27
+ # GET /<%= controller_route %>/:id/edit
28
28
  def edit
29
29
  @<%= singular_name %> = <%= class_name %>.find(params[:id])
30
30
  end
31
31
 
32
32
  <% end -%>
33
33
  <% if action? :create -%>
34
- # POST /<%= plural_name %>
34
+ # POST /<%= controller_route %>
35
35
  def create
36
36
  @<%= singular_name %> = <%= class_name %>.new(params[:<%= singular_name %>])
37
37
  @<%= singular_name %>.save!
@@ -43,7 +43,7 @@ class <%= controller_class_name %> < ApplicationController
43
43
 
44
44
  <% end -%>
45
45
  <% if action? :update -%>
46
- # PUT /<%= plural_name %>/:id
46
+ # PUT /<%= controller_route %>/:id
47
47
  def update
48
48
  @<%= singular_name %> = <%= class_name %>.find(params[:id])
49
49
  @<%= singular_name %>.update_attributes!(params[:<%= singular_name %>])
@@ -55,7 +55,7 @@ class <%= controller_class_name %> < ApplicationController
55
55
 
56
56
  <% end -%>
57
57
  <% if action? :destroy -%>
58
- # DELETE /<%= plural_name %>/:id
58
+ # DELETE /<%= controller_route %>/:id
59
59
  def destroy
60
60
  @<%= singular_name %> = <%= class_name %>.find(params[:id])
61
61
  @<%= singular_name %>.destroy
@@ -87,7 +87,7 @@ class <%= controller_test_name %> < ActionController::TestCase
87
87
  end
88
88
 
89
89
  should_respond_with :redirect
90
- should_redirect_to('portfolio items listing') { <%= url %> }
90
+ should_redirect_to('<%= url %>') { <%= url %> }
91
91
  should_assign_to :<%= singular_name %>, :class => <%= class_name %>
92
92
  should_set_the_flash_to I18n.t('<%= i18n_prefix %>.create.success')
93
93
  end
@@ -155,7 +155,7 @@ class <%= controller_test_name %> < ActionController::TestCase
155
155
  end
156
156
 
157
157
  should_respond_with :redirect
158
- should_redirect_to('portfolio items listing') { <%= url %> }
158
+ should_redirect_to('<%= url %>') { <%= url %> }
159
159
  should_assign_to(:<%= singular_name %>, :class => <%= class_name %>) { @<%= singular_name %> }
160
160
  should_set_the_flash_to I18n.t('<%= i18n_prefix %>.destroy.success')
161
161
 
@@ -4,9 +4,15 @@
4
4
  <% for attribute in attributes -%>
5
5
  <th><%%= <%= class_name %>.human_attribute_name '<%= attribute.column.name %>' %></th>
6
6
  <% end -%>
7
+ <th class="actions"></th>
7
8
  </tr>
8
9
  </thead>
9
10
  <tbody>
11
+ <%% if @<%= plural_name %>.empty? -%>
12
+ <tr>
13
+ <td colspan="<%= attributes.size + 1 %>" class="empty"><%= t('<%= i18n_prefix %>.list.empty') %></td>
14
+ </tr>
15
+ <%% end -%>
10
16
  <%% @<%= plural_name %>.each do |<%= singular_name %>| -%>
11
17
  <%% content_tag_for :tr, <%= singular_name %> do %>
12
18
  <% for attribute in attributes -%>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jzajpt-blueberry_scaffold
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Ji\xC5\x99\xC3\xAD Zajpt"
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-06-11 00:00:00 -07:00
12
+ date: 2009-06-15 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15