DEV Community

Saman Mahmood
Saman Mahmood

Posted on

Ruby on rails

Here's a simple example of using Ruby on Rails in just a few lines:

# Gemfile
source 'https://rubygems.org'
gem 'rails', '6.1.4'

# Terminal
bundle install
rails new MyApp
cd MyApp
rails generate scaffold Post title:string content:text
rails db:migrate
rails server
Enter fullscreen mode Exit fullscreen mode

These commands set up a basic Ruby on Rails application, create a Post model with a title and content, and start a local server. Remember, this is a minimal example, and a real application would require more configuration and code.

Top comments (0)