Project

rails_mini

0.0
No commit activity in last 3 years
No release in over 3 years
Gem Rails like Sinatra
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 0
= 3.1
 Project Readme

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