我的数据库有两个表“类别”和“文章”,
Category
id | Category
---------------------
1 Mobiles
2 Computers
--------------------
Article
id | Category | title |article
-------------------------------------
1 2 title article desc
2 1 title article desc
3 1 title ar
这里有一个html代码:
<div class="container">
<section>
<header class="date">May 2014</header>
<article>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Repellendus, dolorem, laborum non illum voluptate vitae quibusdam impedit</artic
首先,当我说标题时,我指的不是标签中的文本……我的意思是像打印时页面的页眉。
所以基本上我需要的是能够改变某些页面的标题基于什么“部分”的当前页面是describing...So它可能看起来像这样
**Header for Section 11-33-00**
Section 11-33-00 Text
...
...
<new page>
**header for section 11-33-00**
Section 11-33-00 More text
..
..
<new page>
**header for section 28-30-00
Sectio
在一个简单的博客应用程序中,用户可以阅读一篇文章并决定阅读下一篇文章,而无需再次查看文章列表,但单击next按钮,用户将转到该列表中的下一篇文章。如何做到这一点呢?我使用过with和kaminari,它们都是很棒的分页插件。
现在,在show action中,我希望有一个下一篇和前一篇文章的链接,该链接包含下一篇和上一篇文章,我该如何做
下面是要使用的简单代码示例
def show
@article = Article.find(params[:id])
end
我目前正在为我正在建立的一个网站从头开始建立一个博客,因为我的客户要求我这样做,而不是使用简单的库。每一篇文章都是一个动态创建的页面,文件名是创建日期(我已经确保解决了每天发布多篇文章的问题)。
问题是,我不知道如何制作“下一篇文章”按钮。“上一篇文章”按钮不是问题,因为我可以在创建当前文章时将它链接到最近的文章。我在这个博客的数据库中的表如下:
num - auto increment post number
date - date posted
src - page location
我可以重建的博客是完全的服务器端,只有一个博客页面,将循环通过每个帖子。我真的不想