■REST "Create / Read / Update / Delete" often used in SQL is applied to "GET / POST / PUT / DELETE" respectively. It is necessary to write instructions one by one because state management such as sessions is not performed. Basically, it is described in "route.rb".
■ Command line Terminal. It comes standard with the cloud IDE.
■Cloud9 An integrated development environment that can be developed on the cloud provided by AWS. Super convenient because there is no need for troublesome environment settings
■gem Patch file? Additional elements? Something like. If you put it in a file called "Gemfile" and type bundle install into the terminal, it will be installed automatically.
■rails new The first spell to write when building an application using Rails. It will automatically generate the necessary files.
■ Framework Rails is the framework. If you have an editor, you can program freely, but in the future it will be a mess of writing, so "let's arrange the writing to some extent". If you use Rails, you can do the same process with your own short expression, which takes dozens of lines when written in Ruby. There is no actual value yet.
■ Version for each game If the version is different, the behavior may be different, so it is better to fix the version for development. If spring 2.0.2 cannot be installed, type "bundle update spring" and then install again.
[Practice] It is written before the rails server was launched.
■ MVC model A concept that defines where and what files to put. It doesn't matter where you put anything, but since management will be troublesome later, I will write it with a certain degree of uniformity. I don't have a real feeling of where to write what.
■ render method A method that outputs the response. Use with both controller and view.
■ Method function. Use it by sandwiching it between def and end. When calling, write the defined method name.
■routes.rb Describe which page is returned for which request. Is it basically a controller?
■ 1.3.4 Rewrite to Hello, world! Rewrite the first "Yay! You're on Rails!" To Hello, world !. This time it's not a big deal so I probably won't mess with the view. Define a render method in the stove to display the HTML "hello, world!" Make root a hello method.
[Practice]
app/controllers/application_controller.rb
def goodbye
render html: "goodbye, world!"
end
config/routes.rb
Rails.application.routes.draw do
root 'application#goodbye'
end
Like this.
Recommended Posts