I think maybe one issue you might be running into, or might run into in the future, is that the post title “as is” isn’t URL safe. So let’s say you have a record in your firebase db that looks like this:
title: "This is a post",
text: "Here is some text"
If you tried navigating to
<server>/posts/This is a post the browser would change the url to
<server>/posts/This%20is%20a%20post because whitespace isn’t allowed. This obviously wouldn’t match the actual post title, which is “This is a post”. If your titles are lowercase strings with no whitespace or special characters the code that you have should work, but if not, you’ll want to make a function that takes a string like “This is a post” and converts it to something like “this_is_a_post”. Then save that to the model too (so it would have title, text, and title_id or somethign like that).
Another option is you could keep your old code where it uses
:id as the url parameter and then when creating the post record you actually set the id to “this_is_a_post” instead of letting Ember Data/firebase make the random string id automatically. So it would look like:
title: 'This is a post',
text: 'This is some text'