ActionView :: MissingTemplate in Posts # new
I want to call a template for an input form.
An error will occur if there is no template.
No syntax error has occurred and
I'm also creating an empty instance.
(new.html.erb) <h2>Add New Post</h2> <% = render 'form'%>
(_ form.html.erb) <% = form_for @post do | f |%> ...
(new.html.erb) <h2>Add New Post</h2> <% = form_for: post, url: posts_path do | f |%> <p> <% = f.text_field: title, placeholder: 'enter title'%> <% end%> </p> <p> <% = f.text_area: body, placeholder: 'enter body text'%> <% end%> </p> <p> <% = f.submit%> </p> <% end%>
Also includes routes and controller
Rails.application.routes.draw do resources: posts end
class PostsController<ApplicationController ... def new @post = Post.new end ...
Please give me a professor
Answer # 1
↑ It was an extension naming mistake.
Answer # 2
I don't understand the cause well
<% = render partial:'form'%>
<% = render'posts/form'%>should work ...
- ruby - partial template is not displayed (rails)
- [ruby on rails] i want to know the location of the html file that is installed for domain authentication
- html - i want to display database articles in rails (beginner)
- html - about rails routing
- html - each statement in rails erb is not displayed well
- html - routing error rails
- html - when rails nest is repeated multiple times, i want to specify the action path with link_to
- html - how to prevent users who do not belong to the rails group from transitioning to the message screen
- html - [rails] i want to write a complicated url that should be written with link_to with
- html - i want to apply reqired to the checkbox of rails
- html - the reason why name and id are automatically generated when rails file_field is used
- html - ruby on rails ｜i don't know the solution to argumenterror that appears when i edit a post｜
- ruby - rails partial template description
- html - [rails] i want to change the view to reflect depending on the device to browse
- html - when link_to is used in ruby on rails, a large number of a tags are generated
- html - i want to display the usernames of people who like rails
- html - rails new post gets overwritten
- postgresql - the app is not displayed on rails, aws actionview :: template :: error (webpacker can't find application
- html - rails image is not displayed
- html - i want to assign a variable to the url
- html - data cannot be acquired or displayed with parameters
- html - i want to edit and update from the edit screen
- html - css reflected only on iphone (i want to unify)
- html - i want to fix a routing error
- html - i want to display the information of the associated model in view
- html - i want to get multiple values from the active hash from the pull-down menu
- html - i want to display the posted prototype using collection
- html - i want to display the view, but i get an error screen
- html - obtained information from params and displayed it on the details screen