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

  • SEARCH
  • Home
  • 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 8627891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:23:48+00:00 2026-06-12T08:23:48+00:00

I have a model Submissions which has many Performers. I have a partial for

  • 0

I have a model Submissions which has many Performers. I have a partial for showing an individual submissions (app/views/submissions/_submission.html.erb):

<div>
  Show stuff relating to @submission
  ...
  <%= render @performers %>
</div>  

and a partial for showing performers (app/views/performers/_performer.html.erb):

<%= div_for performer do %>
  <%= performer.name %>
<% end %>

This works fine from (app/views/submissions/show.html.erb):

<%= render @submission %>

But I want to use this from a different namespace too (app/views/curator/submissions/show.html.erb). But I get this error:

Missing partial curator/submissions/submission with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee]}. Searched in:
  * "/Users/ircmullaney/RubyCode/cif/app/views"
  * "/Users/ircmullaney/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/devise-2.1.2/app/views"

I can fix this by changing the render to this:

<%= render 'submissions/submission' %>

But, then the nested partial fails:

Missing partial curator/performers/performer with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee]}. Searched in:
  * "/Users/ircmullaney/RubyCode/cif/app/views"
  * "/Users/ircmullaney/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/devise-2.1.2/app/views"

This doesn’t work:

<%= render 'performers/performer' %>

because of the div_for:

undefined method `model_name' for NilClass:Class

Any ideas how I should do this?

UPDATE: In addition to the change that iouri suggested, I added this to my performer partial:

<% @performers.each do |performer| %>
  <%= div_for performer do %>
    <%= performer.name %>
  <% end %>
<% end %>
  • 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-12T08:23:50+00:00Added an answer on June 12, 2026 at 8:23 am

    You can move them into a separate folder under views, called partials for examples, then reference them from there in both places, you will need to pass your object to the partial:

    <%= render 'partials/performer', :locals => {:performer => @performer} %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have model with a location, which itself has a latitude and longitude. What
I have model Foo which has field bar. The bar field should be unique,
I have a User model and a Submission model. Each Submission has a ForeignKey
I have model Article it has field title with some text that may contain
I have the field 'submission' which has a user and a problem. How can
I have an model (CustInfo), which contains 3 attributes: cust_name, age, gender. In my
I have got a form which is generated by model object. <%= form_for(@pages) do
I have a complex view model which contains a collection of other objects which
I found this thread which basically has the same issue I have. But their
I have model public class UploadOptionModel { public UploadOptionModel() { OutputFormat = outputFormatList.Select(i =>

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.