Rails 3.1和“静态"入门页数 [英] Beginner with Rails 3.1 and "static" pages
问题描述
我刚刚开始部署Rails网站.实际上,我两天前就开始在Rails上编程. 我创建了一个新项目,添加了一些宝石,等等.一切工作正常,并且我对所有工作原理都有一些基本知识.
I just started deploying a Rails website. In fact, I started programming on Rails 2 days ago. I've created a new project, added some gems, etc. Everything is working properly, and I have some basic knowledge on how all works.
问题是,我要创建的是一个简单的网站,其中包含一些板块(例如,新闻,联系人,关于,产品...).所有这些内容都是静态的.
The thing is that what I want to create is a simple website with some sections (let's say, News, Contact, About, Products...). All this content is kinda static.
但是我遇到了问题.我真的不知道该怎么做才能创建它们.例如,我想要的是类似mypage.com/products/fashionableproduct
,mypage.com/about
等,甚至是mypage.com/page/products
的东西.
But I came in a problem. I don't really know what to do in order to create them. What I want, for example, is something like mypage.com/products/fashionableproduct
, mypage.com/about
, etc, or even mypage.com/page/products
.
我考虑过创建一个Controller,然后为每个页面创建一个动作...之后,我想出了其他解决方案:脚手架.创建一个名为page
的资源,该资源具有一个title
等...
I thought about creating a Controller, then an action for each page... afterwards, I came up with other solution: scaffolding. Creating a resource called page
, that has a title
, etc...
我真的是这个主题的初学者,我想听听您的帮助. 谢谢!
I'm really a beginner on this topic, and I would like to hear your helpful voice. Thanks!
推荐答案
查看 https://github.com/Thoughtbot/high_voltage 获取Rails的静态页面.
Check out https://github.com/thoughtbot/high_voltage for static pages for Rails.
并查看 http://railscasts.com/episodes/30-pretty-page -title 用于设置页面标题.
And check out http://railscasts.com/episodes/30-pretty-page-title for setting page titles.
这篇关于Rails 3.1和“静态"入门页数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!