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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:47:05+00:00 2026-06-12T23:47:05+00:00

I am trying to render a partial that displays a list of names (that

  • 0

I am trying to render a partial that displays a list of names (that I created using :resource :create) and link_to their respective pages. However, I want to implement this twice such that one list links to the show pages and the other links to their edit pages.

I would prefer to use one partial to accomplish this because they are exactly identical except for their url_path.

footer.html.erb:

<!--Show-->
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                <b class="icon-eye-open icon-white"></b>
                                <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                <%= render current_user.apps %>
                            </ul>
                        </li>

<!--Edit-->
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                <b class="icon-wrench icon-white"></b>
                                <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                <%= render current_user.apps %>
                            </ul>
                        </li>

_app.html.erb:

Show should have app and
Edit should have edit_app_path(app) for link_to‘s second argument

<li>
    <%= link_to app.name, app %>
</li>
  • 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-12T23:47:06+00:00Added an answer on June 12, 2026 at 11:47 pm

    If your partial contains only

        <li>
          <%= link_to app.name, app %>
        </li>
    

    I would suggest to write it two times as as list without css classes isn’t enough for a partial imho.

    But if you really want to use a partial you can do it with a local variable in Rails 3 way:

        <li>
            <%= link_to @app.name, @path %>
        </li>
    

    and

        <%= render "shared/apps", :collection => current_user.apps, :locals => {:path=> @app} %>
        <%= render "shared/apps", :collection => current_user.apps, :locals => {:path=> edit_app_path(app)} %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a view that displays a partial with a list of all the
I am trying to put on my homepage some link that render partial views
I am trying to render a partial inside a JSON file so that I
I'm trying to render a partial view on my master page using Html.RenderAction() in
Background I'm receiving the following error when trying to render a partial view in
i´m trying to render PDF with renderpdf grails plugin, but their documentation is very
Im trying to render emails on my site. The problem is that these emails
I've been trying to render a webpage using the Adobe Flex / Flash builder
I'm trying to use MVC2 client-side validation in a partial view that is rendered
I have a partial I am trying to load though a create.js.erb, problem is

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.