#여기! 를 찾아보시오
라이브러리를 이해 해야되는데 이 작은 두뇌로는...
지금 당장은 자야겠습니다...
sinatra does two things.
it routes browser requests to code that can handle those requests and then from there it will render templates back to the browser as a response.
.. We start at the browser, it sends a request to the web server, which sends a request through the public folder to the Rails framework and from there we have code that routes our
1.4.8
# route
.. The first step is you must require (load the feature(!)) the Sinatra gem(external library) . After tha,t you need to make sure that you have a root route definition.
- load the sinatra gemm, have a root route def.
(?) Thin web server :
Routes are going to be matched in order from the top of the file. That means that Sinatra's going to start at the top of our routes and go down until it finds one that mathces. If there happens to be another match further down, It will never get there.
#Route HTTP methods
request's'
- post
- put
- patch
- delete..
--
get, post example
different name
from the doc
.get(path, opts = {}, &block) ⇒ Object
path -> '/' '/forum' ..
- get -request , make link
[q] There's no other way to get that post request except to click submit.
이해가 안가는 부분이 있는데. 무조건 form 형태의 - 태그는 post형태의 method request를 보내는 건가?
< Route Patterns > (yeh!!!)
## ( check charater : regular expression )
- example :
The most important is to notice that it's not a string.
error
arjuna@ARJUNA-2:~/88Driver/#Work/MyCode/Ruby/Sinatra$ ruby 'test_1.rb'
/usr/local/lib/ruby/gems/2.3.0/gems/mustermann-1.0.0/lib/mustermann/regular.rb:40:in `check_anchors': regular expression should not contain \A: "\\A\\/company\\/[A-Za-z\\-]+\\Z" (Mustermann::CompileError)
#여기!
#mini note :
- questions
- [q]html, tag, single or double quotation makrk
- I know they both work and are supported by all modern browsers but is there a real difference where one is actually better than the other in different situations?
- Single quote marks can be included within the attribute value when the value is delimited by double quote marks, and vice versa
- ' "" '
- " '' "
- delimited ( determined de : down )
- [q] html input's attribute -> value
- value
- The initial value of the control. This attribute is optional except when the value of the type attribute is radio or checkbox.
- [r] regex test 해주는 우오! : http://regexr.com/
댓글 없음:
댓글 쓰기