The Elegant Ruby Web Framework
gem install padrino
padrino g project test_app -d datamapper -b
cd test_app
padrino g admin
padrino rake dm:migrate seed
padrino start
Sinatra Core
Many people love the simplicity and expressiveness of Sinatra but quickly find themselves missing a great deal of functionality provided by other web frameworks such as Rails when building non-trivial applications.
Sinatra acts as a thin layer on top of Rack itself and the “micro”-framework is kept light introducing complexities only when required by the particular application. Our goal with Padrino is to stay true to the core principles of Sinatra including a focus on simplicity and modularity.
Starting from this assumption, we have developed a different approach to a web development framework. We expand on Sinatra through the addition of standard libraries including helpers, components, and other functionality that are needed in a framework suitable for arbitrarily complex web applications.
Drop-in Admin
Padrino ships with an Admin Interface that includes the following features:
| Orm Agnostic |
Adapters for datamapper, activerecord, sequel, mongomapper, mongoid |
| Authentication |
Account authentication support and permission management |
| Template Agnostic |
View support for Erb and Haml rendering engines |
| Scaffold |
Create a model “admin interface” by invoking a command |
| MultiLanguage |
Translated into 10 languages including English, Spanish, and Italian |
Example:
$ padrino-gen project cool --orm activerecord
$ cd cool
$ padrino-gen admin
$ padrino-gen admin_page post
For usage information, check out our detailed admin guide.
Lightweight
The Padrino code base has been kept simple and easy to understand, maintain and enhance. The generator for each new project creates a clean and compact directory structure keeping your code simple and well organized.
Padrino strives to adhere to the following basic principles:
- Tiny
- Clean
- Compact
- Fast
- Creative
- Concise
This framework can be used with ease for web development for a project of any size from your lightweight json web service to a large full-stack web application!
Agnostic
Padrino is orm, javascript, testing, rendering, mocking agnostic supporting the use of any number of available libraries.
The available components and their defaults are listed below:
| Component |
Default |
Options |
| orm |
none |
mongomapper, mongoid, activerecord, datamapper, sequel, couchrest |
| script |
none |
prototype, rightjs, jquery, mootools, extcore |
| renderer |
haml |
erb, haml |
| test |
rspec |
bacon, shoulda, cucumber, testspec, riot, rspec |
| stylesheet |
none |
less, sass |
| mock |
none |
rr, mocha |
Just create the project with the usual generator command and pass in your preferred components!
$ padrino g project cool --orm mongomapper
$ padrino g project cool --renderer haml --stylesheet sass
$ padrino g project cool --script mootools
$ padrino g project cool --orm mongoid --script mootools
$ padrino g project -h # shows available options
Comprehensive
Building on our experience in developing web applications, we designed a framework that meets all the requirements for creating a top notch web application in a clean, concise and simple environment, with minimal deadline delays.
We provide you with the following out of the box:
| Agnostic: |
Full support for many popular testing, templating, mocking, and database libraries. |
| Generators: |
Create Padrino applications, models, controllers, admin. |
| Mountable: |
Unlike other ruby frameworks, principally designed for mounting multiple apps. |
| Routing: |
Full url named routes, named params, respond_to support, before/after filter support. |
| Helpers: |
Different helpers for generating tags, forms, links, images, and more. |
| Mailer: |
Fast and simple support for delivering emails. |
| Admin: |
Built-in admin interface (akin to Django) with authentication. |
| Logging: |
Provides a unified logger that can interact with your ORM or any library of your choice. |
| Reloading: |
Automatically reloads server code during development. |
| Localization: |
Full support for I18n localization. |
Padrino Admin is a quick way to manage your backend!
Preface
Padrino is a ruby framework built upon the excellent Sinatra Microframework. Sinatra is a DSL for quickly creating simple web applications in Ruby. Padrino was created to make it fun and easy to code more advanced web applications while still adhering to the spirit that makes Sinatra great!
Introduction
Many people love the simplicity and expressiveness of Sinatra but quickly come to miss a great deal of functionality provided by other web frameworks such as Rails when building non-trivial applications.
Our goal with Padrino is to stay true to the core principles of Sinatra while at the same time creating a standard library of tools, helpers and functions that will make Sinatra suitable for increasingly complex applications.
Here is a list of the major functionality Padrino provides on top of Sinatra:
| Agnostic: |
Full support for many popular testing, templating, mocking, and database libraries. |
| Generators: |
Create Padrino applications, models, controllers i.e: padrino g project. |
| Mountable: |
Unlike other ruby frameworks, principally designed for mounting multiple apps. |
| Routing: |
Full url named routes, named params, respond_to support, before/after filter support. |
| Tag Helpers: |
View helpers such as: tag, content_tag, input_tag. |
| Asset Helpers: |
View helpers such as: link_to, image_tag. |
| Form Helpers: |
Builder support such as: form_tag, form_for, field_set_tag. |
| Text Helpers: |
Useful formatting like: relative_time_ago, js_escape_html. |
| Mailer: |
Fast and simple delivery support for sending emails (akin to ActionMailer). |
| Admin: |
Built-in admin interface (akin to Django) with authentication. |
| Logging: |
Provide a unified logger that can interact with your ORM or any library. |
| Reloading: |
Automatically reloads server code during development. |
| Localization: |
Full support for I18n localization. |