New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

trails-mvc

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trails-mvc

  • 0.1.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Ruby on Trails

What is Ruby on Trails?

View the Sample App Live

Trails Sample App Repository to see how to use Trails

Trails is a lightweight MVC framework built in Ruby by Will McMeans. It is similar in functionality to Ruby on Rails, but flavored the way I like it. It features a custom ORM called Dynamic Archive (doesn't that sound more exciting than Active Record?) and everything else you need to build a simple web app. We're not riding rails...we're hiking trails!

How to Get Started

Install the Trails Gem

gem install trails-mvc

Create Your First App

trails new <name> — begins a new Trails project

Start the Server

trails server [--host] [--port] — starts the Trails server; default host: localhost, default port: 3000

Generate Models and Controllers

trails generate model <model_name> — creates a new model file in app/models and a new migration in db/migrations

trails generate controller <controller_name> — creates a new controller file in app/controllers and a corresponding view folder in app/views

trails generate migration <migration_name> — creates a blank migration file in db/migrations (but no model file)

Change the Database

trails db reset — clears the database, runs all migrations, and re-seeds

trails db migrate — runs all pending database migrations

trails db seed — seeds the database

Add Routes

Follow the example in config/routes.rb

Add CSS and JavaScript

It's recommended to add styling to public/assets/application.css and any JavaScript to public/assets/application.js. You may also include other scripts and stylesheets in your views as long as you store them in public/assets.

Not Sure What to do Next?

Check out the Trails Sample App Repository to get a better idea of what you can do with Ruby on Trails

Features

  • Dynamic Archive (Custom ORM) creates rich relationships between objects.
  • Server handles requests and creates responses, nesting the main app within a Rack::Builder instance that contains middleware (e.g. a StackAssetsServer that serves stylesheets).
  • Router uses routes to direct requests to controllers.
  • TrailsController::Base builds responses based on parameters and renders content using ERB views, including partials.
  • Session sets and reads cookies to persist data between requests
  • Flash a special type of information that lives for only one subsequent request (or just the current one, if using Flash#now).

Technologies

  • Ruby
  • Rack
  • ERB
  • SQLite3
  • Thor
  • JSON

FAQs

Package last updated on 08 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc