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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T04:12:11+00:00 2026-05-11T04:12:11+00:00

I am writing an app which – similarly to many apps out there –

  • 0

I am writing an app which – similarly to many apps out there – is 90% regular CRUD things and 10% ‘juice’, where we need nasty business logic and more flexibility and customization.

Regarding this 90%, I was trying to stick to the DRY principle as much as I can. As long as controllers go, I have found resource_controller to really work, and I could get rid of all the controllers on that area, replacing them with a generic one.

Now I’d like to know how to get the same with the views. On this app I have an overall, application.html.erb layout and then I must have another layout layer, common for all CRUD views and finally a ‘core’ part:

  • On index.html.erb all I need to generate a simple table with the fields and labels I indicate.

  • For new and edit, also generic form edition, indicating labels and fields (with a possibility of providing custom fields if needed).

  • I am not sure I will need show, but if I do it would be the same as new and edit.

What plugins and tools (or even articles and general pointer) would help me to get that done?

Thanks, Felipe.

  • 1 1 Answer
  • 5 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. 2026-05-11T04:12:12+00:00Added an answer on May 11, 2026 at 4:12 am

    If you have DRYed up the controllers and now wish to DRY the views, one approach is to render :action => *actionname* and storing the UI contents that may change into instance variables (So that they are available on the view) This way you would be able to re-use the same view of edit, new, list or show. For example, You are editing something related to Foo then you title should read Editing <%= @type %>, so should your form helpers. Foo could well then change to bar. Thus you are re-using the same view for different entities (or controllers should I say). Remember that, Unlike redirect_to, render :action only renders the view and does not call the controller action of the action it is trying to render.

    One thing for sure, if you wish to DRY up anything, you need to standardize or follow a convention. Example, the structure of your views, in this case.

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

Sidebar

Related Questions

I'm writing an app which needs to send many emails and creates many user
I'm writing android app which uses lazy load pattern. I need to download content
I'm writing an app which involves arithmetic with humongous numbers, with very many digits.
I'm writing an app which allows users to send out a text-only email to
I'm writing an Android app which receives data from a server. Theoretical there could
I am writing a small app which I need to test with utf-8 characters
I'm writing an app in which there will be user defined categories which will
I'm writing an app which plays host to a series of plug-ins. Those plug-ins
I am writing an app which needs to have both the traditional form of
I am writing an app which is going to be displaying images found on

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.