Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Ruby
Branch: master
Failed to load latest commit information.
example make config.ru executeable
lib get rid of version file for now
spec rename Rails.app to Rails.mini
.gitignore gemified
.rvmrc some stuff
Gemfile gemified
Gemfile.lock Gemfile.lock
README.md Motivation
Rakefile require relatively
rails_mini.gemspec description

README.md

About

Gem Rails like Sinatra.

Mini Rails is a fun-hack that tweaks Rails routing allowing defining actions in simplest route definitions like match/get blocks. So it's Rails but feels like Sinatra.

Example config.ru

require './lib/rails_mini'

app = Rails.mini do

  config.secret_token = '!*#&$' * 31

  get '/hello' do
    render text: "Hello #{params[:to]}!"
  end

  get '/ping' do
    render json: {'ping' => 'pong'}
  end
end

run app

Installation

gem install rails-mini

Example app

See example

Motivation

Start small. When u ready to grow - get rid of the mini-rails.gem and continue as usual, moving methods into appropriate controllers

Authors

Todo

[x] Better defaults
[/] Sinatra DSL
  [X] block dsl in router
  [X] block dsl behaviours like controller action
    [X] render
    [X] redirect
    [ ]
[ ] real world usage
[ ] example app
Something went wrong with that request. Please try again.