Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Routes like Devise #15

Open
wynst opened this issue Nov 21, 2010 · 0 comments
Open

Custom Routes like Devise #15

wynst opened this issue Nov 21, 2010 · 0 comments

Comments

@wynst
Copy link

wynst commented Nov 21, 2010

I want routes like /blog/posts/1-hello-world instead of /blog_posts/hello-world.

To achieve that:

  1. Remove/comment out all routing code in vendor/plugins/blog_kit/config/routes.rb

  2. Draw custom routes like this in config/routes.rb:

    scope 'blog' do
      resources :posts, :controller => 'blog_posts', :as => 'blog_posts' do
            resources :comments, :controller => 'blog_comments', :as => 'blog_comments'
        resources :images, :controller =>'blog_images', :as => 'blog_images'
        collection do
            get :drafts
        end
    
        member do
            get :tag
        end
      end 
    end
    match 'blog' => 'blog_posts#index'
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant