0

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 dot instead of the slash)

1
  • Did you try: sport_path(params[:sport], :view => 1) Commented May 3, 2012 at 23:19

1 Answer 1

1

I had another route named sport. face-palm

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.