Pergunta

I am running refinerycms 1.0.8 and rails 3.0.10. I have the following piece of code in app/views/pages/show.html.erb

<div id="startpageheader">
  <%= raw @page.content_for(:startpageheader) %>
</div>
<section id='body_content'>
  <%=raw @page.content_for(:body) %>
</section>

If I run this local in development mode, I get the following (desired) output:

<section id='page'>
  <div id="startpageheader">
    <p>...</p>
  </div>
  <section id='body_content'>
    <p>...</p>
  </section>
</section>

But as soon as I start this in production mode, I get the following:

<section id='page'>
  <section id='body_content' class='no_body_content_right'>
    <h1 id='body_content_title'>Home</h1>
    <section id='body_content_left'><div class='inner'><p>...</p></div></section>
    <section id='startpageheader'><div class='inner'><p>...</p></div></section>
  </section>
</section>

So, the page parts are shown, but in a wrong view. I tried to hunt this down in the production logs, but I ended up nowhere. Does anybody have any idea what's going wrong here?

Foi útil?

Solução

I found the problem, and, of course, it was my own fault. For whatever reason I managed it somehow to delete the first Page (Home) from the pages-menu. So, back then, I created a new one, which wasn't the actual homepage but just a normal page. When I modified the show view show.html.erb for the pages, the changes were shown, of course. But in production, the original homepage wasn't deleted and therefore changes in show.html.erb didn't show up, since the first view responds to home.html.erb. Thanks everybody who tried to help me and sorry for the stupid mistake.

Outras dicas

It looks to me like you do not have data populated in your production database.

I dont have refinery's source in front of me right now but one of the things it does is give "no_body_content_right" if the right panel doesn't have any data. It makes it pretty helpful when styling it later.

Check your page in the admin, populate the data if it's missing and let me know if that doesn't work.

You need to migrate your production database.

If you look at shared/_content_page.html.erb you can see that you get <section id='body_content' class='no_body_content_right'> ..etc. when you don't pass in sections to be yielded.

Hope this helps.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top