Omaship

Adding Features

Your Omaship app is a standard Rails application. Add any feature you want.

Adding a New Page

The simplest addition—a new page:

# Generate a controller
rails generate controller Pages demo

# This creates:
# app/controllers/pages_controller.rb
# app/views/pages/demo.html.erb

Add a route in config/routes.rb:

get "/demo", to: "pages#demo"

Adding a Model

Create a new database-backed resource:

# Generate model with attributes
rails generate model Product name:string price:decimal active:boolean

# Run the migration
rails db:migrate

Adding API Endpoints

Create JSON APIs for your frontend or mobile app:

# app/controllers/api/v1/products_controller.rb
module Api
  module V1
    class ProductsController < ApplicationController
      def index
        render json: Product.all
      end
    end
  end
end
# config/routes.rb
namespace :api do
  namespace :v1 do
    resources :products, only: [:index]
  end
end

Adding Background Jobs

Omaship uses Solid Queue for background processing:

# Generate a job
rails generate job ProcessOrder

# app/jobs/process_order_job.rb
class ProcessOrderJob < ApplicationJob
  def perform(order_id)
    order = Order.find(order_id)
    # Process the order...
  end
end

# Enqueue it
ProcessOrderJob.perform_later(order.id)

Adding Mailers

Send transactional emails:

# Generate mailer
rails generate mailer Order confirmation

# Send from controller
OrderMailer.confirmation(@order).deliver_later

Adding Stimulus Controllers

Add client-side interactivity:

# Generate controller
rails generate stimulus toggle

# app/javascript/controllers/toggle_controller.js
import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
  static targets = ["content"]

  toggle() {
    this.contentTarget.classList.toggle("hidden")
  }
}

Best Practices

  • Use generators — They set up everything correctly
  • Follow Rails conventions — AI tools and other developers will understand your code
  • Write tests — They run automatically in CI
  • Keep controllers thin — Move logic to models or service objects

Getting Help

Use AI tools like Claude Code or Cursor. Your app includes a CLAUDE.md file with project context.

See Working with AI Tools for tips.