Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Mar 13th, 2018 68 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. ##Routes.rb:
  2.   map.resources :workshops,
  3.     :has_many => [:assignments, :message_boards, :chat_rooms, :workshop_profiles, :my_works, :my_desks, :emails , :users ]
  4.    
  5.   map.resources :users
  6.     :member     => { :email   => :get }
  7.  
  8.   map.resources :emails,
  9.     :collection => { :email_workshop => :get, :send_email => :post },
  10.     :member     => { :email_user     => :get }
  11.  
  12. ## Kind of URL I want to generate:
  13. /workshops/45/email_workshop
  14. /workshops/45/email_user/99
  15.  
  16. ## Although I can live with (or something similar):
  17. /workshops/45/emails/email_workshop/45
  18. /workshops/45/emails/email_user/99
  19.  
  20. ## Inside my emails controller:
  21. def email_user
  22.   user = User.find ...
  23. end
  24.  
  25. def email_workshop
  26.   workshop = Workshop.find ...
  27. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top