{"issue":{"created_at":"2011-10-29T18:40:12Z","state":"closed","updated_at":"2011-11-29T20:38:37Z","user":{"gravatar_id":"4e2fecf95c856f2acc9dd8cd4927e5c2","id":14468,"url":"https://api.github.com/users/virtualfunction","login":"virtualfunction","avatar_url":"https://secure.gravatar.com/avatar/4e2fecf95c856f2acc9dd8cd4927e5c2?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"comments":6,"body":"Quite often when dealing with forms there are a number of defaults I need to use across inputs for a given form (note this is often specific to a form rather than global)\r\n\r\nA simple example is (In HAML)...\r\n\r\n```\r\n- defaults = { :input_html => { :class => 'test' } }\r\n= form.input :phone, details\r\n= form.input :email, details\r\n```\r\n\r\nBecause the 'defaults' is passed by reference and if modified internally by simple_form, the details variable for the email field will have all of the extra settings specific for the phone field added (e.d. HTML phone class, etc).\r\n\r\nWhat really needs to happen here is to possibly change SimpleForm::Inputs::Base so that the options hash is deep cloned before it is assigned to @options. My guess is that: \r\n\r\n```@options = Marshal::load Marshal.dump(options)```\r\n\r\nwould work here (I do admit this feels a little hacky). I shouldn't think the copying here would add any significant performance issues in terms of speed/mem usage. \r\n","assignee":{"gravatar_id":"18deb990b168e39dd36674ced7d44250","id":2719,"url":"https://api.github.com/users/hugobarauna","login":"hugobarauna","avatar_url":"https://secure.gravatar.com/avatar/18deb990b168e39dd36674ced7d44250?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"id":2087948,"labels":[{"name":"BM","color":"d7e102","url":"https://api.github.com/repos/plataformatec/simple_form/labels/BM"}],"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"number":355,"title":"Use cloned options...","closed_at":"2011-11-29T20:38:36Z","html_url":"https://github.com/plataformatec/simple_form/issues/355","url":"https://api.github.com/repos/plataformatec/simple_form/issues/355","milestone":{"created_at":"2011-09-02T15:44:18Z","state":"open","due_on":null,"closed_issues":7,"creator":{"gravatar_id":"0525b332aafb83307b32d9747a93de03","id":47848,"url":"https://api.github.com/users/rafaelfranca","login":"rafaelfranca","avatar_url":"https://secure.gravatar.com/avatar/0525b332aafb83307b32d9747a93de03?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"number":3,"description":"","title":"2.0.0","url":"https://api.github.com/repos/plataformatec/simple_form/milestones/3","open_issues":4}},"action":"closed"}