Skip to content

Instantly share code, notes, and snippets.

@ppworks
Created August 7, 2012 13:37
Show Gist options
  • Save ppworks/3285413 to your computer and use it in GitHub Desktop.
Save ppworks/3285413 to your computer and use it in GitHub Desktop.
routes.rb
search_reservation_departure GET /reservation/departure(.:format) departures#search {:destination=>/\w+/}
reservation_departure GET /reservation/departure(.:format) departures#show
search_reservation_arrival GET /reservation/arrival(.:format) arrivals#search {:source=>/\w+/}
reservation_arrival GET /reservation/arrival(.:format) arrivals#show
new_reservation GET /reservation/new(.:format) reservations#new
resource :reservation, :only => [:new] do
resource :departure, :only => [:show] do # 検索の選択画面はここのshow
collection do
get :search, :destination => /\w+/, :path => '' # 検索結果はこっち。
end
end
resource :arrival, :only => [:show] do
collection do
get :search, :source => /\w+/, :path => ''
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment