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 
  <% = @ ugblog.title%>
  <% = @ ugblog.subtitle%>
  <% = @ ugblog.Text%>
<% = image_tag @ ugblog.img.url,: size =>'330x330'%>
<% = 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 |%>
       <td><% = form.text_field: kome%></td></tr>
       <td><% = form.submit "Submit"%></td></tr>
    <% end%>
<p><% = @msg%></p>
class Ugsama
class Ugblog
  • Answer # 1

    <% = 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.
    That is not Ugsama, but Ugblog create. . .
    I can jump to Ugsama's create and return to the Ugblog show from there.

    Whenresources: ugsamais set in routes.rb,
    for post Since ugsama_path can be created, pass (ugblog_id: @udblog) to it.

Related articles