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

Removed unnecessary words from Getting Started docs #37946

Merged
merged 1 commit into from
Mar 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 8 additions & 9 deletions guides/source/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ error:
![Another routing error, uninitialized constant ArticlesController](images/getting_started/routing_error_no_controller.png)

This error occurs because the route needs to have a controller defined in order
to serve the request. The solution to this particular problem is simple: create
to serve the request. The solution to this particular problem is to create
kaspth marked this conversation as resolved.
Show resolved Hide resolved
a controller called `ArticlesController`. You can do this by running this
command:

Expand All @@ -416,7 +416,7 @@ class ArticlesController < ApplicationController
end
```

A controller is simply a class that is defined to inherit from
A controller is a class that is defined to inherit from
`ApplicationController`.
It's inside this class that you'll define methods that will become the actions
for this controller. These actions will perform CRUD operations on the articles
Expand Down Expand Up @@ -525,7 +525,6 @@ method called `form_with`. To use this method, add this code into
```

If you refresh the page now, you'll see the exact same form from our example above.
Building forms in Rails is really just that easy!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it make more sense to keep this as "Building forms in Rails is really easy!" I've seen how other technologies are used to build forms and I can guarantee you that it's definitely a lot easier to build forms in Rails than in any other framework out there. We could even say that "Building forms in Rails is fast and straightforward".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not easy if you have never done any programming before and the audience of a Getting Started page is more likely to be new programmers than seasoned switchers from another framework. ref: https://justsimply.dev

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would be more precise to say that it needs less typing. A lot of the Magic of Rails™️ amounts to not having to type 500 characters where 50 would do.


When you call `form_with`, you pass it an identifying scope for this
form. In this case, it's the symbol `:article`. This tells the `form_with`
Expand Down Expand Up @@ -609,7 +608,7 @@ end

If you re-submit the form now, you may not see any change on the page. Don't worry!
This is because Rails by default returns `204 No Content` response for an action if
we don't specify what the response should be. We just added the `create` action
we don't specify what the response should be. We added the `create` action
kaspth marked this conversation as resolved.
Show resolved Hide resolved
but didn't specify anything about how the response should be. In this case, the
`create` action should save our new article to the database.

Expand All @@ -624,7 +623,7 @@ def create
end
```

The `render` method here is taking a very simple hash with a key of `:plain` and
The `render` method here is taking a hash with a key of `:plain` and
value of `params[:article].inspect`. The `params` method is the object which
represents the parameters (or fields) coming in from the form. The `params`
method returns an `ActionController::Parameters` object, which
Expand Down Expand Up @@ -672,7 +671,7 @@ models, as that will be done automatically by Active Record.

As we've just seen, `rails generate model` created a _database migration_ file
inside the `db/migrate` directory. Migrations are Ruby classes that are
designed to make it simple to create and modify database tables. Rails uses
designed to create and modify database tables. Rails uses
rake commands to run migrations, and it's possible to undo a migration after
it's been applied to your database. Migration filenames include a timestamp to
ensure that they're processed in the order that they were created.
Expand Down Expand Up @@ -1119,7 +1118,7 @@ with class `field_with_errors`. You can define a CSS rule to make them
standout.

Now you'll get a nice error message when saving an article without a title when
you attempt to do just that on the new article form
you attempt to do that on the new article form
<http://localhost:3000/articles/new>:

![Form With Errors](images/getting_started/form_with_errors.png)
Expand Down Expand Up @@ -1347,7 +1346,7 @@ content:
```

Everything except for the `form_with` declaration remained the same.
The reason we can use this shorter, simpler `form_with` declaration
kaspth marked this conversation as resolved.
Show resolved Hide resolved
The reason we can use this shorter `form_with` declaration
to stand in for either of the other forms is that `@article` is a *resource*
corresponding to a full set of RESTful routes, and Rails is able to infer
which URI and method to use.
Expand Down Expand Up @@ -1996,7 +1995,7 @@ Security
If you were to publish your blog online, anyone would be able to add, edit and
delete articles or delete comments.

Rails provides a very simple HTTP authentication system that will work nicely in
Rails provides an HTTP authentication system that will work nicely in
kaspth marked this conversation as resolved.
Show resolved Hide resolved
this situation.

In the `ArticlesController` we need to have a way to block access to the
Expand Down