Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

How to fix ActionView::Template::Error (No route matches {:action=>"new", :controller=>"posts", :post_type=>nil} when visiting the moderator page? [closed] Question

+0
−0

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".

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.
Why should this post be closed?

0 comment threads

1 answer

+2
−0

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.

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.

0 comment threads