Upgrading Padrino from 0.12.X to 0.13.0 Guide
This is the step-by-step guide for upgrading from Padrino 0.12.X to 0.13.0! This will review all the breaking changes and modifications made within the new release. Be sure to also check the 0.13.0 Release Blog Post for more information.
Deprecated Features Removed
Several deprecated methods were removed in this release including:
#link_to with :fragment
- Use
:fragment
for#url
instead:url(:controller, :action, :fragment => "foo")
- Use
Application#load_paths
,Padrino.set_load_paths
,Padrino.load_paths
- To set, use
$LOAD_PATH.concat(paths)
- To get, use
Padrino.prerequisites
instead - deprecated caching methods
- methods including
#get
,#set
,#flush
(see more here)
- To set, use
- deprecated form builder methods
- methods including
field_error
andnested_form?
(see more here")
- methods including
#fetch_template_file
,#cache_template_file!
,#resolved_layout
rendering methods- No replacement exists
String#undent
- No replacement exists
Helper Changes
There are a few helper changes to be aware of:
select_tag
used to be fairly ambiguous when specifying “selected” options. The ambiguity has been removed by always relying on the “value” where possible.- Switch your
:selected
options to indicate the value of the option wherever possible. (see more here)
- Switch your
New Routing System
Subtle differences likely exist between the old http_router and the new mustermann powered system. These differences include:
- Splat arguments in URL are now a string rather than an array
get :show, :map => "/show/*name"
used to returnparams[:name]
as an array. Now this is a string.