What’s the best way to do this in ROR.
Must I made for every post a seperate layout which will contain the image of the page if there is a image on that page or is there a better way.
It sounds like you could use a WYSIWYG or "rich text" editor in your form, so you could create HTML for your content area. I have used the CK Editor in the past (there's several Rails gems for it) to do just this. It includes an asset upload system, so you could upload a photo and "place" it in your layout. That of course requires a whole other MVC to manage, but the gem includes rake tasks to build that out for you.
Forget the examples; if you can't *describe* the outcome you want,
you can't program it.
Create a static web page with markup that demonstrates your result.
Then think about how you would create that page programmatically.
Hint: Is the image tag inserted at a random point? Or is it perhaps
inserted between paragraphs of the text? After a certain number of
characters/words?
If the location differs from post to post, then it would seem that the
image source and location within the text are both attributes of that
post, yes?
I'm not sure I understand the question. But if you want to e.g. have
a picture between paragraphs 2 and 3, just write a helper method to
split the text there. Then your view looks like
Possibly you should learn a bit more about html, css and probably
javascript. Once you understand more about how web pages function
then you can move on to RoR.