> My question is:different registered users have different domains,but
> these different domains use the same controller and actions to access
> their common and customized contents.How do i manage this? use the
> rails route to deploy? but how to deploy? In addition,do i have to do
> somthing with the server setting?Thank you for your help.
Use the domain to lookup the account model and base everything off
that. For example:
class ApplicationController < ActionController::Base
before_filter :set_application
private
def set_application
@application = Application.find_by_domain(request.domain)
end
end
class ArticlesController < ApplicationController
def index
@articles = @application.articles
end
def show
@article = @application.articles.find(params[:id])
end
end
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---