learn-co-curriculum / sinatra-routes-readme Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
needs to be pared back a bit. students won't have learned about view rendering, erb, file structure. for now we should show routes just rendering static strings.
Could this be moved either before or after Sinatra Basics? I feel like students should have a pretty good understanding of routes even before something like Shotgun so that they really understand what Sinatra is doing.
Bring them back to what they know! If they can something to just call a method when a user types a url, they are good to go.
I don't follow why :id was added to the request matching pattern on this line get '/medicines/:id' do
Flow wise, this could be stronger if it started with the text below the screenshots because this lets a student go from known to unknown easier. (below)
Then, continue with "Routes are the part of an application that connect HTTP requests to a specific part of your application code built to handle responding to such a request (that part of code is called a Controller Action)." in the first paragraph. I think a lot of that information from there to the screenshots can be cut or combined with the second section of how do routes work. Put those screenshots and full explanation there instead of breaking it down. I think the "What are routes" section could be pretty basic with what I mentioned above.
The example of the doctor app isn't all that clear. Users may not know what and HREF attribute is, and for the sake of this readme, maybe it doesn't need to be mentioned (not sure). Instead of using two examples ("All Medicines" and "All Patients"), it could be better to just discuss one example. Also, question- is a route from the url (..../medicine) to the response that is a list of medicines?
^^ The mapping localhost url is confusing without an explanation of its context.
^^ Could this info on DSL be moved to the earlier Readme on What is Sinatra?
cc @matbalez
This currently doesn't really address the routing aspect of routes - of connecting a URL to a particular part of our application, that the URL is the interface. Plus it's getting into REST and complex AR examples.
Hi. Let me start off by saying that I got the gist of this lesson, and I was able to understand how routes work with regards to MVC and the request/response cycle.
That said, I had trouble understanding what a route specifically WAS. The lesson at different points seemed to indicate that it was the path ('/medicines'
, for example), or get '/medicines'
, or the entire get '/medicines' do {...}
controller action/block.
I get that this stuff can overlap (like "controller action" referring to both the get...do {...}
block and the action itself). And again, at the very least I understand the PURPOSE of a route and how it fits into everything, but I was hoping for a clearer understanding of what's what.
Thanks for looking into this!
Sdcrouse
would be nice to go into detail about get
and post
and the arguments and interface of the DSL.
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.