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

Code example typos in Getting Started with Rails tutorial #11467

Closed
grammakov opened this issue Jul 17, 2013 · 6 comments
Closed

Code example typos in Getting Started with Rails tutorial #11467

grammakov opened this issue Jul 17, 2013 · 6 comments

Comments

@grammakov
Copy link

http://guides.rubyonrails.org/getting_started.html

5.12 index.html.erb code example

<td><%= link_to 'Show', post_path %></td>

throws an error

<td><%= link_to 'Show', post %></td>

works ok

5.12 edit.html.erb code example:

<%= form_for :post, url: post_path(@post.id) },

Throws an error. Should be

<%= form_for :post, url: post_path(@post.id),
@arunagw
Copy link
Member

arunagw commented Jul 17, 2013

Looking into this.

@senny
Copy link
Member

senny commented Jul 17, 2013

@arunagw I was searching already... ping me on the PR if you find something 😄

@arunagw
Copy link
Member

arunagw commented Jul 17, 2013

@senny sure. thanks

@arunagw
Copy link
Member

arunagw commented Jul 17, 2013

A PR is here for 1st case : #11473

For second I found it correct in code. I think it's some problem with generation.

<%= form_for :post, url: post_path(@post.id), method: :patch do |f| %>
  <% if @post.errors.any? %>
  <div id="error_explanation">
    <h2><%= pluralize(@post.errors.count, "error") %> prohibited
      this post from being saved:</h2>
    <ul>
    <% @post.errors.full_messages.each do |msg| %>
      <li><%= msg %></li>
    <% end %>
    </ul>
  </div>
  <% end %>
  <p>
    <%= f.label :title %><br>
    <%= f.text_field :title %>
  </p>

  <p>
    <%= f.label :text %><br>
    <%= f.text_area :text %>
  </p>

  <p>
    <%= f.submit %>
  </p>
<% end %>

@arunagw
Copy link
Member

arunagw commented Jul 17, 2013

@rafaelfranca
Copy link
Member

Both are fixed already

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

4 participants