Padrino

Padrino 0.9.22 - Quick Followup Release

Even though we just released the latest Padrino (0.9.21) and that was relatively stable (for a pre-stable), an unexpected event happened shortly thereafter. Sinatra released the final version of 1.2.0. This was an awesome release thanks in large part to Konstantin Haase. Even though the release has many great things, it also added a new helper method to Sinatra called uri and aliased as url .

This of course overlaps with the padrino url method . This causes incompatibility with Padrino and Sinatra 1.2.0 so a quick fix was in order. At the same time, there were a number of other patches after our last release which we will roll in as well including http fixes and japanese translations. Details are in the full post.

Locked Padrino to Sinatra 1.1

Padrino will soon be fully compatible with Sinatra 1.2.0. Until then, we locked Padrino to Sinatra < 1.2.0 in order to guarantee proper functioning in this release.

Performance Improvements

Padrino is always striving to be faster and to give more throughput. After all a big advantage of Padrino is that it require less memory and resources than other frameworks as well as providing higher requests per second. There has been a recent push to update our benchmarks to be as correct and relevant as possible. Thanks to judofyr for his help with making the benchmarks more accurate. See the results or fork us and help improve them.

In that vein we also made to small changes to improve performance:

  • Padrino now subclasses from Sinatra::Base rather than Sinatra::Application. This is faster and doesn’t remove any functionality we require.
  • Padrino now supports the set :padrino_logging, false option to stop padrino from logging and improve speed significantly in return.

There will be a stronger performance push soon as we work to keep Padrino as lightweight as possible.

HTTP Fixes

Patrick Lef has been kind enough to point out multiple failing http specs in our core handling, so we made" a few fixes. Thanks to core Padrino member Florian for putting those all together so quickly!

Major changes were:

  • Set status to 406 on non-provided ACCEPTS
  • Return first provided mime-type on ACCEPT = /
  • Assume / if no ACCEPT header is given

Being a web server, Padrino desires to fully respect the standard behaviors specified and we are getting closer each release :) If you know of any outstanding bugs please open an issue.

Japanese Translations

udzura recently sent us Japanese translations to Padrino. We have really gotten quite a lot of internationalization support for admin and every new language is great to be able to include. Are we missing a localization for your language? Be sure to let us know or submit a patch to help us include that.

Compatibility fixes

  • Fixes mongoid locking it to correct dependency
  • Fixes password encryption in the account model
  • Fixes mongomapper template in admin

Padrino 0.9.21 - Nested Forms, Translations and More

Today, we have released a new version of Padrino 0.9.21 which continues the tradition of incremental improvements towards a 1.0 release. We will consider Padrino ‘1.0’ once we feel that the framework is sufficiently robust and well-documented.

We aren't quite all the way there yet but we are rapidly improving with each release. This release contains agnostic nested object forms, chinese translations, routing enhancements, and component compatibility fixes. A more detailed list of changes is included in the full post.

There are no breaking changes from the previous version. The major changes are below:

Nested Object Forms

One of the most commonly requested features is nested object form support within our view helpers. This handles the case where a form should create multiple related objects at once of different types.

For instance if you have a user and he has an address which is stored in a separate model. Now Padrino supports agnostic form builders for nested objects. Using this is quite simple and extends the existing form syntax:

# app/views/example.haml
# app/views/person/_form.html.haml
- form_for @person, '/person/create'  do |f|
  = f.text_field :name
  = f.text_field :favorite_color
  - f.fields_for :addresses do |address_form|
    = address_form.label :street
    = address_form.text_field :street
    = address_form.label :city
    = address_form.text_field :city
    - unless address_form.object.new_record?
      = address_form.check_box '_destroy'
      = address_form.label '_destroy', :caption => 'Remove'
    = submit_tag "Save"

For the details be sure to checkout the Application Helper Guide to learn more.

Routing Fixes

Joshua Hull in particular can be thanked for many of these routing fixes reported by our users. In particular:

  • Routing now properly supports variables within an index route
  • Fixes routes with conjunction of :map and :with
  • Fixes regular expression route captures
  • Laziness of provides now conveys its format neediness [Fixes Issue 412]

    app/controllers/example.rb

    get :index, :map => '/bugs', :with => :id do # ... end

    get %r{/([0-9]+)/} do |num| "Your lucky number: #{num} #{params[:captures].first}" end

Regular expression routes should now work as expected in nearly all cases.

Component Fixes

  • Updated mongomapper adapter to use rails3 branch
  • Updated datamapper gen to store correctly passwords
  • Adds mongoid rake tasks for maintaining database

Traditional and Simplified Chinese Translations

This release brings support for Traditional Chinese(thanks to ayamomiji) and Simplified Chinese translations. This means that the Padrino Admin application as well as all form helpers are properly localized to this language. If you speak a language that Padrino doesn’t yet support, please consider contributing! We are happy to help get you started.

Other fixes

  • Major changes to output handling for padrino helpers allowing easier template integration (gist)
  • Better project generation name validations
  • Fixes the select_tag to have better support for multiple options
  • Cleans up bundler integration removing legacy support for 0.9
  • Fixed issue with error_message_on where incorrect object was being accessed
  • Layouts are properly found now with shorthand aliases
    • render "brochure/home", :layout => :narrow

A full list of changes can be seen by looking at our github commit history for more details. We are already working on a 0.9.22 release will should include a few exciting new features. If you run into any problems please do let us know on the Github Issues page.


  • Prev Page
  • Next Page