开发者

Adding functionality to a static website using ruby on rails

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 开发者_JAVA技巧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?


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 ...


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜