resource_controller 0.5.3 → 0.6.6
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/README.rdoc +18 -14
- data/VERSION.yml +5 -0
- data/generators/scaffold_resource/templates/rspec/routing_spec.rb +8 -8
- data/generators/scaffold_resource/templates/rspec/views/index_spec.rb +2 -2
- data/lib/resource_controller.rb +5 -14
- data/lib/resource_controller/base.rb +2 -2
- data/lib/resource_controller/class_methods.rb +2 -2
- data/lib/resource_controller/controller.rb +3 -2
- data/lib/resource_controller/helpers.rb +0 -6
- data/lib/resource_controller/helpers/nested.rb +1 -1
- data/lib/resource_controller/singleton.rb +2 -2
- data/test/app/controllers/{application.rb → application_controller.rb} +0 -2
- data/test/app/controllers/cms/personnel_controller.rb +2 -0
- data/test/app/controllers/cms/photos_controller.rb +6 -0
- data/test/app/controllers/photos_controller.rb +1 -0
- data/test/app/models/personnel.rb +3 -0
- data/test/app/models/photo.rb +1 -0
- data/test/app/views/cms/photos/edit.rhtml +17 -0
- data/test/app/views/cms/photos/index.rhtml +20 -0
- data/test/app/views/cms/photos/new.rhtml +16 -0
- data/test/app/views/cms/photos/show.rhtml +8 -0
- data/test/config/boot.rb +6 -5
- data/test/config/database.yml +6 -10
- data/test/config/environment.rb +4 -4
- data/test/config/environments/development.rb +0 -4
- data/test/config/initializers/inflections.rb +14 -0
- data/test/config/routes.rb +3 -0
- data/test/db/migrate/013_create_personnel.rb +11 -0
- data/test/db/migrate/014_add_personnel_id_to_photos.rb +9 -0
- data/test/db/schema.rb +9 -3
- data/test/test/fixtures/personnel.yml +5 -0
- data/test/test/functional/cms/options_controller_test.rb +1 -1
- data/test/test/functional/cms/photos_controller_test.rb +43 -0
- data/test/test/functional/cms/products_controller_test.rb +1 -1
- data/test/test/functional/comments_controller_test.rb +2 -9
- data/test/test/functional/images_controller_test.rb +1 -8
- data/test/test/functional/people_controller_test.rb +2 -9
- data/test/test/functional/photos_controller_test.rb +2 -9
- data/test/test/functional/posts_controller_test.rb +2 -9
- data/test/test/functional/projects_controller_test.rb +12 -9
- data/test/test/functional/somethings_controller_test.rb +2 -9
- data/test/test/functional/tags_controller_test.rb +2 -9
- data/test/test/functional/users_controller_test.rb +2 -9
- data/test/test/test_helper.rb +4 -3
- data/test/test/unit/accessors_test.rb +2 -2
- data/test/test/unit/account_test.rb +1 -1
- data/test/test/unit/action_options_test.rb +1 -1
- data/test/test/unit/base_test.rb +1 -1
- data/test/test/unit/comment_test.rb +1 -1
- data/test/test/unit/failable_action_options_test.rb +1 -1
- data/test/test/unit/helpers_test.rb +1 -1
- data/test/test/unit/image_test.rb +1 -1
- data/test/test/unit/option_test.rb +1 -1
- data/test/test/unit/photo_test.rb +1 -1
- data/test/test/unit/post_test.rb +1 -1
- data/test/test/unit/project_test.rb +1 -1
- data/test/test/unit/response_collector_test.rb +1 -1
- data/test/test/unit/something_test.rb +1 -1
- data/test/test/unit/tag_test.rb +1 -1
- data/test/test/unit/urligence_test.rb +1 -1
- metadata +162 -122
- data/Rakefile +0 -35
- data/init.rb +0 -1
- data/lib/resource_controller/version.rb +0 -9
- data/test/log/development.log +0 -3350
- data/test/log/test.log +0 -174947
- data/test/log/thin.log +0 -12
- data/test/vendor/plugins/shoulda/Rakefile +0 -32
- data/test/vendor/plugins/shoulda/bin/convert_to_should_syntax +0 -40
- data/test/vendor/plugins/shoulda/init.rb +0 -3
- data/test/vendor/plugins/shoulda/lib/shoulda.rb +0 -43
- data/test/vendor/plugins/shoulda/lib/shoulda/active_record_helpers.rb +0 -580
- data/test/vendor/plugins/shoulda/lib/shoulda/color.rb +0 -77
- data/test/vendor/plugins/shoulda/lib/shoulda/controller_tests/controller_tests.rb +0 -467
- data/test/vendor/plugins/shoulda/lib/shoulda/controller_tests/formats/html.rb +0 -201
- data/test/vendor/plugins/shoulda/lib/shoulda/controller_tests/formats/xml.rb +0 -170
- data/test/vendor/plugins/shoulda/lib/shoulda/gem/proc_extensions.rb +0 -14
- data/test/vendor/plugins/shoulda/lib/shoulda/gem/shoulda.rb +0 -239
- data/test/vendor/plugins/shoulda/lib/shoulda/general.rb +0 -118
- data/test/vendor/plugins/shoulda/lib/shoulda/private_helpers.rb +0 -22
data/README.rdoc
CHANGED
@@ -4,21 +4,9 @@ resource_controller makes RESTful controllers easier, more maintainable, and sup
|
|
4
4
|
|
5
5
|
== Get It
|
6
6
|
|
7
|
-
|
7
|
+
Install it as a plugin:
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
...or for the development version
|
12
|
-
|
13
|
-
config.gem 'giraffesoft-resource_controller', :lib => 'resource_controller', :source => 'http://gems.github.com'
|
14
|
-
|
15
|
-
Or install it as a gem manually
|
16
|
-
|
17
|
-
sudo gem install resource_controller
|
18
|
-
|
19
|
-
...or for the development version
|
20
|
-
|
21
|
-
sudo gem install giraffesoft-resource_controller
|
9
|
+
script/plugin install git://github.com/giraffesoft/resource_controller.git
|
22
10
|
|
23
11
|
Or grab the source
|
24
12
|
|
@@ -84,6 +72,16 @@ Or you can create a whole new block. This syntax destroys everything that's the
|
|
84
72
|
wants.js { render :template => "show.rjs" }
|
85
73
|
end
|
86
74
|
end
|
75
|
+
|
76
|
+
If you have a nested resource and want to redirect to the parent after create/update and destroy you can do this in the object controller
|
77
|
+
|
78
|
+
class CommentsController < ResourceController::Base
|
79
|
+
belongs_to :post
|
80
|
+
|
81
|
+
create.wants.html { redirect_to smart_url(parent_url_options) }
|
82
|
+
update.wants.html { redirect_to smart_url(parent_url_options) }
|
83
|
+
destroy.wants.html { redirect_to smart_url(parent_url_options) }
|
84
|
+
end
|
87
85
|
|
88
86
|
=== Scoping
|
89
87
|
|
@@ -118,6 +116,12 @@ If you want to create a singleton RESTful controller inherit from ResourceContro
|
|
118
116
|
class AccountsController < ResourceController::Singleton
|
119
117
|
end
|
120
118
|
|
119
|
+
...or if need to inherit from some other class:
|
120
|
+
|
121
|
+
class AccountsController < ApplicationController
|
122
|
+
resource_controller :singleton
|
123
|
+
end
|
124
|
+
|
121
125
|
*Note:* This type of controllers handle a single resource only so the index action and all the collection helpers (collection_url, collection_path...) are not available for them.
|
122
126
|
|
123
127
|
Loading objects in singletons is similar to plural controllers with one exception. For non-nested singleton controllers you should override the object method as it defaults to nil for them.
|
data/VERSION.yml
ADDED
@@ -11,20 +11,20 @@ describe <%= controller_class_name %>Controller do
|
|
11
11
|
route_for(:controller => "<%= table_name %>", :action => "new").should == "/<%= table_name %>/new"
|
12
12
|
end
|
13
13
|
|
14
|
-
it "should map { :controller => '<%= table_name %>', :action => 'show', :id => 1
|
15
|
-
route_for(:controller => "<%= table_name %>", :action => "show", :id => 1).should == "/<%= table_name %>/1"
|
14
|
+
it "should map { :controller => '<%= table_name %>', :action => 'show', :id => '1'} to /<%= table_name %>/1" do
|
15
|
+
route_for(:controller => "<%= table_name %>", :action => "show", :id => "1").should == "/<%= table_name %>/1"
|
16
16
|
end
|
17
17
|
|
18
|
-
it "should map { :controller => '<%= table_name %>', :action => 'edit', :id => 1 } to /<%= table_name %>/1<%= resource_edit_path %>" do
|
19
|
-
route_for(:controller => "<%= table_name %>", :action => "edit", :id => 1).should == "/<%= table_name %>/1<%= resource_edit_path %>"
|
18
|
+
it "should map { :controller => '<%= table_name %>', :action => 'edit', :id => '1' } to /<%= table_name %>/1<%= resource_edit_path %>" do
|
19
|
+
route_for(:controller => "<%= table_name %>", :action => "edit", :id => "1").should == "/<%= table_name %>/1<%= resource_edit_path %>"
|
20
20
|
end
|
21
21
|
|
22
|
-
it "should map { :controller => '<%= table_name %>', :action => 'update', :id => 1} to /<%= table_name %>/1" do
|
23
|
-
route_for(:controller => "<%= table_name %>", :action => "update", :id => 1).should == "/<%= table_name %>/1"
|
22
|
+
it "should map { :controller => '<%= table_name %>', :action => 'update', :id => '1' } to /<%= table_name %>/1" do
|
23
|
+
route_for(:controller => "<%= table_name %>", :action => "update", :id => "1").should == {:path => "/<%= table_name %>/1", :method => :put}
|
24
24
|
end
|
25
25
|
|
26
|
-
it "should map { :controller => '<%= table_name %>', :action => 'destroy', :id => 1} to /<%= table_name %>/1" do
|
27
|
-
route_for(:controller => "<%= table_name %>", :action => "destroy", :id => 1).should == "/<%= table_name %>/1"
|
26
|
+
it "should map { :controller => '<%= table_name %>', :action => 'destroy', :id => '1' } to /<%= table_name %>/1" do
|
27
|
+
route_for(:controller => "<%= table_name %>", :action => "destroy", :id => "1").should == {:path => "/<%= table_name %>/1", :method => :delete}
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
@@ -11,9 +11,9 @@ describe "/<%= table_name %>/index.<%= default_file_extension %>" do
|
|
11
11
|
<% end -%><% end %>
|
12
12
|
assigns[:<%= table_name %>] = [<%= file_name %>_98, <%= file_name %>_99]
|
13
13
|
|
14
|
-
template.stub!(:object_url).and_return(<%= file_name %>_path(
|
14
|
+
template.stub!(:object_url).and_return(<%= file_name %>_path(<%= file_name %>_99))
|
15
15
|
template.stub!(:new_object_url).and_return(new_<%= file_name %>_path)
|
16
|
-
template.stub!(:edit_object_url).and_return(edit_<%= file_name %>_path(
|
16
|
+
template.stub!(:edit_object_url).and_return(edit_<%= file_name %>_path(<%= file_name %>_99))
|
17
17
|
end
|
18
18
|
|
19
19
|
it "should render list of <%= table_name %>" do
|
data/lib/resource_controller.rb
CHANGED
@@ -1,17 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
require 'resource_controller/base'
|
7
|
-
require 'resource_controller/class_methods'
|
8
|
-
require 'resource_controller/controller'
|
9
|
-
require 'resource_controller/failable_action_options'
|
10
|
-
require 'resource_controller/helpers'
|
11
|
-
require 'resource_controller/response_collector'
|
12
|
-
require 'resource_controller/singleton'
|
13
|
-
require 'resource_controller/version'
|
14
|
-
require 'urligence'
|
1
|
+
begin
|
2
|
+
require_dependency 'application_controller'
|
3
|
+
rescue LoadError => e
|
4
|
+
require_dependency 'application'
|
5
|
+
end
|
15
6
|
|
16
7
|
module ResourceController
|
17
8
|
ACTIONS = [:index, :show, :new_action, :create, :edit, :update, :destroy].freeze
|
@@ -4,7 +4,7 @@ module ResourceController
|
|
4
4
|
#
|
5
5
|
# Inherit from this class to create your RESTful controller. See the README for usage.
|
6
6
|
#
|
7
|
-
class Base < ApplicationController
|
7
|
+
class Base < ::ApplicationController
|
8
8
|
unloadable
|
9
9
|
|
10
10
|
def self.inherited(subclass)
|
@@ -12,4 +12,4 @@ module ResourceController
|
|
12
12
|
subclass.class_eval { resource_controller }
|
13
13
|
end
|
14
14
|
end
|
15
|
-
end
|
15
|
+
end
|
@@ -17,8 +17,8 @@ module ResourceController
|
|
17
17
|
actions_to_remove += [*config[:except]] if config[:except]
|
18
18
|
actions_to_remove.uniq!
|
19
19
|
|
20
|
-
actions_to_remove.each { |action| undef_method(action)}
|
20
|
+
actions_to_remove.each { |action| undef_method(action) if method_defined?(action) }
|
21
21
|
end
|
22
22
|
|
23
23
|
end
|
24
|
-
end
|
24
|
+
end
|
@@ -11,7 +11,7 @@ module ResourceController
|
|
11
11
|
NAME_ACCESSORS.each { |accessor| send(accessor, controller_name.singularize.underscore) }
|
12
12
|
|
13
13
|
ACTIONS.each do |action|
|
14
|
-
class_scoping_reader action, FAILABLE_ACTIONS.include?(action) ? FailableActionOptions.new : ActionOptions.new
|
14
|
+
class_scoping_reader action, FAILABLE_ACTIONS.include?(action) ? ResourceController::FailableActionOptions.new : ResourceController::ActionOptions.new
|
15
15
|
end
|
16
16
|
|
17
17
|
self.helper_method :object_url, :edit_object_url, :new_object_url, :collection_url, :object, :collection,
|
@@ -56,6 +56,7 @@ module ResourceController
|
|
56
56
|
destroy do
|
57
57
|
flash "Successfully removed!"
|
58
58
|
wants.html { redirect_to collection_url }
|
59
|
+
failure.wants.html { redirect_to object_url }
|
59
60
|
end
|
60
61
|
|
61
62
|
class << self
|
@@ -66,4 +67,4 @@ module ResourceController
|
|
66
67
|
end
|
67
68
|
end
|
68
69
|
end
|
69
|
-
end
|
70
|
+
end
|
@@ -1,9 +1,3 @@
|
|
1
|
-
require 'resource_controller/helpers/current_objects'
|
2
|
-
require 'resource_controller/helpers/internal'
|
3
|
-
require 'resource_controller/helpers/nested'
|
4
|
-
require 'resource_controller/helpers/singleton_customizations'
|
5
|
-
require 'resource_controller/helpers/urls'
|
6
|
-
|
7
1
|
module ResourceController
|
8
2
|
# == ResourceController::Helpers
|
9
3
|
#
|
@@ -37,7 +37,7 @@ module ResourceController
|
|
37
37
|
# Returns true/false based on whether or not a parent is a singleton.
|
38
38
|
#
|
39
39
|
def parent_singleton?
|
40
|
-
!parent_type_from_request.nil?
|
40
|
+
!parent_type_from_request.nil? && parent_type_from_params.nil?
|
41
41
|
end
|
42
42
|
|
43
43
|
# Returns the current parent param, if there is a parent. (i.e. params[:post_id])
|
@@ -4,7 +4,7 @@ module ResourceController
|
|
4
4
|
#
|
5
5
|
# Inherit from this class to create your RESTful singleton controller. See the README for usage.
|
6
6
|
#
|
7
|
-
class Singleton < ApplicationController
|
7
|
+
class Singleton < ::ApplicationController
|
8
8
|
unloadable
|
9
9
|
|
10
10
|
def self.inherited(subclass)
|
@@ -12,4 +12,4 @@ module ResourceController
|
|
12
12
|
subclass.class_eval { resource_controller :singleton }
|
13
13
|
end
|
14
14
|
end
|
15
|
-
end
|
15
|
+
end
|
data/test/app/models/photo.rb
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
<h1>Editing photo</h1>
|
2
|
+
|
3
|
+
<%= error_messages_for :photo %>
|
4
|
+
|
5
|
+
<% form_for(:photo, :url => photo_path(@photo), :html => { :method => :put }) do |f| %>
|
6
|
+
<p>
|
7
|
+
<b>Title</b><br />
|
8
|
+
<%= f.text_field :title %>
|
9
|
+
</p>
|
10
|
+
|
11
|
+
<p>
|
12
|
+
<%= submit_tag "Update" %>
|
13
|
+
</p>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<%= link_to 'Show', photo_path(@photo) %> |
|
17
|
+
<%= link_to 'Back', photos_path %>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<h1>Listing photos</h1>
|
2
|
+
|
3
|
+
<table>
|
4
|
+
<tr>
|
5
|
+
<th>Title</th>
|
6
|
+
</tr>
|
7
|
+
|
8
|
+
<% for photo in @photos %>
|
9
|
+
<tr>
|
10
|
+
<td><%=h photo.title %></td>
|
11
|
+
<td><%= link_to 'Show', object_url(photo) %></td>
|
12
|
+
<td><%= link_to 'Edit', edit_object_url(photo) %></td>
|
13
|
+
<td><%= link_to 'Destroy', object_url(photo), :confirm => 'Are you sure?', :method => :delete %></td>
|
14
|
+
</tr>
|
15
|
+
<% end %>
|
16
|
+
</table>
|
17
|
+
|
18
|
+
<br />
|
19
|
+
|
20
|
+
<%= link_to 'New photo', new_object_url %>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<h1>New photo</h1>
|
2
|
+
|
3
|
+
<%= error_messages_for :photo %>
|
4
|
+
|
5
|
+
<% form_for(:photo, :url => photos_path) do |f| %>
|
6
|
+
<p>
|
7
|
+
<b>Title</b><br />
|
8
|
+
<%= f.text_field :title %>
|
9
|
+
</p>
|
10
|
+
|
11
|
+
<p>
|
12
|
+
<%= submit_tag "Create" %>
|
13
|
+
</p>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<%= link_to 'Back', photos_path %>
|
data/test/config/boot.rb
CHANGED
@@ -44,6 +44,7 @@ module Rails
|
|
44
44
|
def load_initializer
|
45
45
|
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
|
46
46
|
Rails::Initializer.run(:install_gem_spec_stubs)
|
47
|
+
Rails::GemDependency.add_frozen_gem_path
|
47
48
|
end
|
48
49
|
end
|
49
50
|
|
@@ -67,7 +68,7 @@ module Rails
|
|
67
68
|
|
68
69
|
class << self
|
69
70
|
def rubygems_version
|
70
|
-
Gem::RubyGemsVersion
|
71
|
+
Gem::RubyGemsVersion rescue nil
|
71
72
|
end
|
72
73
|
|
73
74
|
def gem_version
|
@@ -82,14 +83,14 @@ module Rails
|
|
82
83
|
|
83
84
|
def load_rubygems
|
84
85
|
require 'rubygems'
|
85
|
-
|
86
|
-
unless rubygems_version >=
|
87
|
-
$stderr.puts %(Rails requires RubyGems >=
|
86
|
+
min_version = '1.3.1'
|
87
|
+
unless rubygems_version >= min_version
|
88
|
+
$stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
|
88
89
|
exit 1
|
89
90
|
end
|
90
91
|
|
91
92
|
rescue LoadError
|
92
|
-
$stderr.puts %(Rails requires RubyGems >=
|
93
|
+
$stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
|
93
94
|
exit 1
|
94
95
|
end
|
95
96
|
|
data/test/config/database.yml
CHANGED
@@ -1,13 +1,9 @@
|
|
1
1
|
development:
|
2
|
-
adapter:
|
3
|
-
database:
|
4
|
-
|
5
|
-
password:
|
6
|
-
socket: /tmp/mysql.sock
|
2
|
+
adapter: sqlite3
|
3
|
+
database: db/test.sqlite3
|
4
|
+
timeout: 5000
|
7
5
|
|
8
6
|
test:
|
9
|
-
adapter:
|
10
|
-
database:
|
11
|
-
|
12
|
-
password:
|
13
|
-
socket: /tmp/mysql.sock
|
7
|
+
adapter: sqlite3
|
8
|
+
database: db/test.sqlite3
|
9
|
+
timeout: 5000
|
data/test/config/environment.rb
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
# ENV['RAILS_ENV'] ||= 'production'
|
6
6
|
|
7
7
|
# Specifies gem version of Rails to use when vendor/rails is not present
|
8
|
-
RAILS_GEM_VERSION = '2.
|
8
|
+
RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION
|
9
9
|
|
10
10
|
# Bootstrap the Rails environment, frameworks, and default configuration
|
11
11
|
require File.join(File.dirname(__FILE__), 'boot')
|
@@ -20,7 +20,7 @@ Rails::Initializer.run do |config|
|
|
20
20
|
# config.plugins = %W( exception_notification ssl_requirement )
|
21
21
|
|
22
22
|
# Add additional load paths for your own custom dirs
|
23
|
-
config.load_paths += %W( #{RAILS_ROOT}/../lib )
|
23
|
+
# config.load_paths += %W( #{RAILS_ROOT}/../lib )
|
24
24
|
|
25
25
|
# Force all environments to use the same logger level
|
26
26
|
# (by default production uses :info, the others :debug)
|
@@ -29,6 +29,8 @@ Rails::Initializer.run do |config|
|
|
29
29
|
# Use the database for sessions instead of the file system
|
30
30
|
# (create the session table with 'rake db:sessions:create')
|
31
31
|
# config.action_controller.session_store = :active_record_store
|
32
|
+
config.gem "resource_controller", :version => "10.0.0"
|
33
|
+
config.gem "thoughtbot-shoulda", :lib => "shoulda/rails", :version => "2.9.0"
|
32
34
|
|
33
35
|
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
34
36
|
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
@@ -44,6 +46,4 @@ Rails::Initializer.run do |config|
|
|
44
46
|
# See Rails::Configuration for more options
|
45
47
|
|
46
48
|
config.action_controller.session = { :session_key => "_myapp_session", :secret => "6c1372e61789239a727cdbc8252eb6da" }
|
47
|
-
|
48
|
-
config.gem 'resource_controller'
|
49
49
|
end
|
@@ -8,13 +8,9 @@ config.cache_classes = false
|
|
8
8
|
# Log error messages when you accidentally call methods on nil.
|
9
9
|
config.whiny_nils = true
|
10
10
|
|
11
|
-
# Enable the breakpoint server that script/breakpointer connects to
|
12
|
-
config.breakpoint_server = true
|
13
|
-
|
14
11
|
# Show full error reports and disable caching
|
15
12
|
config.action_controller.consider_all_requests_local = true
|
16
13
|
config.action_controller.perform_caching = false
|
17
|
-
config.action_view.cache_template_extensions = false
|
18
14
|
config.action_view.debug_rjs = true
|
19
15
|
|
20
16
|
# Don't care if the mailer can't send
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Add new inflection rules using the following format
|
4
|
+
# (all these examples are active by default):
|
5
|
+
# Inflector.inflections do |inflect|
|
6
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
7
|
+
# inflect.singular /^(ox)en/i, '\1'
|
8
|
+
# inflect.irregular 'person', 'people'
|
9
|
+
# inflect.uncountable %w( fish sheep )
|
10
|
+
# end
|
11
|
+
|
12
|
+
ActiveSupport::Inflector.inflections do |inflect|
|
13
|
+
inflect.irregular "personnel", "personnel"
|
14
|
+
end
|
data/test/config/routes.rb
CHANGED