Questions tagged [named-routing]
50 questions
0
votes
2 answers
Rails, named route with regexp doesn't work
I have following problem and I can't understand why it's doesn't work:
I have routes:
get "/:id" => 'landings#show_direct', as: :direct_landing, id: /ticket-from-[a-zA-Z0-9_]+/
get "/:id" => 'landings#show_reverse', as: :reverse_landing, id:…

the-teacher
- 589
- 8
- 19
0
votes
2 answers
quick rails named routes question
In my view I specify a named route like this:
show.html.erb ->
seo_path(:id => "45")
Now in my routes I define like so:
routes.rb ->
map.seo "/pages/:id/:permalink", :controller => "pages", :action => "show"
Below is the error message I am…

Betsy
- 25
- 4
0
votes
1 answer
explicit get route is throwing an error
I defined a custom route:
match 'folio/:id' => 'posts#show', :as => :folio, :via => :get
When I run rake routes command I have:
post GET /posts/:id(.:format) posts#show
folio GET /folio/:id(.:format) posts#show
And I put link for…

lukaszkups
- 5,790
- 9
- 47
- 85
0
votes
1 answer
Multiple parameters to named route rails 3
I have the following route:
match "sports/:sport(/:view)" => 'sports#show', as:'sport_path'
How do I call sport_path(sport, view)? When I try:
sport_path(params[:sport], 1)
The resulting url is: /sports/5.1. It should be /sports/5/1 (notice the…

Tyler DeWitt
- 23,366
- 38
- 119
- 196
-1
votes
1 answer
Reverse routing in Lumen. Call Router by it's name
I have some routes defined as below:
$app->get('/user/posts', [
"as" => 'user.posts',
"uses" => 'UserController@getPosts'
]);
$app->get('/user/ads', [
"as" => 'user.ads',
"uses" =>…

Ionel Lupu
- 2,695
- 6
- 29
- 53