3

I am trying to use the acts_as_commentable GEM to add comments to my Post Model. I am using ABC as namespace, so all my controller and models named as ABC::Post, ABC::User, etc.

Currently my routing setup is as following.

namespace :abc do
  resources :post do 
    resources :comments
  end
end

The routing URL generated is

POST   /abc/post/:id/comments(.:format)          abc/comments#create

How can i make it to

POST   /abc/post/:id/comments(.:format)         /comments#create

1 Answer 1

3

founded the answer

namespace :abc do
    resources :post do 
        resources :comments, controller: '/comments'
  end
end
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.