Groups
Groups
Sign in
Groups
Groups
merb
Conversations
About
Send feedback
Help
routes and param oddity
0 views
Skip to first unread message
Ming
unread,
Nov 6, 2009, 1:17:14 PM
11/6/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to merb
I have a route that looks like this
/countries/:ctry(/cities/:city/)(/page/:pg)
if i generate a url that looks like this
/countries/spain/cities/barcelona?page=2
param[:ctry] holds "spain"
param[:city] holds "barcelona"
param[:pg] holds nil
param[page] holds "2"
I expected
param[:pg] holds "2"
but that is not the case.
I am misunderstanding something?
TIA
Chris
unread,
Nov 6, 2009, 8:46:04 PM
11/6/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to me...@googlegroups.com
That's because you're passing page as a query string parameter instead of in the url itself.
Try /countries/spain/cities/barcelona/page/2
which would fit your defined route. Query string params don't have to be declared in the route, anyway.
2009/11/6 Ming
<
min...@gmail.com
>
Reply all
Reply to author
Forward
0 new messages