| Geffy | wackimonki: google for 'Ruby metaprogramming' and you'll get a fair number of things to read |
| lostkid | Geffy: but if i do so, i will fall in the same problem i have described before: if i copy-paste the plugin tho a new app, and then i modify it and copy-paste it again, i can be messing up my new app, am i wrong??? |
| wackimonki | meta programming! eck. not that dreaded thing again. i've been trying to avoid it i guess i'll have to take a look. thanks |
| Geffy | wackimonki: meta programming is fun |
| nullie | meta programming is what you must seek |
| julpi | hi everyone... I'm looking for a plugin or, if missing, the way to set something like a "default find". something like what I get with acts_as_paranoid, which overrides the find, count, ecc. methods to ignore records with deleted_at set... |
| wackimonki | its new to me. want to avoid new things while i've got a deadline to meet |
| julpi | so that I can define my default find rules (like 'user with the column activated set to true') |
| Geffy | lostkid: sounds like you want to put the plugin into SVN or something and then update it as required lostkid: it also depends how you write it and how invasive it is to the main app I am off for lunch, laters |
| lostkid | Geffy: so is possible to have an app that actually represents my plugin and have somekind of generator that sets all the files correctly inside the directory vendor/plugin/<my_plugin>, (being the whole application in my case in the cvs repository and then call an script/plugin install <url_inside_cvs_repository> inside the app i want to import the plugin??? |
| locellcount | Been posting cvs, so did anyone come back with a solution to that sortable list issue? |
| foxiness | coz am new to ror often i create new rails project,and that need 'imo ,if that not true let me know' to create three database, to my Q: is there an easy way to create this three database 'tips,softwore,script' coz i want to learn new way if there one..did i forget to say hi ? Hi :) |
| hirmer | stupid question: what is the best way in rails to copy and modify a database record? |
| foxiness | and to know b4 i come here and ask ,i did ask google,and some sort on wiki-ror hirmer: did i forget to prefix my Q, with "stupid question" ! |
| locellcount | Never mind, fixed it. In case anyone has the same issue, you need to use replace_html to insert a new sortable_element after the item is moved. Clunky, but it works. And right now, that's all that matters :) |
| Arsen7 | hirmer: maybe @item.dup or @item.clone hirmer: it depends on what you want to do with that copy. .lone prepares it to be a new record .clone |
| hirmer | hmmm .clone sounds good I searched the API for copy and didnt find anything... I will try it with clone thx |
| asdx | rjs templates goes into the controller? render :update do |page| page.insert_html ... ? |
| Klian | I have a text field: foto_producto_id which I validate its presence with: validates_presence_of :producto_id , but I have another text_field: pic_image and I cant validate its presence (in the same class) with: validates_presence_of :producto_id,:pic_image |
| action | asdx needs some sleep |
| asdx | needs some sleep |
| Klian | Only recognise producto_id |
| foxiness | is there are somthing similer to phpmyadmin on ruby if i dont want to run apache ? |
| Arsen7 | Klian: There has to be some mistake. Usually it recognizes multiple fields given as params to validates_presence_of. Maybe you set a default value? Can you put logger.debug("BEFORE VALIDATE: #{pic_image.inspect}") in some before_validate callback? |
| Klian | Arsen7: check my code of the form: <%= file_field :foto, :producto_id %> <--- Works <%= file_field :pic, :image %> <--- doesnt work |
| locellcount | asdx: you can do, but it's nicer to seperate them into rjs files. Then you test for ajax request with something like render(:template => 'foo/bar.rjs', :layout => false) and return if request.xhr? |
| Klian | the class is: Foto |
| Arsen7 | Klian: but I suppose that has little to do with text_field - you said: 13:24 < Klian> I have a text field: foto_producto_id |
| lostkid | guys, i can't do something like this to install a plugin inside an app from another app: ./script/plugin install ../accesscontrol/vendor/plugins/access_control ??? |
| azta | lostkid: you can just cp the directory over |
| kain | if you don't use subversion just copy it |
| azta | yeah, you would have to manually set the svn externals property on it... if you wanted it |
| locellcount | Can someone just clear up something? When you use acts_as_list, you use higher_item to return the item directly above an item in the list right? For some reason I'm getting the one above the one it should be, or sometimes a completely random one. |