Skip to content

Commit

Permalink
Updating README a bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Bleigh committed Sep 13, 2009
1 parent fedc8c5 commit 1d457f3
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,12 @@ You have access to current_subdomain and current_domain methods.
current_subdomain - returns all subdomains.
Example for the URL http://awesome.website.stuff.example.com current_subdomain will return "awesome.website.stuff"

current_domain - returns all subdomains except for the first subdomain and the domain with TLD.
current_domain - returns all subdomains except for the subdomain, including the TLD.
Example for the URL http://awesome.website.stuff.example.com current_subdomain will return "website.stuff.example.com"

This might appear strange at first, but the original plugin in this space was account_location,
which had this behavior for current domain. Subdomain-fu did not use the same style as account_location
with current_subdomain, thus the overlap. However Subdomain-fu has created a lot of utility in its implementation of
current_subdomain, so the overlap stays!

If what you really want is just the domain, then use request.domain. The purpose of current_domain is to only strip
off the first subdomain, if any, and return what's left.
If what you really want is the entire domain, then use <tt>request.domain</tt> in
your controllers. The purpose of current_domain is to only strip off the first
subdomain, if any, and return what's left.

== Configuration

Expand Down Expand Up @@ -100,10 +96,14 @@ will default to the preferred mirror.

SubdomainFu can also work within Rails' routing for subdomain-specific routes. For instance, if you only wanted your administrative tools available in the "admin" subdomain you could add this to your routes.rb file:

map.with_options :conditions => {:subdomain => 'admin} do |admin|
map.with_options :conditions => {:subdomain => 'admin'} do |admin|
admin.resources :posts
admin.resources :users
end

In addition to specifying a string, you could also specify <tt>false</tt> to
require no subdomain (this includes mirrors that you've set up such as www)
or a regular expression to match a range of subdomains.

== Resources

Expand Down

0 comments on commit 1d457f3

Please sign in to comment.