You can do that with request.subdomains inside a controller. See http://api.rubyonrails.org/classes/ActionController/Request.html#M000526
If you want to "change" your primary key (or the key used for search) try with to_param. See http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M001840 Regards. Franco Catena. On Jun 17, 12:50 pm, David Zhu <dzwestwindso...@gmail.com> wrote: > hi, > > Is there a way for me to have subdomains on my rails project? > > For example, if I create a post, i get this > URL-http://www.localhost:3000/posts/#### > (what ever number) > > How can I make the route so that it is---- title.localhost:3000/ > > title is a field of my posts. > > Is there a way to do that? OR if that's too complicated, then how do i > replace the /posts/##### with /post.title? > > THANKS! -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.