Aaron Hyde will pay $5.00 to the first person to successfully answer the question:

I'm a newbie to RoR's and I'm having fun with it. My question has to do with how to configure a RoR CMS that allows users to publish pages from the CMS to their hosted domain. I want users to be able to login to the CMS to enter their site content. When they create/update information for their site, their domain should be updated as well. NOTE: All users will share the same db tables for storing their information.

Originally, I wanted to create static pages in the users domain directory because their pages wouldn't change that often. The static pages would be cached and changed when updated. Now I'm wondering if I should allow users sites to be dynamically generated. I'm not sure which approach would be better or easier to implement.

I need to know how to setup or configure my CMS that allows a user to publish to their domain if I decide to publish flat pages to their domain. If I take the dynamic approach, I need to understand how to configure a users domain so that it logs into the database for th user and use their date and the templates that have selected for their web site.

Although I'm new to RoR, I'm not new to programming and understand a little bit about servers. It's okay if you get technical.

unfunded

Answer Aaron Hyde's question

People succeed in answering Aaron Hyde's questions 0% of the time (0 success in 2 attempts).

Counter Offer:

$6 | $7 | $8 | other:

Answers by: Rich Collins | Don Miguel de los Platanos

Don Miguel de los Platanos's Answer:

Reply by Don Miguel de los Platanos 750 days ago

You speak of a 'RoR CMS' which CMS are you referencing? Because ROR is a framework for building applications, not a CMS that you can configure out of the box to provide what you are asking for. Are you asking how you would design an application to facilitate a CMS described above?

Reply by Aaron Hyde 750 days ago

No. I have the application designed and working but i'm trying to figure out this part of the puzzle.

Reply by Don Miguel de los Platanos 750 days ago

If you go the dynamic route, your rails app would have to be associated with each virtual host you wanted to generate dynamic pages for. When the controller receives the request, it would use the rails request hash to read the domain that was requested and serve up the proper files. So in a nutshell in order to do this you would need to read host headers similarly to how a webserver would. I would go with just publishing the static files, unless your requirements somehow necessitate allowing users to have dynamic content.

I would follow movable types pattern. You have your user login to the application, create their content. It writes this content as static files to their specific directory which are then tied to their domain. Everytime they make a change, they would just a hit a build button inside the app and it writes the new files to the directory.

Reply by Aaron Hyde 750 days ago

Although I didn't have Movable Type in mind, that is the model that I have implemented because users will be pretty static. What I'm looking for is the technical information about how to read host headers(if I have to), how to configure the environment(set the directory paths for publishing or loading files) to publish content to a users domain, etc. I've looked through information about Sessions and CGI::Sessions, Files/Directories but havenot run across anything that looks like a "how to" or "tutorial" for this. That's the kind of information I'm willing to pay for.

Reply by Don Miguel de los Platanos 750 days ago

Here is a list of the Rails request variables.

http://wiki.rubyonrails.org/rails/pages/VariablesInRequestEnv

I would use request.env['HTTP_HOST']

Now as far as publishing files to a users domain. You wouldn't do this the same way you would do it staticly if you opt for the dynamic route. You wouldn't have different directories for each domain, everything will essentially be part of one monolithic application. The rails app would need to read incomming request, determine what domain was requested and serve the content related to that domain. The domain names would be associated with this rails application (virtual hosted) so you wouldn't have different directories. This is ofcourse just one approach.

Reply by Aaron Hyde 750 days ago

I'm going to stay with the static page approach at this point. Dynamic publishing maybe something down the road. One thing that has been on my mind is access priviledges to the users domain at the point of creating/updating content.