Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8753061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:21:16+00:00 2026-06-13T13:21:16+00:00

I have a page which renders several partials; on my local mac everything is

  • 0

I have a page which renders several partials; on my local mac everything is fine but after I push to heroku and visit the page the order of the partials is different!

I render partials with the code below and thought I controlled the order with a file naming convention.

html.erb:

<% Dir["app/views/partials/ws/*.html.erb"].each do |ws| %>
<%= render 'partials/ws/' + File.basename(ws,'.html.erb').slice(1..-1) %>
<% end %>

The partials use a naming convention:

_ws_01-why.html.erb
_ws_02-what.html.erb
_ws_03-who.html.erb
_ws_04-where.html.erb
_ws_05-when1.html.erb
_ws_06-how.html.erb

Heroku renders in this order:

_ws_01-why.html.erb
_ws_02-what.html.erb
_ws_06-how.html.erb
_ws_04-where.html.erb
_ws_05-when1.html.erb
_ws_03-who.html.erb

I’m not sure how heroku is interpreting the naming convention / ruby loop order… Wondering if there is a better naming convection or logic to add in my loop to control the order?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T13:21:17+00:00Added an answer on June 13, 2026 at 1:21 pm

    Change this:

    <% Dir["app/views/partials/ws/*.html.erb"].each do |ws| %>
    

    to this:

    <% Dir["app/views/partials/ws/*.html.erb"].sort.each do |ws| %>
    

    You cannot be sure than an enumerator will choose the same order in all cases unless you force it somehow.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page which contains a html.RenderPartial, that renders an ASP.NET MVC partial
In ExtJs we have a page load event named Ext.onReady() which is called after
I have a dynamic page (say myFlashContainer.jsp) which renders different Flash content based on
I have a partial view which renders a table. On page load, I am
I have a single template file which renders pages that look very similar, but
I have a simple html page which renders with a number of nearly identical
I have this htmls on a page which renders a photo album. As you
I have a haml page which renders without the css that I am trying
I have page which is redirected from htaccess. now I can pass the German
I have a page which loads and then I do some JQuery upon it.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.