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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T09:05:32+00:00 2026-05-16T09:05:32+00:00

I have a problem with the understanding MVC architecture. It’s not that I don’t

  • 0

I have a problem with the understanding MVC architecture.
It’s not that I don’t know anything about MVC. Everything makes sense to me in a MVC architecture but if I want to start to develop my app in an MVC architecture I’m stuck.

Basically there are a lot ways to do what you want in the programming world but I want to do it like it was supposed to be.
So maybe there is someone who can help me out.

But here my recent problem with MVC:

I want to write my own blog in Ruby on Rails. This not a big deal I think.
I would have my models like articles, comments, user and much more. For each of them I would create a controller to manage them and all.
The problem is when it comes to the Admin-Panel. I want that an article can only created in the Admin-Panel.

So what should I do?
Should I create a Admin-Panel controller to manage all those tasks which can only accomplished in the Admin-Panel at all?
Otherwise I think it is too much for a single controller.

I want that my urls looks something like this:

For Admin-Panel tasks: example.com/admin/article/create
For Viewers: example.com/article/show

(I think restful Rails routes are looking different but I think you get what I want)

How would you accomplish this task in an MVC architecture and how should it be done?
Can you help to understand those MVC tasks much better?

Thank you 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-05-16T09:05:32+00:00Added an answer on May 16, 2026 at 9:05 am

    The two things to keep in mind when making an admin area are
    1) you can create namespaces for routes to get the /admin URLs you’re looking for and
    2) you can have controllers inherit from other descendants of ActionController

    So to make an admin area, you’d want to have RESTful resources declared in a namespace (assumes Rails 3 routes):

    # routes.rb
    resources :users
    resources :posts
    resources :pages
    
    namespace :admin do |admin|
      match '/' => 'dashboard#index'
      resources :users
      resources :posts
      resources :pages
    end
    

    The top set is the public ones and the bottom set gives you the admin routes like /admin/users/new and /admin/posts/1, etc. I’m also assuming you might want a “dashboard” so I’m setting up a route to the index method of an Admin::DashboardController

    Then you create an admin base controller that descends from ApplicationController. Use it to hold your admin area layout and your authentication filters:

    class Admin::BaseController < ApplicationController
      before_filter :require_user
      layout 'admin'
    end
    

    Now make a directory in app/controllers called “admin”. Make controllers in there as normal, but have them inherit from your base controller:

    # pages_controller.rb
    class Admin::PagesController < Admin::BaseController
      # Controller code in here
    end
    

    Make a corresponding directory in app/views for “admin” and you’re good to go — everything is namespaced out and views/controllers would behave like you think.

    You can always run “rake routes” to see all the admin routes.

    Hope that helps!

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

Sidebar

Related Questions

I think I have a problem in understanding the proper way of using MVC.
I'm having a huge problem in understanding Membership with MVC. We have in our
I'm coding some web-applications in MVC, and I have a problem with something that
The Android documentation being the mess that it is, I have big problem understanding
There are many skills a programmer could have (understanding the problem, asking good questions,
I have problem in some JavaScript that I am writing where the Switch statement
I do not have problem as such but I am quite new to Ruby.
I have a school problem but I do not understand what it actually asks.
I have a problem understanding properties. What kind of property should I write if
I have a problem in understanding how the winapi condition variables work. On the

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.