views:

10

answers:

1

This is probably quite simple, but how can I make a params optional?

resources :places
match 'register/:id' => 'places#new', :as => :register

currently... it breaks if the :id is not passed which most of the time it won't be.

<%= link_to "Place Sign Up", register_path %> 
+1  A: 

Look at the last line of config/routes.rb

match ':controller(/:action(/:id(.:format)))'

it uses () to make a param optional, in your case:

'register(/:id)'
Casual Coder