Вы используете user_post_path(p)
, где, я думаю, p => Post Object
Но для этого маршрута также потребуется пользовательский объект, поэтому этот ресурс оценивается как a post of a user
Посмотрите на это
Там написано
In addition to using the routing helpers, Rails can also create paths and URLs from an array of parameters. For example, suppose you have this set of routes:
resources :magazines do
resources :ads
end
When using magazine_ad_path, you can pass in instances of Magazine and Ad instead of the numeric IDs.
<%= link_to "Ad details", magazine_ad_path(@magazine, @ad) %>
You can also use url_for with a set of objects, and Rails will automatically determine which route you want:
<%= link_to "Ad details", url_for([@magazine, @ad]) %>
Надеюсь, это поможет.