learn-co-curriculum / sinatra-activerecord-reading Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
I believe the code does not follow proper REST conventions.
It is currently written thus:
form method="post" action="/models/<%= @model.id %>/delete"
However, following the diagram on RESTular, and following the conventions of I what I learned in class, it should be coded:
form method="post" action="/models/<%= @model.id %>"
without the /delete. While this might not break the code, and Sinatra may be forgiving, at best it is bad practice, and at worst many of the "baked in" functionality may be lost.
Warm regards,
Gabriel
The get '/model/new' route is created as a block in your controller. In this block, we can render an .erb file that containers our form. In this case, we'll call it new.erb.
Under the Create header in line 21 there is some odd wording in the lists:
The get '/model/new' route is created as block in your controller. In this block, we can render an .erb file that containers our form. In this case, we'll call it new.erb.
Should be:
The get '/model/new' route is created as a block in your controller. In this block, we can render an .erb file that contains our form. In this case, we'll call it new.erb.
"The get 'models/:id/edit' controller action will render the edit.erb view page."
There should be a slash at /models/:id/edit
. I figured it out after received some errors, but for the sake of consistency, it should probably lead with a slash like the other routes.
Hey there,
Just wanted to let you know--the solution included on this repo is not correct. I don't know if that was done intentionally to prevent students from copying and pasting the lab solution, but there is an extra space around #{@article.id}
so it ends up looking like this #{ @article.id }
I mention it because I was having a difficult time with this lab, and after an hour of working I started walking myself through the provided solution to see where my code differed. I ended up correcting my code to match the solution and couldn't figure out what was going on, and still wasn't passing the lab after working on it for 2.5 hours and talking to a technical coach.
So just take that or leave it.
Best,
Amanda
The CRUD diagram appears to be incorrect.
Update quadrant should show: get '/models/:id/edit' and not with a singular /model
Also, should be: post '/models/:id' and not with a singular /model
There is no diagram below this text at the end of the readme:
CONCLUSION
Remember, the purpose of this reading is to help you understand which controller actions render which views, and which views have forms that send requests to which controller actions, as we implement CRUD. Check out the diagram below for the big picture:
.....
under the section 'create' header, the first bullet says "The get '/model/new' route renders the view page with that form." I am led to believe that these routes should actually look like 'get '/models/new' with a pluralized model name. it would be good to edit this here in the readme to avoid confusion moving forward (it caused problems for me in the CRUD lab that follows).
Diagram at the bottom says post '/model/:id' instead of patch '/model/:id'
This lesson is the second in the Active Record section of v7 of the web developer course. It begins by stating that "By now you should be familiar with how to perform the basic CRUD (Create, Read, Update, Delete) actions using Active Record. Let's take a moment and review. "
It should be sequenced to be later in the curriculum (or at least remove the first two sentences). It does do a good job of "reviewing" the information so thankfully it doesn't leave the student puzzled.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.