has_many_polymorphs 2.10 → 2.11
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/CHANGELOG +2 -0
- data/Manifest +191 -56
- data/TODO +1 -0
- data/examples/hmph.rb +69 -0
- data/generators/commenting/commenting_generator.rb +94 -0
- data/generators/commenting/templates/comment.rb +33 -0
- data/generators/commenting/templates/comment_test.rb +12 -0
- data/generators/commenting/templates/commenting.rb +13 -0
- data/generators/commenting/templates/commenting_extensions.rb +30 -0
- data/generators/commenting/templates/commenting_test.rb +30 -0
- data/generators/commenting/templates/commentings.yml +23 -0
- data/generators/commenting/templates/comments.yml +13 -0
- data/generators/commenting/templates/migration.rb +28 -0
- data/generators/tagging/templates/tagging_extensions.rb +4 -8
- data/has_many_polymorphs.gemspec +19 -12
- data/lib/has_many_polymorphs.rb +3 -4
- data/lib/has_many_polymorphs/autoload.rb +4 -4
- data/lib/has_many_polymorphs/class_methods.rb +8 -8
- data/lib/has_many_polymorphs/debugging_tools.rb +2 -0
- data/lib/has_many_polymorphs/dependencies.rb +9 -4
- data/lib/has_many_polymorphs/support_methods.rb +3 -1
- data/test/fixtures/{aquatic/fish.yml → fish.yml} +0 -0
- data/test/fixtures/{aquatic/little_whale_pupils.yml → little_whale_pupils.yml} +0 -0
- data/test/fixtures/{aquatic/whales.yml → whales.yml} +0 -0
- data/test/integration/app/README +182 -0
- data/test/integration/app/Rakefile +19 -0
- data/test/integration/app/app/controllers/addresses_controller.rb +85 -0
- data/test/integration/app/app/controllers/application.rb +7 -0
- data/test/integration/app/app/controllers/sellers_controller.rb +85 -0
- data/test/integration/app/app/controllers/states_controller.rb +85 -0
- data/test/integration/app/app/controllers/users_controller.rb +85 -0
- data/test/integration/app/app/helpers/addresses_helper.rb +2 -0
- data/test/integration/app/app/helpers/application_helper.rb +3 -0
- data/test/integration/app/app/helpers/sellers_helper.rb +28 -0
- data/test/integration/app/app/helpers/states_helper.rb +2 -0
- data/test/integration/app/app/helpers/users_helper.rb +2 -0
- data/test/integration/app/app/models/address.rb +4 -0
- data/test/integration/app/app/models/citation.rb +3 -0
- data/test/integration/app/app/models/citations_item.rb +4 -0
- data/test/integration/app/app/models/seller.rb +4 -0
- data/test/integration/app/app/models/state.rb +3 -0
- data/test/integration/app/app/models/user.rb +4 -0
- data/test/integration/app/app/views/addresses/edit.html.erb +12 -0
- data/test/integration/app/app/views/addresses/index.html.erb +18 -0
- data/test/integration/app/app/views/addresses/new.html.erb +11 -0
- data/test/integration/app/app/views/addresses/show.html.erb +3 -0
- data/test/integration/app/app/views/layouts/addresses.html.erb +17 -0
- data/test/integration/app/app/views/layouts/sellers.html.erb +17 -0
- data/test/integration/app/app/views/layouts/states.html.erb +17 -0
- data/test/integration/app/app/views/layouts/users.html.erb +17 -0
- data/test/integration/app/app/views/sellers/edit.html.erb +12 -0
- data/test/integration/app/app/views/sellers/index.html.erb +20 -0
- data/test/integration/app/app/views/sellers/new.html.erb +11 -0
- data/test/integration/app/app/views/sellers/show.html.erb +3 -0
- data/test/integration/app/app/views/states/edit.html.erb +12 -0
- data/test/integration/app/app/views/states/index.html.erb +19 -0
- data/test/integration/app/app/views/states/new.html.erb +11 -0
- data/test/integration/app/app/views/states/show.html.erb +3 -0
- data/test/integration/app/app/views/users/edit.html.erb +12 -0
- data/test/integration/app/app/views/users/index.html.erb +22 -0
- data/test/integration/app/app/views/users/new.html.erb +11 -0
- data/test/integration/app/app/views/users/show.html.erb +3 -0
- data/test/integration/app/config/boot.rb +45 -0
- data/test/integration/app/config/database.yml +21 -0
- data/test/integration/app/config/environment.rb +13 -0
- data/test/integration/app/config/environments/development.rb +7 -0
- data/test/integration/app/config/environments/production.rb +18 -0
- data/test/integration/app/config/environments/test.rb +19 -0
- data/test/integration/app/config/locomotive.yml +6 -0
- data/test/integration/app/config/routes.rb +33 -0
- data/test/integration/app/config/ultrasphinx/default.base +56 -0
- data/test/integration/app/config/ultrasphinx/development.conf.canonical +155 -0
- data/test/integration/app/db/migrate/001_create_users.rb +16 -0
- data/test/integration/app/db/migrate/002_create_sellers.rb +14 -0
- data/test/integration/app/db/migrate/003_create_addresses.rb +19 -0
- data/test/integration/app/db/migrate/004_create_states.rb +12 -0
- data/test/integration/app/db/migrate/005_add_capitalization_to_seller.rb +9 -0
- data/test/integration/app/db/migrate/006_add_deleted_to_user.rb +9 -0
- data/test/integration/app/db/migrate/007_add_lat_and_long_to_address.rb +11 -0
- data/test/integration/app/db/migrate/008_create_citations.rb +12 -0
- data/test/integration/app/db/migrate/009_create_citations_items.rb +14 -0
- data/test/integration/app/db/schema.rb +144 -0
- data/test/integration/app/doc/README_FOR_APP +2 -0
- data/test/integration/app/generated_models/aquatic_fish.rb +109 -0
- data/test/integration/app/generated_models/aquatic_pupils_whale.rb +13 -0
- data/test/integration/app/generated_models/aquatic_whale.rb +42 -0
- data/test/integration/app/generated_models/beautiful_fight_relationship.rb +25 -0
- data/test/integration/app/generated_models/citation.rb +40 -0
- data/test/integration/app/generated_models/citations_item.rb +12 -0
- data/test/integration/app/generated_models/dog.rb +183 -0
- data/test/integration/app/generated_models/eaters_foodstuff.rb +13 -0
- data/test/integration/app/generated_models/frog.rb +78 -0
- data/test/integration/app/generated_models/kitten.rb +161 -0
- data/test/integration/app/generated_models/parentship.rb +14 -0
- data/test/integration/app/generated_models/person.rb +53 -0
- data/test/integration/app/generated_models/petfood.rb +125 -0
- data/test/integration/app/generated_models/polymorph_test_some_model.rb +25 -0
- data/test/integration/app/generated_models/seller.rb +30 -0
- data/test/integration/app/generated_models/tabby.rb +26 -0
- data/test/integration/app/generated_models/user.rb +34 -0
- data/test/integration/app/generated_models/wild_boar.rb +87 -0
- data/test/integration/app/generators/commenting_generator_test.rb +83 -0
- data/test/integration/app/public/404.html +30 -0
- data/test/integration/app/public/500.html +30 -0
- data/test/integration/app/public/dispatch.cgi +10 -0
- data/test/integration/app/public/dispatch.fcgi +24 -0
- data/test/integration/app/public/dispatch.rb +10 -0
- data/test/integration/app/public/favicon.ico +0 -0
- data/test/integration/app/public/images/rails.png +0 -0
- data/test/integration/app/public/index.html +277 -0
- data/test/integration/app/public/javascripts/application.js +2 -0
- data/test/integration/app/public/javascripts/controls.js +833 -0
- data/test/integration/app/public/javascripts/dragdrop.js +942 -0
- data/test/integration/app/public/javascripts/effects.js +1088 -0
- data/test/integration/app/public/javascripts/prototype.js +2515 -0
- data/test/integration/app/public/robots.txt +1 -0
- data/test/integration/app/public/stylesheets/scaffold.css +74 -0
- data/test/integration/app/script/about +3 -0
- data/test/integration/app/script/breakpointer +3 -0
- data/test/integration/app/script/console +3 -0
- data/test/integration/app/script/destroy +3 -0
- data/test/integration/app/script/generate +3 -0
- data/test/integration/app/script/performance/benchmarker +3 -0
- data/test/integration/app/script/performance/profiler +3 -0
- data/test/integration/app/script/plugin +3 -0
- data/test/integration/app/script/process/inspector +3 -0
- data/test/integration/app/script/process/reaper +3 -0
- data/test/integration/app/script/process/spawner +3 -0
- data/test/integration/app/script/runner +3 -0
- data/test/integration/app/script/server +3 -0
- data/test/integration/app/test/fixtures/addresses.yml +13 -0
- data/test/integration/app/test/fixtures/citations.yml +9 -0
- data/test/integration/app/test/fixtures/citations_items.yml +9 -0
- data/test/integration/app/test/fixtures/sellers.yml +10 -0
- data/test/integration/app/test/fixtures/states.yml +216 -0
- data/test/integration/app/test/fixtures/users.yml +11 -0
- data/test/integration/app/test/functional/addresses_controller_test.rb +57 -0
- data/test/integration/app/test/functional/sellers_controller_test.rb +57 -0
- data/test/integration/app/test/functional/states_controller_test.rb +57 -0
- data/test/integration/app/test/functional/users_controller_test.rb +57 -0
- data/test/integration/app/test/test_helper.rb +28 -0
- data/test/integration/app/test/unit/address_test.rb +10 -0
- data/test/integration/app/test/unit/citation_test.rb +10 -0
- data/test/integration/app/test/unit/citations_item_test.rb +10 -0
- data/test/integration/app/test/unit/seller_test.rb +10 -0
- data/test/integration/app/test/unit/state_test.rb +10 -0
- data/test/integration/app/test/unit/user_test.rb +10 -0
- data/test/models/aquatic/fish.rb +2 -1
- data/test/models/aquatic/whale.rb +2 -0
- data/test/setup.rb +10 -0
- data/test/test_all.rb +16 -0
- data/test/test_helper.rb +16 -12
- data/test/unit/polymorph_test.rb +35 -34
- metadata +239 -98
- metadata.gz.sig +0 -0
@@ -0,0 +1,18 @@
|
|
1
|
+
<h1>Listing addresses</h1>
|
2
|
+
|
3
|
+
<table>
|
4
|
+
<tr>
|
5
|
+
</tr>
|
6
|
+
|
7
|
+
<% for address in @addresses %>
|
8
|
+
<tr>
|
9
|
+
<td><%= link_to 'Show', address %></td>
|
10
|
+
<td><%= link_to 'Edit', edit_address_path(address) %></td>
|
11
|
+
<td><%= link_to 'Destroy', address, :confirm => 'Are you sure?', :method => :delete %></td>
|
12
|
+
</tr>
|
13
|
+
<% end %>
|
14
|
+
</table>
|
15
|
+
|
16
|
+
<br />
|
17
|
+
|
18
|
+
<%= link_to 'New address', new_address_path %>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
|
7
|
+
<title>Addresses: <%= controller.action_name %></title>
|
8
|
+
<%= stylesheet_link_tag 'scaffold' %>
|
9
|
+
</head>
|
10
|
+
<body>
|
11
|
+
|
12
|
+
<p style="color: green"><%= flash[:notice] %></p>
|
13
|
+
|
14
|
+
<%= yield %>
|
15
|
+
|
16
|
+
</body>
|
17
|
+
</html>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
|
7
|
+
<title>Sellers: <%= controller.action_name %></title>
|
8
|
+
<%= stylesheet_link_tag 'scaffold' %>
|
9
|
+
</head>
|
10
|
+
<body>
|
11
|
+
|
12
|
+
<p style="color: green"><%= flash[:notice] %></p>
|
13
|
+
|
14
|
+
<%= yield %>
|
15
|
+
|
16
|
+
</body>
|
17
|
+
</html>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
|
7
|
+
<title>States: <%= controller.action_name %></title>
|
8
|
+
<%= stylesheet_link_tag 'scaffold' %>
|
9
|
+
</head>
|
10
|
+
<body>
|
11
|
+
|
12
|
+
<p style="color: green"><%= flash[:notice] %></p>
|
13
|
+
|
14
|
+
<%= yield %>
|
15
|
+
|
16
|
+
</body>
|
17
|
+
</html>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
|
7
|
+
<title>Users: <%= controller.action_name %></title>
|
8
|
+
<%= stylesheet_link_tag 'scaffold' %>
|
9
|
+
</head>
|
10
|
+
<body>
|
11
|
+
|
12
|
+
<p style="color: green"><%= flash[:notice] %></p>
|
13
|
+
|
14
|
+
<%= yield %>
|
15
|
+
|
16
|
+
</body>
|
17
|
+
</html>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<h1>Listing sellers</h1>
|
2
|
+
|
3
|
+
<table>
|
4
|
+
<tr>
|
5
|
+
</tr>
|
6
|
+
|
7
|
+
<% for seller in @sellers %>
|
8
|
+
<tr>
|
9
|
+
<td><%= h(seller.company_name) %></td>
|
10
|
+
<td><%= h(display_address(seller)) %></td>
|
11
|
+
<td><%= link_to 'Show', seller %></td>
|
12
|
+
<td><%= link_to 'Edit', edit_seller_path(seller) %></td>
|
13
|
+
<td><%= link_to 'Destroy', seller, :confirm => 'Are you sure?', :method => :delete %></td>
|
14
|
+
</tr>
|
15
|
+
<% end %>
|
16
|
+
</table>
|
17
|
+
|
18
|
+
<br />
|
19
|
+
|
20
|
+
<%= link_to 'New seller', new_seller_path %>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<h1>Listing states</h1>
|
2
|
+
|
3
|
+
<table>
|
4
|
+
<tr>
|
5
|
+
</tr>
|
6
|
+
|
7
|
+
<% for state in @states %>
|
8
|
+
<tr>
|
9
|
+
<td><%= state.name %></td>
|
10
|
+
<td><%= link_to 'Show', state %></td>
|
11
|
+
<td><%= link_to 'Edit', edit_state_path(state) %></td>
|
12
|
+
<td><%= link_to 'Destroy', state, :confirm => 'Are you sure?', :method => :delete %></td>
|
13
|
+
</tr>
|
14
|
+
<% end %>
|
15
|
+
</table>
|
16
|
+
|
17
|
+
<br />
|
18
|
+
|
19
|
+
<%= link_to 'New state', new_state_path %>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<h1>Listing users</h1>
|
2
|
+
|
3
|
+
<table>
|
4
|
+
<tr>
|
5
|
+
</tr>
|
6
|
+
|
7
|
+
<% for user in @users %>
|
8
|
+
<tr>
|
9
|
+
<td><%= h(user.login) %></td>
|
10
|
+
<td><%= h(user.address.line_1) %></td>
|
11
|
+
<td><%= h(user.address.city) %></td>
|
12
|
+
<td><%= h(user.address.state.name) %></td>
|
13
|
+
<td><%= link_to 'Show', user %></td>
|
14
|
+
<td><%= link_to 'Edit', edit_user_path(user) %></td>
|
15
|
+
<td><%= link_to 'Destroy', user, :confirm => 'Are you sure?', :method => :delete %></td>
|
16
|
+
</tr>
|
17
|
+
<% end %>
|
18
|
+
</table>
|
19
|
+
|
20
|
+
<br />
|
21
|
+
|
22
|
+
<%= link_to 'New user', new_user_path %>
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# Don't change this file. Configuration is done in config/environment.rb and config/environments/*.rb
|
2
|
+
|
3
|
+
unless defined?(RAILS_ROOT)
|
4
|
+
root_path = File.join(File.dirname(__FILE__), '..')
|
5
|
+
|
6
|
+
unless RUBY_PLATFORM =~ /(:?mswin|mingw)/
|
7
|
+
require 'pathname'
|
8
|
+
root_path = Pathname.new(root_path).cleanpath(true).to_s
|
9
|
+
end
|
10
|
+
|
11
|
+
RAILS_ROOT = root_path
|
12
|
+
end
|
13
|
+
|
14
|
+
unless defined?(Rails::Initializer)
|
15
|
+
if File.directory?("#{RAILS_ROOT}/vendor/rails")
|
16
|
+
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
|
17
|
+
else
|
18
|
+
require 'rubygems'
|
19
|
+
|
20
|
+
environment_without_comments = IO.readlines(File.dirname(__FILE__) + '/environment.rb').reject { |l| l =~ /^#/ }.join
|
21
|
+
environment_without_comments =~ /[^#]RAILS_GEM_VERSION = '([\d.]+)'/
|
22
|
+
rails_gem_version = $1
|
23
|
+
|
24
|
+
if version = defined?(RAILS_GEM_VERSION) ? RAILS_GEM_VERSION : rails_gem_version
|
25
|
+
# Asking for 1.1.6 will give you 1.1.6.5206, if available -- makes it easier to use beta gems
|
26
|
+
rails_gem = Gem.cache.search('rails', "~>#{version}.0").sort_by { |g| g.version.version }.last
|
27
|
+
|
28
|
+
if rails_gem
|
29
|
+
gem "rails", "=#{rails_gem.version.version}"
|
30
|
+
require rails_gem.full_gem_path + '/lib/initializer'
|
31
|
+
else
|
32
|
+
STDERR.puts %(Cannot find gem for Rails ~>#{version}.0:
|
33
|
+
Install the missing gem with 'gem install -v=#{version} rails', or
|
34
|
+
change environment.rb to define RAILS_GEM_VERSION with your desired version.
|
35
|
+
)
|
36
|
+
exit 1
|
37
|
+
end
|
38
|
+
else
|
39
|
+
gem "rails"
|
40
|
+
require 'initializer'
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
Rails::Initializer.run(:set_load_path)
|
45
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
|
2
|
+
development:
|
3
|
+
adapter: mysql
|
4
|
+
host: localhost
|
5
|
+
database: hmp_development
|
6
|
+
username: root
|
7
|
+
password:
|
8
|
+
|
9
|
+
test:
|
10
|
+
adapter: mysql
|
11
|
+
host: localhost
|
12
|
+
database: hmp_test
|
13
|
+
username: root
|
14
|
+
password:
|
15
|
+
|
16
|
+
production:
|
17
|
+
adapter: mysql
|
18
|
+
host: localhost
|
19
|
+
database: hmp_production
|
20
|
+
username: root
|
21
|
+
password:
|
@@ -0,0 +1,13 @@
|
|
1
|
+
|
2
|
+
require File.join(File.dirname(__FILE__), 'boot')
|
3
|
+
|
4
|
+
Rails::Initializer.run do |config|
|
5
|
+
|
6
|
+
if config.action_controller.respond_to? :"session="
|
7
|
+
config.action_controller.session = { :session_key => "_myapp_session", :secret => "this is a super secret phrase" }
|
8
|
+
end
|
9
|
+
|
10
|
+
config.load_paths << "#{RAILS_ROOT}/app/models/person" # moduleless model path
|
11
|
+
end
|
12
|
+
|
13
|
+
# Dependencies.log_activity = true
|
@@ -0,0 +1,7 @@
|
|
1
|
+
config.cache_classes = false
|
2
|
+
config.whiny_nils = true
|
3
|
+
config.action_controller.consider_all_requests_local = true
|
4
|
+
config.action_controller.perform_caching = false
|
5
|
+
config.action_view.cache_template_extensions = false
|
6
|
+
config.action_view.debug_rjs = true
|
7
|
+
config.action_mailer.raise_delivery_errors = false
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
2
|
+
|
3
|
+
# The production environment is meant for finished, "live" apps.
|
4
|
+
# Code is not reloaded between requests
|
5
|
+
config.cache_classes = true
|
6
|
+
|
7
|
+
# Use a different logger for distributed setups
|
8
|
+
# config.logger = SyslogLogger.new
|
9
|
+
|
10
|
+
# Full error reports are disabled and caching is turned on
|
11
|
+
config.action_controller.consider_all_requests_local = false
|
12
|
+
config.action_controller.perform_caching = true
|
13
|
+
|
14
|
+
# Enable serving of images, stylesheets, and javascripts from an asset server
|
15
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
16
|
+
|
17
|
+
# Disable delivery errors, bad email addresses will be ignored
|
18
|
+
# config.action_mailer.raise_delivery_errors = false
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
2
|
+
|
3
|
+
# The test environment is used exclusively to run your application's
|
4
|
+
# test suite. You never need to work with it otherwise. Remember that
|
5
|
+
# your test database is "scratch space" for the test suite and is wiped
|
6
|
+
# and recreated between test runs. Don't rely on the data there!
|
7
|
+
config.cache_classes = true
|
8
|
+
|
9
|
+
# Log error messages when you accidentally call methods on nil.
|
10
|
+
config.whiny_nils = true
|
11
|
+
|
12
|
+
# Show full error reports and disable caching
|
13
|
+
config.action_controller.consider_all_requests_local = true
|
14
|
+
config.action_controller.perform_caching = false
|
15
|
+
|
16
|
+
# Tell ActionMailer not to deliver emails to the real world.
|
17
|
+
# The :test delivery method accumulates sent emails in the
|
18
|
+
# ActionMailer::Base.deliveries array.
|
19
|
+
config.action_mailer.delivery_method = :test
|
@@ -0,0 +1,33 @@
|
|
1
|
+
ActionController::Routing::Routes.draw do |map|
|
2
|
+
map.resources :states
|
3
|
+
|
4
|
+
map.resources :states
|
5
|
+
|
6
|
+
map.resources :addresses
|
7
|
+
|
8
|
+
map.resources :sellers
|
9
|
+
|
10
|
+
map.resources :users
|
11
|
+
|
12
|
+
# The priority is based upon order of creation: first created -> highest priority.
|
13
|
+
|
14
|
+
# Sample of regular route:
|
15
|
+
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
|
16
|
+
# Keep in mind you can assign values other than :controller and :action
|
17
|
+
|
18
|
+
# Sample of named route:
|
19
|
+
# map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
|
20
|
+
# This route can be invoked with purchase_url(:id => product.id)
|
21
|
+
|
22
|
+
# You can have the root of your site routed by hooking up ''
|
23
|
+
# -- just remember to delete public/index.html.
|
24
|
+
# map.connect '', :controller => "welcome"
|
25
|
+
|
26
|
+
# Allow downloading Web Service WSDL as a file with an extension
|
27
|
+
# instead of a file named 'wsdl'
|
28
|
+
map.connect ':controller/service.wsdl', :action => 'wsdl'
|
29
|
+
|
30
|
+
# Install the default route as the lowest priority.
|
31
|
+
map.connect ':controller/:action/:id.:format'
|
32
|
+
map.connect ':controller/:action/:id'
|
33
|
+
end
|