How to fix ActionView::Template::Error (No route matches {:action=>"new", :controller=>"posts", :post_type=>nil} when visiting the moderator page? [closed] Question
Closed as not constructive by Trilarion on Jan 13, 2022 at 21:33
This question cannot be answered in a way that is helpful to anyone. It's not possible to learn something from possible answers, except for the solution for the specific problem of the asker.
This question was closed; new answers can no longer be added. Users with the reopen privilege may vote to reopen this question if it has been improved or closed incorrectly.
In a fresh development instance I went to http://localhost:3000/mod
and got a 500 Server Error related to
ActionView::Template::Error (No route matches {:action=>"new", :controller=>"posts", :post_type=>nil}, possible unmatched constraints: [:post_type]):
34: <div class="widget">
35: <div class="widget--body">
36: <i class="fas fa-file-alt"></i>
37: <%= link_to 'Create Help Page', new_post_path(post_type: HelpDoc.post_type_id) %>
38: </div>
39: </div>
40: </div>
app/views/moderator/index.html.erb:37:in `_app_views_moderator_index_html_erb___3348426895881517021_62660'
How can I fix this?
It might be related to How can I add post types to a category?
P.S.: I redid the setup of QPixel and this error is not reproducible even though the db:seed error still is. Will close as "not constructive".
1 answer
This is related to your other problem - it's the same root cause. Without any post types in the database, there aren't any to add to the categories, and the help and policy post types don't exist to make this link work.
0 comment threads