Hi Folks, i want to add a table with some currecny exchange values that i have to update 2-3 times a day. the problem is i have to update the file and restart the webserver to have the change taking effect . Is there another way to do it on a simple file without having to restart the webserver ? any ideas suggetion are welcome. thanks -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Use database to save currency exchange. then you dont need to restart server. Or when currency file updated reload it, its looks like you loading it in environment.rb, use same loader when you update currencies. On Mar 5, 5:47 am, korssane korssane <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi Folks, > i want to add a table with some currecny exchange values that i have to > update 2-3 times a day. > the problem is i have to update the file and restart the webserver to > have the change taking effect . > > Is there another way to do it on a simple file without having to restart > the webserver ? > > any ideas suggetion are welcome. > > thanks > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 5 March 2011 03:47, korssane korssane <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi Folks, > i want to add a table with some currecny exchange values that i have to > update 2-3 times a day.Do you mean a table on a web page or a table in the database?> the problem is i have to update the file and restart the webserver to > have the change taking effect .I presume from this that you mean the data is in a file.> > Is there another way to do it on a simple file without having to restart > the webserver ?One solution is to put the currency data in a table in the database. Write a rake task to read from the file and update the db and run this when the file changes. You could just put the update code in db/seeds.rb and then run rake db:seed (which runs seeds.rb). Colin -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Colin Law wrote in post #985599:> On 5 March 2011 03:47, korssane korssane <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> Hi Folks, >> i want to add a table with some currecny exchange values that i have to >> update 2-3 times a day. > > Do you mean a table on a web page or a table in the database? > >> the problem is i have to update the file and restart the webserver to >> have the change taking effect . > > I presume from this that you mean the data is in a file. > >> >> Is there another way to do it on a simple file without having to restart >> the webserver ? > > One solution is to put the currency data in a table in the database. > Write a rake task to read from the file and update the db and run this > when the file changes. You could just put the update code in > db/seeds.rb and then run rake db:seed (which runs seeds.rb). > > Colinthanks Colin for the logical suggestion, however i am new in RoR. do you have any tutos/video on how to proceed with tables and write rake task / tuto on hw to use seeds.rb? thanks -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 5 March 2011 12:10, korssane korssane <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Colin Law wrote in post #985599: >> On 5 March 2011 03:47, korssane korssane <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >>> Hi Folks, >>> i want to add a table with some currecny exchange values that i have to >>> update 2-3 times a day. >> >> Do you mean a table on a web page or a table in the database? >> >>> the problem is i have to update the file and restart the webserver to >>> have the change taking effect . >> >> I presume from this that you mean the data is in a file. >> >>> >>> Is there another way to do it on a simple file without having to restart >>> the webserver ? >> >> One solution is to put the currency data in a table in the database. >> Write a rake task to read from the file and update the db and run this >> when the file changes. You could just put the update code in >> db/seeds.rb and then run rake db:seed (which runs seeds.rb). >> >> Colin > > thanks Colin for the logical suggestion, however i am new in RoR. do you > have any tutos/video on how to proceed with tables and write rake task / > tuto on hw to use seeds.rb?railstutorial.org is a good free to use online tutorial. Forget about your current project and work right through the tutorial to get the hang of what it is all about. railsforzombies.org looks fun but I have not tried it. Also see the Rails Guides. seeds.rb is just a file that is executed when you run rake db:seed. Colin -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Fri, Mar 4, 2011 at 9:47 PM, korssane korssane <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>wrote:> Hi Folks, > i want to add a table with some currecny exchange values that i have to > update 2-3 times a day.the problem is i have to update the file and restart the webserver to> have the change taking effect . > > Is there another way to do it on a simple file without having to restart > the webserver ? >If you are updating a table and rendering to a dynamic page you should not have to restart the webserver. Otherwise you should provide specific details of what you are trying to do and why specifically you have to restart the webserver.> > any ideas suggetion are welcome. > > thanks > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Sat, Mar 5, 2011 at 10:22 AM, David Kahn <dk-rfEMNHKVqOwNic7Bib+Ti1W1rNmOCjRP@public.gmane.org>wrote:> > > On Fri, Mar 4, 2011 at 9:47 PM, korssane korssane <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>wrote: > >> Hi Folks, >> i want to add a table with some currecny exchange values that i have to >> update 2-3 times a day. > > the problem is i have to update the file and restart the webserver to >> have the change taking effect . >> >> Is there another way to do it on a simple file without having to restart >> the webserver ? >> > > Sorry.... did not see all the responses, maybe I am going insane or doesgmail sometime not show the thread responses sometimes.> If you are updating a table and rendering to a dynamic page you should not > have to restart the webserver. Otherwise you should provide specific details > of what you are trying to do and why specifically you have to restart the > webserver. > >> >> any ideas suggetion are welcome. >> >> thanks >> >> -- >> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> >> >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.