0
我有這個在我的路線:重構的Rails 3路由
get '/boutique/new' => 'stores#new', :as => :new_store, :constraints => { :id => /[a-z0-9_-]/ }
post '/boutique' => 'stores#create', :as => :create_store, :constraints => { :id => /[a-z0-9_-]/ }
get '/:shortname' => 'stores#show', :as => :store, :constraints => { :id => /[a-z0-9_-]/ }
get '/:shortname/edit' => 'stores#edit', :as => :edit_store, :constraints => { :id => /[a-z0-9_-]/ }
put '/:shortname' => 'stores#update', :as => :update_store, :constraints => { :id => /[a-z0-9_-]/ }
delete '/:shortname' => 'stores#delete', :as => :destroy_store, :constraints => { :id => /[a-z0-9_-]/ }
有一個更清潔的方式做同樣的?它看起來沒有任何優雅,甚至更少,如果我添加更多的控制/行動。
謝謝。