Sha256: d0ac542dd3e58c8eebb70b0a669576d3552364122db4942f877af07230479ce7

Contents?: true

Size: 1.24 KB

Versions: 11

Compression:

Stored size: 1.24 KB

Contents

module Blogo
  module Routes
    def self.mount_to(context, opts)
      blog_scope = opts[:at] || '/blogo'

      context.instance_eval do
        scope(path: blog_scope, module: 'blogo', as: 'blogo') do

          namespace :admin do
            # blogo_admin_path
            get "/" => "posts#index", as:  ""
            get "logout" => "sessions#destroy"
            get "login" => "sessions#new", as: 'login'

            post  '/posts/preview' => 'posts#preview', as: :post_preview
            patch '/posts/preview' => 'posts#preview'

            resources :sessions, only: %w(new create destroy)
            resources :posts, except: %w(show)
            resources :users
            resources 'comments', only: %w(index)
            resources 'images'  , only: %w(create)
          end

          get '/'                    => "posts#index", as: 'root'
          get '/page/:page'          => 'posts#index', as: 'page'
          get '/tag/:tag'            => 'posts#index', as: 'tag'
          get '/tag/:tag/page/:page' => 'posts#index', as: 'tag_page'
          get '/feed'                => 'posts#feed' , as: 'feed', defaults: { format: 'atom' }
          get ":permalink"           => "posts#show" , as: "post"



        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
blogo-0.1.1 lib/blogo/routes.rb
blogo-0.1.0 lib/blogo/routes.rb
blogo-0.0.10 lib/blogo/routes.rb
blogo-0.0.9 lib/blogo/routes.rb
blogo-0.0.8 lib/blogo/routes.rb
blogo-0.0.7 lib/blogo/routes.rb
blogo-0.0.6 lib/blogo/routes.rb
blogo-0.0.5 lib/blogo/routes.rb
blogo-0.0.4 lib/blogo/routes.rb
blogo-0.0.3 lib/blogo/routes.rb
blogo-0.0.2 lib/blogo/routes.rb