Guest User

Untitled

a guest
Apr 26th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1.  
  2. name = '([\w\-\_\.\+\@]+)'
  3.  
  4. # create a new resource for the given model
  5. path '/{model}', :named => :create, :method => :post do |model|
  6. redirect( named.editor( :model => model, :name => controllers[model].create.name ) )
  7. end
  8.  
  9. # update the given resource for the given model
  10. path '/{model}/{name}', :named => :update, :action => update_and_redirect,
  11. :method => :put, :match => { :name => name }
  12.  
  13. # delete the given resource for the given model
  14. path '/{model}/{name}', :named => :delete, :action => delete
  15. :method => :delete, :match => { :name => name }
Add Comment
Please, Sign In to add comment