Home>
I created a comment field with rails, but it doesn't work. I don't get an error, but I can't display it well even after posting. If i have noticed, please let me know. Please.
class UgblogsController</pre>
<pre><code data-language = "show">
<p><% = notice%></p>
<% = @ user.name%>'s post
<p>
<strong>Title:</strong>
<% = @ ugblog.title%>
</p>
<p>
<strong>Subtitle:</strong>
<% = @ ugblog.subtitle%>
</p>
<p>
<strong>Body:</strong>
<% = @ ugblog.Text%>
</p>
<p>
<% = image_tag @ ugblog.img.url,: size =>'330x330'%>
</p>
<% = link_to 'fix', edit_ugblog_path (@ugblog)%>|
<% = link_to 'Go to top page', ugblogs_path%>
<% = form_for (@kome, url: {controller: 'ugblogs', action: 'show'}) do | form |%>
<tr><th>Comments</th>
<td><% = form.text_field: kome%></td></tr>
<tr><th></th>
<td><% = form.submit "Submit"%></td></tr>
</tr>
<% end%>
<p><% = @msg%></p>
class Ugsama
class Ugblog
-
Answer # 1
Related articles
- ruby on rails - comment posting function actioncontroller :: urlgenerationerror
- ruby - rails comment function display
- ruby on rails 6 - the delete function cannot be implemented well
- ruby on rails - how to implement a sort function by the value of the statistical column that aggregates the values of related
- [ruby on rails] i want to implement a follow function, but the like button is not displayed in the view
- html - i want to improve the appearance of the user name next to the comment display
- ruby - about implementation of tag function in rails
- ruby on rails - [rails] i'm implementing a search function using form_with, but i'm having trouble with the search results not b
- ruby on rails - cart function routing error cannot be resolved
- ruby on rails - i want to implement a function for administrator users to register luggage for general users in rails
- html - when link_to is used in ruby on rails, a large number of a tags are generated
- xss measures for html editing function
- html - i'm stumbling on building a rails environment! help me! !! !!
- about the phenomenon that the [id] set in rails collection_select changes on the html side
- i want to add a comment function to a post with django, but i get an error
- html - [ruby on rails] about the problem that line breaks are not reflected in the text data acquired by innertext of mechanize
- ruby on rails - i cannot save a comment on the comment posting page
- ruby - rails pagination function i want to display in alphabetical order
- ruby on rails - i want to implement a report function, but i get an actioncontroller :: urlgenerationerror
- ruby on rails - i want to implement a function (destroy action) that can delete posted messages, but i am getting an active reco
Related questions
- javascript - i am using chart kick, but the display of "loading" remains and the graph is not displayed
- javascript - how to associate columns of existing table with each other
- html - i would like to know how to calculate the average of the data
- html - i want to set the conditions to be displayed in collection_check_boxes
- ruby - passing variables using render partial
- ruby - i can't do rails routes
- javascript - i used the queryselectorall method in ajax and fired an event by clicking a record in the data list i don't want to
- ruby - how to delete cookies
- ruby - i want to get records that match multiple foreign keys from within an intermediate table
- ruby - i want to be able to see "liked posts" by the person on the rails development user detail page
<% = form_for (@kome, url: {controller: 'ugblogs', action: 'show'}) do | form |%>
1) You can receive post contents by show, but the process is not written in show. I think that this is the place where you usually get with create.
But
That is not Ugsama, but Ugblog create. . .
I can jump to Ugsama's create and return to the Ugblog show from there.
When
resources: ugsama
is set in routes.rb,for post Since ugsama_path can be created, pass (ugblog_id: @udblog) to it.