Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

「4. 写真アップロード機能を追加する」でドキュメントのコード例が実際のコードと異なる #22

Open
JunichiIto opened this issue Jun 19, 2018 · 0 comments

Comments

@JunichiIto
Copy link

http://railsgirls.jp/app の「4. 写真アップロード機能を追加する」では、<%= form.text_field :picture, id: :idea_picture %>を書き換えるように指示が出てきますが、Rails 5.2.0で作業を進めると、_form.html.erbは以下のような出力になり、, id: :idea_pictureが出てきません。

<%= form_with(model: idea, local: true) do |form| %>
  <% if idea.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(idea.errors.count, "error") %> prohibited this idea from being saved:</h2>

      <ul>
      <% idea.errors.full_messages.each do |message| %>
        <li><%= message %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= form.label :neme %>
    <%= form.text_field :neme %>
  </div>

  <div class="field">
    <%= form.label :description %>
    <%= form.text_area :description %>
  </div>

  <div class="field">
    <%= form.label :picture %>
    <%= form.text_field :picture %>
  </div>

  <div class="actions">
    <%= form.submit %>
  </div>
<% end %>

なので、ドキュメントのコード例をRails 5.2.0の仕様に合わせておいた方がいいと思いました。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant