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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:20:54+00:00 2026-06-14T06:20:54+00:00

Actually I don’t understand how to correctly handle this. I have a situation where

  • 0

Actually I don’t understand how to correctly handle this. I have a situation where news could be managed with admin/edit admin/show admin/news… and similar paths, however I want to give users a page called news/show/1, because actually my news resources are routed under “admin” namespace, how should I handle the fact that I need to bind news routes outside “admin” namespace?

Actually I have only this:

namespace :admin do
  resources :news
end

My Idea:

namespace :admin do
  resources :news
end
resources :news

Then I’ll have:

  • app/controllers/admin/news_controller.rb
  • app/controllers/news_controller.rb

Is this correct?

  • 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-06-14T06:20:55+00:00Added an answer on June 14, 2026 at 6:20 am

    Seeing your answer, I can suggest more simpler routes.

    #routes.rb
    namespace :admin do
      resources :news
    end
    
    resources :news, :only => [:show]
    

    If you want index action too, rewrite the last line as:

    resources :news, :only => [:index, :show]
    

    You won’t need the helper for news_path and news_url. You will get them already built for you.

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

Sidebar

Related Questions

I am getting this runtime error from a new project. I actually don't have
I actually don't even know how to call this :P, but... I have one
Somehow my master and my origin/master branch have diverged. I actually don't want them
Normally, you don't actually edit a file in vim. If you run vim foo
I don't know if it's actually possible to do, but I have a text
I haven't actually done this yet, and maybe I don't need to, but it
Okay, I actually don't have code as of yet because i'm just picking out
How would I add next/previous buttons to this snippet. I actually don't want the
This could be a duplicate question, but I have no idea what search terms
First of all, my apologies for the title of this question, I don't have

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.