neovim Ruby on Rails - Lamtea/dotfiles GitHub Wiki
Please complete the following tasks:
mkdir hello-rails
cd hello-rails
# Optional
# You can keep the version of asdf.
asdf local ruby <your version>
bundle init
bundle config --local path vendor/bundle
vi GemFile
gem 'rails' # Uncomment
bundle install
bundle exec rails new . # say 'Y'
# Terminal 1
bundle exec rails s
# Terminal 2
curl 'http://localhost:3000'
C-c
in Terminal 1.
# Add controller
bundle exec rails g controller hello
vi app/controllers/hello_controller.rb
def index
@hello = "Hello World"
render template: "hello/index"
end
# Add view
vi app/views/hello/index.html.erb
<h1><%= @hello %></h1>
# Add routing
vi config/routes.rb
get "hello", to: "hello#index"
# Terminal 1
bundle exec rails s
# Terminal 2
curl 'http://localhost:3000/hello'
C-c
in Terminal 1.
nvim-dap-ruby rais Not Supported Yet.
The same as the following:
See: neovim Ruby -- Linting and Formatting.
There are many settings:
See: erb-lint.
See also: better-html.