Skip to content

Commit

Permalink
readme expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
pboling committed Sep 13, 2009
1 parent 114bc32 commit 7b656ba
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
18 changes: 18 additions & 0 deletions README.rdoc
Expand Up @@ -45,6 +45,24 @@ users_path(:subdomain => false) # => /users
In this way you can rest assured that you will never misdirect your links to the
same subdomain when you meant to change it.

== Use in controllers and views

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.
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.

== Configuration

You may need to configure SubdomainFu based on your development setup. The
Expand Down
4 changes: 2 additions & 2 deletions VERSION.yml
@@ -1,4 +1,4 @@
---
:minor: 4
:patch: 1
:minor: 5
:patch: 0
:major: 0
2 changes: 1 addition & 1 deletion install.sh
@@ -1,2 +1,2 @@
# I use this to make life easier when installing and testing from source:
rm -rf subdomain-fu-*.gem && gem build subdomain-fu.gemspec && sudo gem uninstall subdomain-fu && sudo gem install subdomain-fu-0.4.1.gem --no-ri --no-rdoc
rm -rf subdomain-fu-*.gem && gem build subdomain-fu.gemspec && sudo gem uninstall subdomain-fu && sudo gem install subdomain-fu-0.5.0.gem --no-ri --no-rdoc
2 changes: 1 addition & 1 deletion subdomain-fu.gemspec
Expand Up @@ -2,7 +2,7 @@

Gem::Specification.new do |s|
s.name = %q{subdomain-fu}
s.version = "0.4.1"
s.version = "0.5.0"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Michael Bleigh"]
Expand Down

0 comments on commit 7b656ba

Please sign in to comment.