terminal
$ rails new (Project name)
terminal
$ rails s -b 0.0.0.0
terminal
$ rails generate scaffold article content:string
terminal
$ rails db:migrate
terminal
$ rails generate controller welcome index
config/routes.rb
Rails.application.routes.draw do
get 'welcome/index'
resources :articles
root 'welcome#index'
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end
<%= link_to '(Link text)',Link address(In the following cases, move to the created articles) %>
ruby:index.html.erb
<%= link_to 'Show list', articles_path %>
terminal
$ rails generate migration AdNameToArticle name:string
Don't forget to migrate.
You can execute the process of calling data from the name column by writing the code as shown below.
#### **`python`**
```ruby
<%= article.name %>
Recommended Posts