Answer the question
In order to leave comments, you need to log in
How to do the right routing?
Hi friends.
I can't figure out what the problem is.
Made impoverishment in the admin panel
namespace :admin do
resources :posts
devise_for :users
end
scope module: 'site' do
resources :posts, only: [:index, :show]
root 'main#index'
end
Rails.application.routes.draw do
# admin area
get "/admin" => "admin/main#index"
scope module: 'site' do
resources :posts, only: [:index, :show]
root 'main#index'
end
namespace :admin do
resources :posts
devise_for :users
end
end
Answer the question
In order to leave comments, you need to log in
What do you have in the create action? Redirect to posts_path ? Redirect to admin_posts_path
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question