Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 example
Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rvmrc
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 rails_mini.gemspec
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.