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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:58:50+00:00 2026-06-09T18:58:50+00:00

Currently I am working on a blog engine in RoR and I encounter severa

  • 0

Currently I am working on a blog engine in RoR and I encounter severa issues with routing.
The routes.rb looks like this:

match '/admin', :to => 'posts#new'
match '/get/:id', :to => 'posts#get'
match '/new', :to => 'posts#new'
delete '/:id', :to => 'posts#destroy'
post '/edit/:id', :to => 'posts#update'
put '/edit/:id', :to => 'posts#update'
get '/edit/:id', :to => 'posts#new', :as => 'post'
get '/:slug', :to => 'posts#show', :as => 'post'
root :to => 'posts#index'

and I would like to transform it in something like:

resources :admin do
  resources :posts
end

Any help would be very appreciated.

  • 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-09T18:58:52+00:00Added an answer on June 9, 2026 at 6:58 pm

    A bit more information is needed. What do you want to place in the admin resource? Only posting, or also editing?

    But a few tips to get started:
    – You have to split your posts-controller. Make a subfolder in the controllers called admin (the resource name). Move the admin-functions to this controller, and leave the public posts-function (index and show) in the normal posts_controller.
    – Do the same for the views.

    And, i suspect you want the routes to be:

    namespace :admin
      resources :posts
    end
    
    get '/:id', :to => 'posts#show'
    
    root :to => 'posts#index'
    

    Then you can put some form of authentication to the admin namespace.

    Hope this helps you on the way.

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

Sidebar

Related Questions

Currently working on the Squarespace.com platform and I'd like to re-sort a dynamic Blog
I am currently working on a Wordpress blog installation. Problem i am facing is
I am currently working on a small sponsorship application(PHP/MySql) for my personal blog, and
I'm currently using this code to get the number of subscribers to my blog:
I am currently working on my Wordpress blog, which is hosted on a VPS.NET
In the blog I'm working on currently whenever an user posts a comment for
I am working on the routing or uri's in my PHP app. Currently I
I'm currently working on a blog application in ASP.NET MVC. I can't quite figure
I'm currently working on a blog for a college news organization. Each post, though,
I'm currently working on creating my own blog section.. After brainstorming a little while

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.