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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T12:08:39+00:00 2026-05-21T12:08:39+00:00

I have a Reports controller and two types of users: companies and customers. Each

  • 0

I have a Reports controller and two types of users: companies and customers. Each sees dramatically different pages when they go to view their main ‘Reports’ page (i.e. what I would usually call the index).

Because these pages are different but are each respective user’s main window on reports, what is the best way to organize these in a RESTful way?

So far I have been doing something like index (for companies) and custindex (for customers). Is there a better way?

Note: these pages have more than a couple of simple differences – otherwise some simple if or case statements based on user type would have sufficed.

  • 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-21T12:08:40+00:00Added an answer on May 21, 2026 at 12:08 pm

    I would avoid touching the controller and do it in the view with partials:

    #in app/views/users/index.html.erb
    <common html, if any>
    <%= render :partial => @user.kind #or whatever method you use to distinguis between them %>
    <more common html, if any>
    

    Now you just need a “_customer.html.erb” and a “_company.html.erb” partial in that folder.

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

Sidebar

Related Questions

I have two actions in a controller: public ActionResult ReportRequest() { return View(); }
I have a controller with two different actions, but both need this same code,
To set the scene I have: A Tab View Controller with 2 tabs Each
I have a Reports controller and various reports: http://localhost/reports/main/this_month http://localhost/reports/main/last_month http://localhost/reports/main/this_year I wanted http://localhost
I have a controller named Raportare that has two actions: ReportA and ReportB .
I have a route like routes.MapRoute( Reports, // Route name. reports/{controller}/{action}/{id}/{start}/{end}, // URL with
I have two models I am working with Events and Reports. Reports and embedded
I have a controller that generates HTML, XML, and CSV reports. The queries used
I have a controller (Spring-MVC) that generates a PDF report on a get request.
The Situation (Ignore this it is boring): I have reports that I created using

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.