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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:10:29+00:00 2026-06-16T04:10:29+00:00

I have the following simple problem with rails. Let say I have a model

  • 0

I have the following simple problem with rails.

Let say I have a model User.
In a view, if I do:

<%= render User.all %>

The file view in views/user/_user.html.erb will be called and printed for each of the users.

How can I change this to use an specific view?
I need something like:

<%= render :data=>User.all :template=>"user/_user_2ndview.html"%>

Any help?
Thanks in advance

  • 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-16T04:10:31+00:00Added an answer on June 16, 2026 at 4:10 am

    You can use the collection option:

    <%= render :collection => User.all, :partial => "users/user2ndview", 
               :as => :user %>
    

    The view must be placed in views/users/_user2ndview

    See the Rails guides on rendering collections for more details.

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

Sidebar

Related Questions

all! I have the following problem: I have 2 simple tables. The first one,
I'm new to rails and have a simple problem. I have a rails model:
i have an problem with antlr. I have the following simple grammar: grammar bxk;
it is the problem, i can't undertand anyway. i have the following simple script
I have the following problem: I am creating a simple plugin jquery carousel, to
I have a simple model: class User < ActiveRecord::Base has_and_belongs_to_many :roles end class Role
I'm creating a simple CMS with Rails 3. In my routes.rb file I have
I have the following simple problem that I'd like to use to experiment with
This seems like a simple problem - I have the following html <div class=question
I have a simple Twitter mockup set up following rails tutorial and I'm trying

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.