{"issue":{"created_at":"2011-11-28T17:25:45Z","state":"open","updated_at":"2011-12-08T16:32:43Z","comments":8,"user":{"gravatar_id":"fdce53a8a51e4fbdc9b9aeec650f7dff","id":702605,"url":"https://api.github.com/users/pablobslima","avatar_url":"https://secure.gravatar.com/avatar/fdce53a8a51e4fbdc9b9aeec650f7dff?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"pablobslima"},"body":"I'm trying to make a selectbox with static fields (Brazilian states)\r\ntried as follows:\r\n\r\nf.input :uf, :as => :select, :collection => ([[\"AC\", \"AC\"], [\"AL\",\"AL\"], [\"AP\", \"AP\"],\r\n                                                                 [\"AM\", \"AM\"], [\"BA\", \"BA\"], [\"CE\", \"CE\"],\r\n                                                                 [\"DF\", \"DF\"], [\"ES\", \"ES\"], [\"GO\", \"GO\"],\r\n                                                                 [\"MA\", \"MA\"], [\"MT\", \"MT\"], [\"MS\", \"MS\"],\r\n                                                                 [\"MG\", \"MG\"], [\"PA\", \"PA\"], [\"PB\", \"PB\"],\r\n                                                                 [\"PR\", \"PR\"], [\"PE\", \"PE\"], [\"PI\", \"PI\"],\r\n                                                                 [\"RJ\", \"RJ\"], [\"RN\", \"RN\"], [\"RS\", \"RS\"],\r\n                                                                 [\"RO\", \"RO\"], [\"RR\", \"RR\"], [\"SC\", \"SC\"],\r\n                                                                 [\"SP\", \"SP\"], [\"SE\", \"SE\"], [\"TO\", \"TO\"]])\r\n\r\nIt's not working, can anyone help me?\r\n\r\n[]',s\r\n\r\nPablo Lima ","assignee":null,"id":2370558,"number":791,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"labels":[],"title":"selectbox with static values ","html_url":"https://github.com/gregbell/active_admin/issues/791","closed_at":null,"url":"https://api.github.com/repos/gregbell/active_admin/issues/791","milestone":null},"action":"created","comment":{"created_at":"2011-12-08T16:32:43Z","updated_at":"2011-12-08T16:32:43Z","user":{"gravatar_id":"27a4802fa7723366f40db091964f757b","id":713787,"url":"https://api.github.com/users/bbonamin","avatar_url":"https://secure.gravatar.com/avatar/27a4802fa7723366f40db091964f757b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"bbonamin"},"body":"I'm doing this from memory but to set it with an after_initialize I\r\nwould do something like this, in the model.rb:\r\n\r\ndef after_initialize\r\n  self.att_name ||= value\r\nend\r\n\r\nEnviado desde mi iPhone\r\n\r\nEl 08/12/2011, a las 13:29, panSarin\r\n<reply@reply.github.com>\r\nescribió:\r\n\r\n> well this is quite obvious , i had problem with that case:\r\n> form do |f|\r\n>  f.inputs \"ObjectName\" do\r\n>    f.input, :as => select, :collection => [ [\"Name\", value], [\"Name2\", value2], [\"name3\", value3] ], :selected =>\r\n>  end\r\n> end\r\n> and how can i get my resource to set selected value ? f.inputs \"ObjectName\" do |resource| doesn't work\r\n>\r\n> ---\r\n> Reply to this email directly or view it on GitHub:\r\n> https://github.com/gregbell/active_admin/issues/791#issuecomment-3064561","id":3064624,"url":"https://api.github.com/repos/gregbell/active_admin/issues/comments/3064624"}}