Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
IndieAisle::Application.routes.draw do
resource :cart do
member do
put 'add_subscription'
put 'remove_subscription'
get 'leave'
end
end
resource :order
match '/checkout' => 'orders#checkout'
resources :cart_items
resources :user_stories
devise_for :users, :controllers => {
:registrations => 'custom_devise/registrations',
:sessions => 'custom_devise/sessions',
} do
get '/signin' => 'devise/sessions#new'
get '/signup' => 'custom_devise/registrations#new'
get '/signout' => 'devise/sessions#destroy'
get '/users/check_username' => 'custom_devise/registrations#check_username'
end
resources :users do
resources :updates
member do
get :following, :followers
get :follow, :unfollow
end
end
match 'read/:story_id' => 'reader#read', :as => :read_story
match 'read_sample/:story_id' => 'reader#read_sample', :as => :read_story_sample
resource :payment_info
resource :connections do
member do
post 'toggle_updates'
end
end
resource :notifications do
member do
end
end
resource :profile, :controller => :profile do
member do
post 'upload'
put 'update_password'
end
end
resources :stories do
resources :story_preferences
resources :story_sellers
resources :related_products
resources :reviews do
collection do
get 'new_or_edit'
end
end
member do
get 'publish'
get 'download'
end
collection do
get 'followings'
get 'interesting'
end
end
match 'auth/facebook' => 'auth#facebook'
match 'auth/facebook/callback' => 'auth#facebook_callback'
match 'auth/twitter' => 'auth#twitter'
match 'auth/twitter/callback' => 'auth#twitter_callback'
resource :account do
member do
get 'following'
get 'followers'
get 'feed'
end
end
resource :avatar do
member do
get 'preview'
post 'crop'
end
end
resources :updates
match '/library/current' => 'user_stories#current', :as => :library_current
match '/library/previous' => 'user_stories#previous', :as => :library_previous
match '/library/to_read' => 'user_stories#to_read', :as => :library_to_read
resource :find do
root :to => 'finds#index'
match 'genre/:genre_id' => 'finds#genre', :as => :by_genre
match 'author/:range' => 'finds#author', :as => :by_author
match 'tag/:tag' => 'finds#tag', :as => :by_tag
match 'similar/:story_id' => 'finds#similar', :as => :similar_to
end
match '/terms' => 'main#terms', :as => :terms
match '/privacy' => 'main#privacy', :as => :privacy
match '/:username' => 'profiles#show', :as => :root_profile
match '/s/:slug' => 'stories#show', :as => :view_story
# The priority is based upon order of creation:
# first created -> highest priority.
# Sample of regular route:
# match 'products/:id' => 'catalog#view'
# Keep in mind you can assign values other than :controller and :action
# Sample of named route:
# match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
# This route can be invoked with purchase_url(:id => product.id)
# Sample resource route (maps HTTP verbs to controller actions automatically):
# resources :products
# Sample resource route with options:
# resources :products do
# member do
# get 'short'
# post 'toggle'
# end
#
# collection do
# get 'sold'
# end
# end
# Sample resource route with sub-resources:
# resources :products do
# resources :comments, :sales
# resource :seller
# end
# Sample resource route with more complex sub-resources
# resources :products do
# resources :comments
# resources :sales do
# get 'recent', :on => :collection
# end
# end
# Sample resource route within a namespace:
# namespace :admin do
# # Directs /admin/products/* to Admin::ProductsController
# # (app/controllers/admin/products_controller.rb)
# resources :products
# end
# You can have the root of your site routed with "root"
# just remember to delete public/index.html.
root :to => "main#index"
# See how all your routes lay out with "rake routes"
# This is a legacy wild controller route that's not recommended for RESTful applications.
# Note: This route will make all actions in every controller accessible via GET requests.
# match ':controller(/:action(/:id(.:format)))'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.