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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:49:52+00:00 2026-05-23T06:49:52+00:00

I wanted to get a general idea from other RoR coders out there as

  • 0

I wanted to get a general idea from other RoR coders out there as to the benefits of using partials if the code that the partials are pointing to are only a few lines (5-10 lines). By using Partials wouldn’t it make it more complex in terms of going to files to view what is in the partials instead of seeing what is in the file itself?

This thought came up while trying to decide whether to use partials or not in my application.html.erb under my views/layout directory. I want to produce elegant code and the structure. Thanks for all your help.

  • 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-05-23T06:49:52+00:00Added an answer on May 23, 2026 at 6:49 am

    I try to use partials whenever I feel it will clean up my code. Especially if you are re-using the code in any other section of your site. I often will put loops into partials too.

    User.all.each do |user|
      render :partial => do_stuff, :locals => {:user => user}
    end
    

    This way, if I ever need to change this, it’s easy to find, and the code is separated from my other layouts/views. It’s good to separate different features or aspects of your views into their own files. Although you will have more files, it should greatly assist you in the long run.

    If someone asks you for a hotfix, you may have a better idea of where to go to make your change.

    A great IDE also helps for navigation through your methods and whatnot. Rubymine is excellent for this.

    I hope this helped some.

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

Sidebar

Related Questions

When I wanted to get Android source code, I knew that I have to
I'm trying to understand the MVC pattern and I get the general idea that
I just wanted to get the general consensus on which is a better mode
I'm new to objective C and I just wanted to get a general clarification
Just wanted to get an idea for ways (web) developers get round the short
If I wanted to get a pilot project off the ground using Microsoft PixelSense,
If i wanted to get message for ViewData from resource file, depending on the
This is my first post here and I wanted to get some input from
I was looking at this article from 2005 and wanted to get some thoughts
I am using Http get and post methods for Http Connection I just wanted

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.