Changesets can be listed by changeset number.
The Git repository is here.
Changeset 385
Remove PATH_PREFIX stuff, since Apache+Passenger doesn't need it.
- Comitted by: rool
- Date: Monday March 21 14:15:29 2011 (over 13 years ago)
Affected files:
rool/rails/typo/trunk/app/controllers/articles_controller.rb (diff)
rool/rails/typo/trunk/config/environment.rb (diff)
rool/rails/typo/trunk/config/routes.rb (diff)
rool/rails/typo/trunk/app/controllers/articles_controller.rb:
prev. | current | |
private | ||
183 | | |
184 | | |
183 | def add_to_cookies(name, value) | |
184 | cookies[name] = { :value => value, :path => url_for(:controller => :articles, :action => :index, :only_path => true), | |
:expires => 6.weeks.from_now } | ||
end | ||
rool/rails/typo/trunk/config/environment.rb:
prev. | current | |
# Be sure to restart your webserver when you modify this file. | ||
3 | # Rails Gem Version | |
4 | RAILS_GEM_VERSION = '1.2.6' unless defined? RAILS_GEM_VERSION | |
5 | ||
# Uncomment below to force Rails into production mode | ||
# (Use only when you can't set environment variables through your web/app server) | ||
# ENV['RAILS_ENV'] = 'production' | ||
... | ... | |
# URLs (i.e. according to the web server configuration, not the | ||
# filesystem location). | ||
14 | ||
17 | PATH_PREFIX = '/news' # Needed by dodgy code in "vendor/plugins/typo_textfilter_lightbox/lib/typo_textfilter_lightbox.rb" | |
Rails::Initializer.run do |config| | ||
17 | | |
18 | | |
19 | | |
20 | | |
21 | ||
# Skip frameworks you're not going to use | ||
# config.frameworks -= [ :action_web_service, :action_mailer ] | ||
rool/rails/typo/trunk/config/routes.rb:
prev. | current | |
ActionController::Routing::Routes.draw do |map| | ||
# default | ||
4 | | |
5 | | |
4 | map.index '/', :controller => 'articles', :action => 'index' | |
5 | map.admin '/admin', :controller => 'admin/general', :action => 'index' | |
# admin/comments controller needs parent article id | ||
8 | | |
8 | map.connect '/admin/comments/article/:article_id/:action/:id', | |
:controller => 'admin/comments', :action => nil, :id => nil | ||
10 | | |
10 | map.connect '/admin/trackbacks/article/:article_id/:action/:id', | |
:controller => 'admin/trackbacks', :action => nil, :id => nil | ||
12 | | |
12 | map.connect '/admin/content/:action/:id', :controller => 'admin/content' | |
# make rss feed urls pretty and let them end in .xml | ||
# this improves caches_page because now apache and webrick will send out the | ||
# cached feeds with the correct xml mime type. | ||
17 | | |
18 | | |
19 | | |
20 | | |
17 | map.xml '/xml/itunes/feed.xml', :controller => 'xml', :action => 'itunes' | |
18 | map.xml '/xml/articlerss/:id/feed.xml', :controller => 'xml', :action => 'articlerss' | |
19 | map.xml '/xml/commentrss/feed.xml', :controller => 'xml', :action => 'commentrss' | |
20 | map.xml '/xml/trackbackrss/feed.xml', :controller => 'xml', :action => 'trackbackrss' | |
22 | | |
23 | | |
24 | | |
25 | | |
26 | | |
22 | map.xml '/xml/:format/feed.xml', :controller => 'xml', :action => 'feed', :type => 'feed' | |
23 | map.xml '/xml/:format/:type/feed.xml', :controller => 'xml', :action => 'feed' | |
24 | map.xml '/xml/:format/:type/:id/feed.xml', :controller => 'xml', :action => 'feed' | |
25 | map.xml '/xml/rss', :controller => 'xml', :action => 'feed', :type => 'feed', :format => 'rss' | |
26 | map.xml '/sitemap.xml', :controller => 'xml', :action => 'feed', :format => 'googlesitemap', :type => 'sitemap' | |
# allow neat perma urls | ||
29 | | |
29 | map.connect '/articles', | |
:controller => 'articles', :action => 'index' | ||
31 | | |
31 | map.connect '/articles/page/:page', | |
:controller => 'articles', :action => 'index', | ||
:page => /\d+/ | ||
35 | | |
35 | map.connect '/articles/:year/:month/:day', | |
:controller => 'articles', :action => 'find_by_date', | ||
:year => /\d{4}/, :month => /\d{1,2}/, :day => /\d{1,2}/ | ||
38 | | |
38 | map.connect '/articles/:year/:month', | |
:controller => 'articles', :action => 'find_by_date', | ||
:year => /\d{4}/, :month => /\d{1,2}/ | ||
41 | | |
41 | map.connect '/articles/:year', | |
:controller => 'articles', :action => 'find_by_date', | ||
:year => /\d{4}/ | ||
45 | | |
45 | map.connect '/articles/:year/:month/:day/page/:page', | |
:controller => 'articles', :action => 'find_by_date', | ||
:year => /\d{4}/, :month => /\d{1,2}/, :day => /\d{1,2}/, :page => /\d+/ | ||
48 | | |
48 | map.connect '/articles/:year/:month/page/:page', | |
:controller => 'articles', :action => 'find_by_date', | ||
:year => /\d{4}/, :month => /\d{1,2}/, :page => /\d+/ | ||
51 | | |
51 | map.connect '/articles/:year/page/:page', | |
:controller => 'articles', :action => 'find_by_date', | ||
:year => /\d{4}/, :page => /\d+/ | ||
55 | | |
55 | map.connect '/articles/:year/:month/:day/:title', | |
:controller => 'articles', :action => 'permalink', | ||
:year => /\d{4}/, :day => /\d{1,2}/, :month => /\d{1,2}/ | ||
59 | | |
59 | map.connect '/articles/add_comment/:id', | |
:controller => 'articles', :action => 'read_and_comment' | ||
62 | | |
62 | map.connect '/articles/category/:id', | |
:controller => 'articles', :action => 'category' | ||
64 | | |
64 | map.connect '/articles/category/:id/page/:page', | |
:controller => 'articles', :action => 'category', | ||
:page => /\d+/ | ||
68 | | |
68 | map.connect '/articles/tag/:id', | |
:controller => 'articles', :action => 'tag' | ||
70 | | |
70 | map.connect '/articles/tag/:id/page/:page', | |
:controller => 'articles', :action => 'tag', | ||
:page => /\d+/ | ||
74 | | |
74 | map.connect '/pages/*name',:controller => 'articles', :action => 'view_page' | |
76 | | |
76 | map.connect '/stylesheets/theme/:filename', | |
:controller => 'theme', :action => 'stylesheets', :filename => /.*/ | ||
78 | | |
78 | map.connect '/javascripts/theme/:filename', | |
:controller => 'theme', :action => 'javascript', :filename => /.*/ | ||
80 | | |
80 | map.connect '/images/theme/:filename', | |
:controller => 'theme', :action => 'images', :filename => /.*/ | ||
# For the tests | ||
84 | | |
84 | map.connect '/theme/static_view_test', :controller => 'theme', :action => 'static_view_test' | |
86 | | |
86 | map.connect '/plugins/filters/:filter/:public_action', | |
:controller => 'textfilter', :action => 'public_action' | ||
# Work around the Bad URI bug | ||
%w{ accounts articles backend files live sidebar textfilter xml }.each do |i| | ||
91 | | |
92 | | |
93 | | |
91 | map.connect "/#{i}", :controller => "#{i}", :action => 'index' | |
92 | map.connect "/#{i}/:action", :controller => "#{i}" | |
93 | map.connect "/#{i}/:action/:id", :controller => i, :id => nil | |
end | ||
%w{blacklist cache categories comments content feedback general pages | ||
resources sidebar textfilters themes trackbacks users}.each do |i| | ||
98 | | |
99 | | |
98 | map.connect "/admin/#{i}", :controller => "admin/#{i}", :action => 'index' | |
99 | map.connect "/admin/#{i}/:action/:id", :controller => "admin/#{i}", :action => nil, :id => nil | |
end | ||
102 | | |
103 | | |
102 | map.connect '/:controller/:action/:id' | |
103 | map.connect '/*from', :controller => 'redirect', :action => 'redirect' | |
end |