Forum: Ruby on Rails Multi-page blog posts

Bc536a6f92c6efa50b780f3afe863ff7?d=identicon&s=25 Fidel Viegas (Guest)
on 2013-07-28 23:32
(Received via mailing list)
Hi, everyone!

It has been a while since I posted here, given that I get to find most
of my answers on google. However, there is one particular coding
practice I am after, for which I have thought of a solution, as well as
found the exact same solution for .Net.

Basically, I am working with a blog post model, where I sometimes need
to spread a post into several pages. There are two ways I can think of.
Create a model Post with a content field, and in the content field we
add some tag that signals the page breaks, something similar to what
wordpress uses. I would then have to write some code to split the
content into several pages, and create the pagination code as well. The
second alternative is to create a post model, and a pages model. The
post model would have many pages, and the pages would belong to the post
model. I can sort of see the advantages and disadvantages of both
models, and to be honest, I would prefer the solution where I have a
post model and a page model. But, given that I want to follow best
practices, I was wondering what you guys have been using to sort this
multi-page issue.

Could someone share his experience in this area?

I look forward to hearing from you guys.

Regards,

Fidel.
Aa082c8b00a50928e5860dcd70bf2368?d=identicon&s=25 tamouse m. (tamouse_m)
on 2013-07-29 02:24
(Received via mailing list)
On Jul 28, 2013, at 4:30 PM, Fidel Viegas <rails@kazomosolutions.biz>
wrote:

> Hi, everyone!
>
> It has been a while since I posted here, given that I get to find most of my
answers on google. However, there is one particular coding practice I am after,
for which I have thought of a solution, as well as found the exact same solution
for .Net.
>
> Basically, I am working with a blog post model, where I sometimes need to spread
a post into several pages. There are two ways I can think of. Create a model 
Post
with a content field, and in the content field we add some tag that signals the
page breaks, something similar to what wordpress uses. I would then have to 
write
some code to split the content into several pages, and create the pagination 
code
as well. The second alternative is to create a post model, and a pages model. 
The
post model would have many pages, and the pages would belong to the post model. 
I
can sort of see the advantages and disadvantages of both models, and to be 
honest,
I would prefer the solution where I have a post model and a page model. But, 
given
that I want to follow best practices, I was wondering what you guys have been
using to sort this multi-page issue.

Augh, I was *just* reading something about this and cannot find it. They
followed your first style, having something like <!--more--> where you
want your page breaks in the post body.
Bc536a6f92c6efa50b780f3afe863ff7?d=identicon&s=25 Fidel Viegas (Guest)
on 2013-07-29 14:40
(Received via mailing list)
On 29-07-2013 01:22, Tamara Temple wrote:
> On Jul 28, 2013, at 4:30 PM, Fidel Viegas <rails@kazomosolutions.biz> wrote:
>
>> Hi, everyone!
>>
>> It has been a while since I posted here, given that I get to find most of my
answers on google. However, there is one particular coding practice I am after,
for which I have thought of a solution, as well as found the exact same solution
for .Net.
>>
>> Basically, I am working with a blog post model, where I sometimes need to
spread a post into several pages. There are two ways I can think of. Create a
model Post with a content field, and in the content field we add some tag that
signals the page breaks, something similar to what wordpress uses. I would then
have to write some code to split the content into several pages, and create the
pagination code as well. The second alternative is to create a post model, and a
pages model. The post model would have many pages, and the pages would belong to
the post model. I can sort of see the advantages and disadvantages of both 
models,
and to be honest, I would prefer the solution where I have a post model and a 
page
model. But, given that I want to follow best practices, I was wondering what you
guys have been using to sort this multi-page issue.
> Augh, I was *just* reading something about this and cannot find it. They
followed your first style, having something like <!--more--> where you want your
page breaks in the post body.
>
Ok, thanks! I think I will go this route than.

Regards,

Fidel.
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.