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
Error in the Getting Started Guide? #11122
Comments
|
You have missed "For more information about routing, refer to Rails Routing from the Outside In." in the section 4.3. But I agree with you there is no clue to add |
|
From the guide: 5 Getting Up and RunningNow that you've seen how to create a controller, an action and a view, let's create something with a bit more substance. In the Blog application, you will now create a new resource. A resource is the term used for a collection of similar objects, such as posts, people or animals. You can create, read, update and destroy items for a resource and these operations are referred to as CRUD operations. Rails provides a resources method which can be used to declare a standard REST resource. Here's how config/routes.rb will look like. Blog::Application.routes.draw do
resources :posts
root to: "welcome#index"
endThis occurs before the part about creating the form for a post. |
|
Actually, there is a clue to add |
|
Would it be helpful to add something like this in section 5.2:
|
Hey there,
im just trying to learn RoR and followed the tutorial step by step so far. reaching 5.2:
"<%= form_for :post, url: posts_path do |f| %>
In this example, the posts_path helper is passed to the :url option. What Rails will do with this is that it will point the form to the create action of the current controller, the PostsController, and will send a POST request to that route."
I get an issue with this dubious posts_path, as it is not mentioned anywhere before in the tutorial and i have no clue how the syntax on the .erb files works. it tells me:
undefined local variable or method `posts_path' for #<# Class:0x3c297d8>:0x3402dc8>
somehow, i cant imagine me being the first one stumbling over this issue. on the other hand i have not that much clue what i am doing. so far, the tutorial has been perfect, but at this point it becomes a bit squishy.
regards
The text was updated successfully, but these errors were encountered: