Skip to content

Instantly share code, notes, and snippets.

@theDazzler
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theDazzler/ce0b212bcaa96610b9c0 to your computer and use it in GitHub Desktop.
Save theDazzler/ce0b212bcaa96610b9c0 to your computer and use it in GitHub Desktop.
I want the URL to be /appointments/review/HSGy56GJS67 where the last part is a unique token that identifies the review
routes file
resources :appointments do
collection do
get 'review/:review_token', :to => 'appointments#review_appointments'
end
end
rake routes(first column is blank, there is no path for some reason like 'reviews_appointments')
GET /appointments/review/:review_token(.:format) appointments#review_appointments
html
<%= link_to "Rate your appointment", controller: "appointments", action: "review", review_token: @appointment.review_token %>
error
No route matches {:controller=>"appointments", :action=>"review", :review_token=>"IZ9ubwXxFLrFRsmwKYjKCQ"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment