Comments (2)
Hi. I think the last part of this lesson has some error
def create
@post = Post.new
@post.title = params[:title]
@post.description = params[:description]
@post.save
redirect_to post_path(@post)
end
When I try to run the test redirect path giving an error.
I changed the path to
redirect_to posts_path(@post)
then I pass to learn the test.
Please update the status if I 'm not doing it correctly.
Thanks
from rails-create-action-readme.
@estherkimyunjung That's strange. redirect_to post_path(@post)
looks right to me; that's the convention. What error did you get, and what does your routes.rb file look like?
from rails-create-action-readme.
Related Issues (16)
- Array values in the parameter to `Gem.paths=` are deprecated HOT 1
- rails console issue HOT 1
- Bad ordering of labs HOT 1
- No Routes Written, despite instructions HOT 1
- Lab requires strong params, when it shouldn't at this stage HOT 1
- "We've already got the route and our form created"...form, yes...route? no. HOT 1
- No routes in lab and gives an error that is not mentioned on readme HOT 1
- missing routes in route.rb HOT 1
- This lesson is requiring I perform tests but there is no test suite.
- possible broken lab HOT 1
- rails-create-action-readme HOT 1
- Need to add the ruby/sql tag to the triple backticks
- solution a little too advanced for this stage? HOT 1
- The post path for the create method in posts controller only passed when an 's' was added to the end of 'post' HOT 1
- Using @post instead of post in the redirect. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rails-create-action-readme.