# هل يطلب Discourse بشكل خاطئ صيغة الجمع لكلمة route؟

**URL:** <https://meta.discourse.org/t/discourse-erroneously-requesting-plural-of-route/97962>\
**Category:** Development\
**Created:** [24 سبتمبر 2018، 7:42م UTC](https://meta.discourse.org/t/discourse-erroneously-requesting-plural-of-route/97962 "2018-09-24T19:42:06Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Kampfkarren](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kampfkarren/32/109627_2.png) [@Kampfkarren](https://meta.discourse.org/u/Kampfkarren)\
**Post date:** [24 سبتمبر 2018، 7:42م UTC](https://meta.discourse.org/t/discourse-erroneously-requesting-plural-of-route/97962/1 "2018-09-24T19:42:06Z")

</div>

In my plugin routes, I had the following (not these exact names, but hopefully the point is clear)

```plaintext
		get "/u/:username/thing" => "user_thing#index", constraints: { username: RouteFormat.username }
		get "/u/:username/thing/setup" => "user_thing#setup_index", constraints: { username: RouteFormat.username }
		post "/u/:username/thing/setup" => "user_thing#setup", constraints: { username: RouteFormat.username }

```

My route map was:

```plaintext
export default function() {
	this.route(
		'user',
		{ path: '/u/:username', resetNamespace: true},
		function() {
			this.route('thing', function() {
				this.route('setup')
			})
		}
	)
}

```

This has worked so far. Recently, I wanted to add the new routes (note: they’re aligned to root):

```plaintext
		resource :thing_foobar, path: "thing/foobar/:foobar_id"

```

(Writing these fake names is becoming difficult 😕)

Now my route map is:

```plaintext
export default function() {
   this.route(
   	'user',
   	{ path: '/u/:username', resetNamespace: true},
   	function() {
   		this.route('thing', function() {
   			this.route('setup')
   		})
   	}
   )

   this.route(
   	'thing',
   	function() {
   		this.route('redirect', { path: '/foobar/:foobar_id' })
   	}
   )
}

```

Going to mysite.tld/thing/foobar/1, I get redirected to /404

I check my network and I have the following 404:

[http://mysite.tld/foobars/1?\_=1537817415772](http://mysite.tld/foobars/1?_=1537817415772)

What? Why is it requesting a plural form of my route instead of the actual route? Is it because it’s a relative path or something? I don’t understand.

---

_[View the full topic](https://meta.discourse.org/t/discourse-erroneously-requesting-plural-of-route/97962)._
