Hi all, i urgently need help for my first RoR app which should be running already. My app is a shop database (http://ewallshops.heroku.com/) made with Heroku. Entering shops manually already works fine. Data entered is checked for correctness of email adress and uniqueness of the shop name. Now I need to add a button to enable front-end users to upload .csv shop data that, during upload, also should pass the checks. In case of errors, the data items containing them should be shown. The others (without errors) shall be integrated into my database with continuing ids (not those from the csv-file). Some things about Heroku: As far as I know it uses Rails 2.0.2 and postgresql as database. Thanks in advance! Daniel -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Sorry to stress, but I really need help with this. I''ve already been looking this forum and also tried several solutions, but none of them worked. Please help me if you can. thx -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
How far have you gotten? There are a few things you need to implement: 1. Form which allows the user to upload the file (http:// manuals.rubyonrails.com/read/chapter/57) 2. Controller method that imports the data This method needs to iterate over each line, splitting the fields on '','' and create the objects. new_object = Object.new(blah, blah) You store the failed objects in an array failed << new_object unless new_object.save 3. If failed contains entries you need to redirect to a form presenting the items to be corrected if failed.length > 0 redirect_to :action => ''fix_records'' On Feb 26, 2:19 pm, Daniel Badde <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Sorry to stress, but I really need help with this. I''ve already been > looking this forum and also tried several solutions, but none of them > worked. Please help me if you can. thx > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
tip : u might want to use the valid? method of the model. new_item = Item.new(:name=>..., bla bla) failed_items = [] if new_item.valid? ..... do something .... else failed_items << new_item end -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks for the hints, guys. At the moment I decided to go public without the csv upload ability, because nothing I tried worked out well and I have other projects that need my time. But when I have more time, I''ll try to set it up like you told me. I''ll also try to implement the loading bar feature described here: http://www.blognow.com.au/q/64722/Ruby_on_Rails_and_BackgroundRB_-_multiple_progress_bars_with_ActiveScaffold.html which looks very promising (I tried to do that yesterday, but only got mongrel errors). I''ll post again in case of success, so stay tuned if you''re interested. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---