Class: ActionDispatch::Routing::Mapper

Inherits:
Object
  • Object
show all
Defined in:
lib/has_mailbox/mailboxes/routing.rb

Instance Method Summary collapse

Instance Method Details

#mailboxes_for(user_class_name, mapping = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/has_mailbox/mailboxes/routing.rb', line 5

def mailboxes_for(user_class_name,mapping = {})
   
   user_class_name = user_class_name.to_s.singularize.titleize
	
   HasMailbox::Controllers::MethodHelpers.define_methods(user_class_name,mapping) 
	
   get "/mailboxes" => "mailboxes#index", :as => "mailboxes"
get "/mailboxes/:mailbox" => "mailboxes#index", :as => "box_mailboxes"
get "/mailbox/new" => "mailboxes#new", :as => "new_mailboxes"
post "/mailbox/create" => "mailboxes#create", :as => "create_mailboxes"
post "/mailbox/update" => "mailboxes#update", :as => "update_mailboxes"
get "/mailbox/token" => "mailboxes#token", :as => "token_mailboxes"
get "/mailbox/show/:mailbox/:id" => "mailboxes#show", :as => "show_mailboxes"
			
end