2
这可能很简单,但我怎样才能使params可选?rails 3路由问题
resources :places
match 'register/:id' => 'places#new', :as => :register
目前...它打破如果:id
不通过其大部分时间也不会。
<%= link_to "Place Sign Up", register_path %>
这可能很简单,但我怎样才能使params可选?rails 3路由问题
resources :places
match 'register/:id' => 'places#new', :as => :register
目前...它打破如果:id
不通过其大部分时间也不会。
<%= link_to "Place Sign Up", register_path %>
看的config/routes.rb
match ':controller(/:action(/:id(.:format)))'
它使用
()
做出PARAM可选的,你的情况
的最后一行:
'register(/:id)'