views:

105

answers:

2

Hi,

I am new to ruby on rails.

I have a website with a lot of static pages. I want to add a number of dynamic pages to the website and these I am going to develop in ruby on rails. The functionality offered by these pages will be triggered when the user clicks on one of the buttons which is on one of the static pages. I am thinking that I will put the dynamic pages in a directory and one of them will be called(executed) when the button, which is on one of the static pages, is clicked. I do not need to change the content of existing static pages.

Is it possible to add such dynamic pages to existing static website? If yes, how? Do I need to change routes?

Thank you,

Akshey

+2  A: 

I would recommend that you set up the Rails app and then move all the static content to the public folder. Rails will prefer those files. Then begin to create your dynamic content with the Rails app and just link to the dynamic pages / "actions" from your static pages.

Marcel J.
+3  A: 

you have to do it the other way round - put your static pages into your rails applications 'public' folder - if a file identified by an url exists, rails will serve these file, if no file exists, rails will try to find a suitable controller/action ...

roman
And in case there are some php/python pages in addition to the static pages then also they will be preffered over rails?
Akshey
if there is some php/python you should write it in your question and not after that somebody gave you an answer
VP
I agree, I should have asked earlier. Actually as far as I know there is no php/python script but now I am thinking that I might need to add a script for some other purpose.
Akshey
Akshey: The ability to handle php/python depends on your webserver. I expect passenger to be able to handle it with out problems, but not mongrel or webbrick.
EmFi
Thanks for the reply
Akshey
follow up to EmFi: i have a few sites using rails + php / python on passenger (for example wordpress in a subfolder of public) - easy to setup, works without problems. depending on the passenger version and php/python application you might need a rewrite in your htaccess to redirect the url /myphpapp/ to /myphpapp/index.php
roman