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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:43:49+00:00 2026-05-25T16:43:49+00:00

We have a site where we have a backend management interface, and a frontend

  • 0

We have a site where we have a backend management interface, and a frontend that displays our information. We are using Devise to secure authentication.

The backend should allow for normal CRUD type editing of our model objects. The views and layout are also completely different than the frontend. What is the best practice for implementing this in Rails 3?

Our two approaches are:

  1. An admin view folder houses all view specific code, as well as an admin folder in the controllers folder houses all controllers that control admin specific access.
  2. A conditional logic system with one set of views and controllers, with if statements checking whether the user is in admin mode or not.

Which is more recommended, or if there is another approach we have missed, please let me know.

  • 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-25T16:43:49+00:00Added an answer on May 25, 2026 at 4:43 pm

    The first solution is better, however for these cases was created the namespaces and the best practice is to go with namespaces when you need relevant differentiation between user site and administration area. Read more about it here

    Your directory structure should look like this:

    controllers/
         |--admin/
            |--posts_controller.rb
    

    In your routes you put everything you need into admin namespace:

    namespace :admin do
      resources :posts, :comments
    end
    

    Your controllers should have an admin folder, and a controller in the admin area will look like:

    class Admin::PostsController < ApplicationController
    end
    

    You also should have an admin folder in your views, where you put the respective views:

    views/
       |--admin/
            |--posts/
                 |--index.html.erb
                 |--...
    

    You can also namespace your models, but it depends on your needs, it is good when you need to have different models with the same name. For example if you need different table for the admin users, and different table for normal users. Personally I wouldn’t use model namespacing, just in very justified cases.

    The second option I think can cause a lot of headache, you gonna be lost in the if statements, I don’t recommend that at all.

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

Sidebar

Related Questions

I have a site using a custom favicon.ico. The favicon displays as expected in
i have an asp.net-mvc site with sqlserver backend and i am using membershipprovider for
I have a backend data management console written with CakePHP that allows a user
I have a site that uses wordpress for the frontend & a Codeigniter app
For example I have site http://localhost/site In IIS I set that 404 error causes
So I have site list on certain pages that basically just have links to
I have a site I made really fast that uses floats to display different
I have a django site running with a mysql database backend. I accept fairly
I have a web site using apache httpd as the server and mysql as
I have a Rails application that right now is pretty standard: Heroku/PostgreSQL backend, users

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.