I am new to ruby on rails. I started to deploy a open source
project into my website under a subdomain called 'scheduler'. But when
I point to www.mydomain.com/scheduler/ I am getting my home page when
i login through my home page I am getting page not found.
This is due to when I hit login button the /controller/action is being
pointed from the main domain i.e
www.mydomain.com/controller/action
instead of being www.mydomain.com/scheduler/controller/action
Can anyone advise me how to change the domain in the links. Also all
the images in the page are mislinked as there are referencing from the
mydomain.com instead of scheduler.
I deployed the app by copying the models, controllers, helpers, views
and the neccesary files.
From the paths you give, your using a subdirectory, not a subdomain. A
subdomain would be scheduler.mydomain.com and would have to be set up
in your DNS. It is is a separate app from the rest of the site, that
is a good way to go.
If you want to continue using a subdirectory, I think you'll need to
either edit routes.rb so the paths include "/scheduler". Or I think
you could set the value of the RAILS_ROOT constant.
Michael Slater
www.BuildingWebApps.com
www.LearningRails.com
Thanks a lot for the reply.. yes I have created a sub directory not a
subdomain (sorry for that). Can you tell me how to edit the routes.rb
to include the path (/scheduler)..or having a RAILS_ROOT constant..
Save yourself a lot of trouble and just deploy to a subdomain. This is one of those opinions that Rails has that can really bite you in the butt.
If you just simply can’t, I do have a plugin that will prepend all internally generated URLs (link_to, url_for, stylesheet_link_tag, javascript_link_tag, image_tag) stuff for you. It’s designed mainly for reverse proxying to Rails apps behind IIS, but it could work for you. i’d actually be interested to know if it does.
Thanks a lot for the adive. I would certainly deploy my app
using the sub domain. Anyway thanks for the plugin. I will try it when
I am on IIS.
Do you have any open source projects (APPS) designed using rails. I
want to look at the source code and learn Rails in much more
practical approach.. Thanks once again.