single_nested_hash_to_param

This plugin allow you to convert single nested hash into param

MIT License

Stars
8

====== ====== ==== == ===== SINGLE NESTED HASH TO PARAM ====== ====== ==== == =====

This plugin extend hash class with single_nested_hash_to_param method. It works like to_param but for single-neste hash like for example {:person=>{:name=>"Irek", :surname=>"Skrobis", :profession=>"Developer"}}

Installation:

ruby script/plugin install [email protected]/kayinrage/single_nested_hash_to_param.git

Examples:

hsh = {:person=>{:name=>"Irek", :surname=>"Skrobis", :profession=>"Developer"}} hsh.single_nested_hash_to_param => "?person[name]=Irek&person[surname]=Skrobis&person[profession]=Developer"

Copyright (c) 2010 Irenuesz Skrobis, released under the MIT license