Forum: Ruby on Rails Subdomains with subdomain_fu

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ed78f6c66a6f29bd89c67eeaf4f69931?d=identicon&s=25 Petr Bobek (praethorian)
on 2009-04-04 00:33
Hi all,

I am bit stuck with subdomain_fu plugin. I want to create a new
subdomain for newcomers. e.g. newband.mysite.net


I set the tld_sizes:
SubdomainFu.tld_sizes = {:development => 0,
                         :test => 0,
                         :production => 2}

my routes.rb:

  map.resources :bands
  map.band_root '', :controller => 'bands',
          :action => 'show',
        :conditions => { :subdomain => /.+/ }


bands controller:
  def show
    @current_band = Band.find_by_subdomain(current_subdomain)
  end


I always end up with "CANT FIND THE PAGE" error.
ANy help would be most welcome.

P.
2dddec0f7717cae77ac6bceede6be5bc?d=identicon&s=25 Ram (Guest)
on 2009-04-04 10:58
(Received via mailing list)
newband.mysite.net

if thats the URL u want, then tld_size should be 1.

newband.localhost:3000

if thats the URL you're developing with, then tld_size should be 0.

tld_size = (number of dots in URL) - 1    (to put it crudely)

On Apr 4, 3:33 am, Petr Bobek <rails-mailing-l...@andreas-s.net>
Ed78f6c66a6f29bd89c67eeaf4f69931?d=identicon&s=25 Petr Bobek (praethorian)
on 2009-04-04 12:23
Thx Ram,

my production server is http://rails.mysite.com

so the example should be http://newband.rails.mysite.com   => tld_size 2
should be fine.

Could it be the problem, that I didnt flush the cache?
Or is there another problem?

Thx Petr



Ram wrote:
> newband.mysite.net
>
> if thats the URL u want, then tld_size should be 1.
>
> newband.localhost:3000
>
> if thats the URL you're developing with, then tld_size should be 0.
>
> tld_size = (number of dots in URL) - 1    (to put it crudely)
2dddec0f7717cae77ac6bceede6be5bc?d=identicon&s=25 Ram (Guest)
on 2009-04-04 13:05
(Received via mailing list)
Hi Petr,

To be very honest, I dont know whether not flushing the cache might
cause trouble here.
I just chipped in with what little i knew :).

You could check the dev/prodn log to get a better idea of whats going
on and where things get stuck. You could also disable subdomains
temporarily and make sure it IS indeed a subdomain problem in the
first place.
But most likely, the logs will be your best friends here. You will be
able to trace the problem there the best. Do let us know what you find
there. And ill chip in what I can if I can :).


On Apr 4, 3:23 pm, Petr Bobek <rails-mailing-l...@andreas-s.net>
Ed78f6c66a6f29bd89c67eeaf4f69931?d=identicon&s=25 Petr Bobek (praethorian)
on 2009-04-04 13:57
Here is the log file.

http://gist.github.com/90190
Cant see the trouble, but I might be wrong.

Thank you.
P.


>Ram wrote:
2dddec0f7717cae77ac6bceede6be5bc?d=identicon&s=25 Vinay Seshadri (Guest)
on 2009-04-04 18:04
(Received via mailing list)
The Sites controller index action seems fine.
The image show action though, seems to search for images with weird IDs
(submenu-li and account here).
You should make sure that link is correct and the required parameters
are
passed on correctly. and the route too is generated correctly.
You might also want to get this line checked. This is probably the line
throwing the page not found error. Hope that helps.

Rendering
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/templates/rescues/layout.erb
(not_found)




On Sat, Apr 4, 2009 at 5:27 PM, Petr Bobek
<rails-mailing-list@andreas-s.net
> wrote:

> >Ram wrote:
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>


--
In Sport We Trust !!!
This topic is locked and can not be replied to.