Loganathan Sellapa
2012-Dec-06 09:18 UTC
How to allow the user to user their own domain name
HI All, I am currently having feature where my users to have a subdomain for their account like xxx.myaddress.com,yyy.myaddress.com these will point to the corresponding users . How can I implement the feature where user can enter their own domain name instead of sub domain? regards, Loganathan Mob: +91 7760780741 | +91 9944414388 Skype: loganathan.sellappa ViewMe <http://vizualize.me/loganathan> -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On 6 December 2012 09:18, Loganathan Sellapa <loganathan.ms-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> HI All, > > I am currently having feature where my users to have a subdomain for their > account like xxx.myaddress.com,yyy.myaddress.com these will point to the > corresponding users . > > How can I implement the feature where user can enter their own domain name > instead of sub domain?Can you give an example of what you mean? Colin -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Loganathan Sellapa
2012-Dec-06 10:12 UTC
Re: How to allow the user to user their own domain name
Please have a look on to the www.shopify.com, where each user can create a store with unique domain(subdomain) name like "www.logan.shopify.com". Currently I creating the same kind of application but I need an extra feature where user can choose their own domain name while store registration process like "www.logan.com" instead of "www.logan.shopify.com<http://www.loganathan.shopify.com>". The thing is user can point their store with their own domain(can be registered with any providers like Godaddy,Dreamhost) instead of subdomain. regards, Loganathan Mob: +91 7760780741 | +91 9944414388 Skype: loganathan.sellappa ViewMe <http://vizualize.me/loganathan> On Thu, Dec 6, 2012 at 3:31 PM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 6 December 2012 09:18, Loganathan Sellapa <loganathan.ms-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > HI All, > > > > I am currently having feature where my users to have a subdomain for > their > > account like xxx.myaddress.com,yyy.myaddress.com these will point to > the > > corresponding users . > > > > How can I implement the feature where user can enter their own domain > name > > instead of sub domain? > > Can you give an example of what you mean? > > Colin > > -- > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit https://groups.google.com/groups/opt_out. > > >-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On 6 December 2012 10:12, Loganathan Sellapa <loganathan.ms-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Please have a look on to the www.shopify.com, where each user can create a > store with unique domain(subdomain) name like "www.logan.shopify.com". > > Currently I creating the same kind of application but I need an extra > feature where user can choose their own domain name while store registration > process like "www.logan.com" instead of "www.logan.shopify.com". The thing > is user can point their store with their own domain(can be registered with > any providers like Godaddy,Dreamhost) instead of subdomain.How to do that depends on your hosting setup. It can''t be done from within the rails app (as far as I know). Colin> > regards, > Loganathan > Mob: +91 7760780741 | +91 9944414388 > Skype: loganathan.sellappa > ViewMe > > > > > On Thu, Dec 6, 2012 at 3:31 PM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: >> >> On 6 December 2012 09:18, Loganathan Sellapa <loganathan.ms-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> wrote: >> > HI All, >> > >> > I am currently having feature where my users to have a subdomain for >> > their >> > account like xxx.myaddress.com,yyy.myaddress.com these will point to >> > the >> > corresponding users . >> > >> > How can I implement the feature where user can enter their own domain >> > name >> > instead of sub domain? >> >> Can you give an example of what you mean? >> >> Colin >> >> -- >> 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> For more options, visit https://groups.google.com/groups/opt_out. >> >> > > -- > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit https://groups.google.com/groups/opt_out. > >-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Walter Lee Davis
2012-Dec-06 13:54 UTC
Re: How to allow the user to user their own domain name
On Dec 6, 2012, at 5:12 AM, Loganathan Sellapa wrote:> Please have a look on to the www.shopify.com, where each user can create a store with unique domain(subdomain) name like "www.logan.shopify.com". > > Currently I creating the same kind of application but I need an extra feature where user can choose their own domain name while store registration process like "www.logan.com" instead of "www.logan.shopify.com". The thing is user can point their store with their own domain(can be registered with any providers like Godaddy,Dreamhost) instead of subdomain.Google the term ''wildcard subdomain''. I haven''t tried to set this up myself, but that''s what it''s called. You''d set that up at the DNS+Apache layer, with all subdomains pointed at a single Rails application. There are multi-tenancy examples in Rails that follow this structure, I believe. There''s a recipe in Rails Composer for it, you might want to check that out. Walter> > regards, > Loganathan > Mob: +91 7760780741 | +91 9944414388 > Skype: loganathan.sellappa > ViewMe > > > > > On Thu, Dec 6, 2012 at 3:31 PM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > On 6 December 2012 09:18, Loganathan Sellapa <loganathan.ms-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > HI All, > > > > I am currently having feature where my users to have a subdomain for their > > account like xxx.myaddress.com,yyy.myaddress.com these will point to the > > corresponding users . > > > > How can I implement the feature where user can enter their own domain name > > instead of sub domain? > > Can you give an example of what you mean? > > Colin > > -- > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > > > -- > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > >-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Hi Loganathan, On Thursday, December 6, 2012 4:12:22 AM UTC-6, Loganathan Sellappa wrote:> > Please have a look on to the www.shopify.com, where each user can create > a store with unique domain(subdomain) name like "www.logan.shopify.com". >This is the stereotypical Rails approach to multi-tenancy. The database contains, in the case of Shopify, the products of many stores (logan is a store). The key to multi-tenant apps is to ensure that all requests are scoped to a specific store. In order to accomplish this in a Rails app a before_filter is used in application_controller.rb. It typically looks like this. def current_store @current_store ||= Store.where("subdomain = ?", request.subdomains.last) end The request to retrieve products (current_store.products) will retrieve only those records that belong to the correct (per the url) store.> > Currently I creating the same kind of application but I need an extra > feature where user can choose their own domain name while store > registration process like "www.logan.com" instead of " > www.logan.shopify.com <http://www.loganathan.shopify.com>". The thing is > user can point their store with their own domain(can be registered with > any providers like Godaddy,Dreamhost) instead of subdomain. >I''m assuming that you mean you want the user to be able to choose to use one or the other. You''ll probably get more readable code by adding a domain field to the stores table and have it default to your app''s domain. The current_store method could end up looking something like... def current_store unless @current_store if request.domain == ''shopify.com'' @current_store = Store.where("subdomain = ?", request.subdomains.last) else @current_store = Store.where("domain = ?", request.domain) end end @current_store end HTH, Bill -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/2P-d4PGdgp4J. For more options, visit https://groups.google.com/groups/opt_out.
Satish Kota
2012-Dec-13 17:05 UTC
RE: [Bangalore RUG] How to allow the user to user their own domain name
You can use the concept of request.subdomain to identify xxx and yyy and get those details… In case of main domain names, ensure they have put a pointer to a particular subdomain… which you can identify and execute it… For ex… www.mydomain.com à points to à http://mydomain.youraddress.com Thanks and Regards Satish N Kota Director, Heurion Creator, TestimonialsFor @phone: +91 98862 03255 @testifor: <http://www.testifor.com/satishnkota> http://www.testifor.com/satishnkota www.testifor.com – What others say, Matters!!! From: bangalorerug-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org [mailto:bangalorerug-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of Loganathan Sellapa Sent: Thursday, December 06, 2012 2:48 PM To: Rails; bangalorerug-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Subject: [Bangalore RUG] How to allow the user to user their own domain name HI All, I am currently having feature where my users to have a subdomain for their account like xxx.myaddress.com,yyy.myaddress.com these will point to the corresponding users . How can I implement the feature where user can enter their own domain name instead of sub domain? regards, Loganathan Mob: +91 7760780741 | +91 9944414388 Skype: loganathan.sellappa ViewMe <http://vizualize.me/loganathan> -- -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.