(no title)
cassiogo | 1 year ago
require 'bundler/inline'
gemfile(true) do
source 'https://rubygems.org'
gem 'rails', '~> 7.1'
gem "sqlite3", "~> 1.4"
end
require 'rails'
require 'active_record/railtie'
database = 'app_development.sqlite3'
ENV['DATABASE_URL'] = "sqlite3:#{database}"
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: database)
ActiveRecord::Schema.define do
create_table :my_table, force: true do |t|
t.integer :my_table_id
end
end
class App < Rails::Application
routes.append do
root to: 'home#index'
end
end
class HomeController < ActionController::Base
def index
render inline: 'HOME'
end
end
App.initialize!
run App
For very small apps on ruby land sinatra and roda are the right choices.
On python the choice would be flask instead of the single file django.
mg|1 year ago
cassiogo|1 year ago