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 7866665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:28:06+00:00 2026-06-03T00:28:06+00:00

I ‘m building a partial that will be use by different views (games and

  • 0

I ‘m building a partial that will be use by different views (games and promotions).
I’ve created a partial in view/application

<%= content_tag :article, class: ['article'] do %>
  <a href="#">
    <%= image_tag item.thumbnail %>
  </a>
  <h2><%= item.name %></h2>
  <p><%= item.description %></p>
  <p>
    <%= link_to 'Read more', "#" %>
  </p>
<% end %>

and I call it from the view games view (or promotions):

<% @games.each do |item| %>
  <section> 
      <%= render 'application/item_synopsis_builder', item: item %>
  </section>
<% end %>

It works fine to populate and render the partial, but i can’t suss out how to pass to the partial the view_path so that it is dynamically replace the temporary # with <%= the_right_path =>.

I tried to do:

<%= render partial: 'application/item_synopsis_builder', locals: {item: item, path: game_path } %>

But I just get an error message:

No route matches {:action=>"show", :controller=>"games"}

But if I render the partial with href=”#”, it renders fine.

I also tried my luck with href="<%= "#{item}_path" %>" but it just print out the ref of the object item.

Cheers

  • 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-03T00:28:08+00:00Added an answer on June 3, 2026 at 12:28 am

    I don’t know is this is your error, but it seems to me that game_path expects a game object as argument, that might be your error.

    EDIT:

    <% @games.each do |item| %>
      <section> 
        <%= render partial: 'application/item_synopsis_builder', locals:{item: item, path: game_path(item) %>
      </section>
    <% end %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a RegEx expression that will successfully parse the following
I need a function that will clean a strings' special characters. I do NOT
I've got a string that has curly quotes in it. I'd like to replace
I downloaded PostgreSQL from the official website and ran the .dmg installer. After that
I am doing a simple coin flipping experiment for class that involves flipping a
I'm trying to create an if statement in PHP that prevents a single post
Thanks in advance for your help. I have a need within an application to
I have just tried to save a simple *.rtf file with some websites and
I would like to count the length of a string with PHP. The string
I was writing code for dragging mechanism which invokes to wait for small period

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.