[Rails] Re: CSS issue...
Abhishek shukla wrote: How can i call a stylesheet other then from /public/stylesheets/ folder.. %= stylesheet_link_tag /themes/style % must be work -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: German letter ä, ö, ü in rfpdf
Hi all, anyone found any solution for German letter ä, ö, ü in rf pdf i'm facing same problem and i must have tto use PDF::Writer on linux. Regards, Salil -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Controlling concurrency
What do you think is the best way to manage concurrency in this (made up) scenario? 1) You are selling Orders for items of various ProductVariants, belonging to one Product 2) There may be an upper limit to how many Orders you can take for any given Product 3) For our example today, you can only accept three more orders for any combination of ProductVariants of a Product 4) Two users put in three Orders, at the same time It's in the realm of millisecond possibility, then, for this to happen: Person 1: Validate that 3 Orders can be made for Product 123 = true Person 2: Validate that 3 Orders can be made for Product 123 = true Person 1: Orders.create(:product_variant = 9); Orders.create (:product_variant = 8); Orders.create(:product_variant = 7) Person 2: Orders.create(:product_variant = 6); Orders.create (:product_variant = 5); Orders.create(:product_variant = 4) Oops! 6 Orders placed! What do you think is the best way to prevent overselling in this case? I've considered: * Table locking (sucks) * Setting a lock file per-Product (filesystem-y and not elegantly scalable past one machine) * Setting a lock variable per-Product in a memcached store * A single-worker queue that validates and processes orders in sequence * A per Product single-worker queue that validates and processes orders in sequence * Something I haven't considered? What do you think? Steve! --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Complex forms: only one level of “arrayn ess” is allowed?
Hi all, I thought I was trying to do something rather simple, but it has caused me a lot of headaches. Here it is: - in my program: model_a has_many model_b. model_b has_many model_c. - in the user interface, I would like the user to be able to fill the information for one model_a, one or more associated model_bs (corresponding fields could be added with a set of links 'add/remove a model_b'), and for each model_b added, one or more model_c (with the same mechanism). Thanks to the great tutorial Handle multiple models in one form, it's easy to handle the first step (any number of model_b per model_a), but I can't get the second step to work. The natural indexing should (I think) be: model_a[model_b_attributes][][model_c_attributes][][an_attribute] But it doesn't seem to work. I read here http://guides.rubyonrails.org/form_helpers.html that only one level of “arrayness” is allowed and that I should use hashes instead, but I am not quite sure I understand how to do it. Do you have any idea? Thanks a lot PJ --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] RoR engineers needed in San Francisco
Hello Group, Do you love games? My client is looking for a few RoR developers to work on-site in San Francisco. This is a very exciting company making some very exciting apps. Find our more about the position here: http://heynow.com/jobs/09031102.html If interested please send along your resume and Salary requirements ASAP. Best, Darren Tessitore dar...@heynow.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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Rails Error
I'm totally new with ruby on rails My machine running ubuntu 8.10 and i have installed ruby 1.8.7, rubygems 1.3.1 and rails 2.3.2, sqlite3, postfix adn subversion. The problem is when i want to create a simple blog application this error came out. fa...@fadil-laptop:~$ sudo rails blog /var/lib/gems/1.9.0/gems/activesupport-2.3.2/lib/active_support/ core_ext/uri.rb:8:in `top (required)': uninitialized constant URI::Parser (NameError) from /var/lib/gems/1.9.0/gems/activesupport-2.3.2/lib/active_support/ core_ext.rb:3:in `require' from /var/lib/gems/1.9.0/gems/activesupport-2.3.2/lib/active_support/ core_ext.rb:3:in `block in top (required)' from /var/lib/gems/1.9.0/gems/activesupport-2.3.2/lib/active_support/ core_ext.rb:1:in `each' from /var/lib/gems/1.9.0/gems/activesupport-2.3.2/lib/active_support/ core_ext.rb:1:in `top (required)' from /var/lib/gems/1.9.0/gems/activesupport-2.3.2/lib/ active_support.rb:55:in `require' from /var/lib/gems/1.9.0/gems/activesupport-2.3.2/lib/ active_support.rb:55:in `top (required)' from /var/lib/gems/1.9.0/gems/rails-2.3.2/lib/rails_generator.rb: 28:in `require' from /var/lib/gems/1.9.0/gems/rails-2.3.2/lib/rails_generator.rb: 28:in `top (required)' from /var/lib/gems/1.9.0/gems/rails-2.3.2/bin/rails:14:in `require' from /var/lib/gems/1.9.0/gems/rails-2.3.2/bin/rails:14:in `top (required)' from /usr/bin/rails:19:in `load' from /usr/bin/rails:19:in `main' fa...@fadil-laptop:~$ Help me please. Regards. Fadil --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] install error for rails-widgets
When i am trying to install the rails-widgets on windows vista from http://wiki.github.com/paolodona/rails-widgets location I get an error. Please help. cd myrails-app ruby script/plugin install git://github.com/paolodona/rails-widgets.git rake widgets:setup following is the error rake aborted! Don't know how to build task 'widgets:setup' (See full trace by running task with --trace) --- Then I tried with the following command rake widgets:setup --trace following is the error --- rake aborted! Don't know how to build task 'widgets:setup' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1704:in `[]' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2026:in `invoke_task' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `top_level' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `each' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `top_level' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in `standard_exception_handling' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1999:in `top_level' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1977:in `run' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in `standard_exception_handling' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1974:in `run' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/bin/rake:31 c:/ruby/bin/rake:16:in `load' c:/ruby/bin/rake:16 -- View this message in context: http://www.nabble.com/install-error-for-rails-widgets-tp23048157p23048157.html Sent from the RubyOnRails Users mailing list archive at Nabble.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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Controlling concurrency
On Apr 14, 10:55 pm, steveluscher goo...@steveluscher.com wrote: What do you think is the best way to prevent overselling in this case? I've considered: * Table locking (sucks) * Setting a lock file per-Product (filesystem-y and not elegantly scalable past one machine) * Setting a lock variable per-Product in a memcached store * A single-worker queue that validates and processes orders in sequence * A per Product single-worker queue that validates and processes orders in sequence * Something I haven't considered? It sort of depends where the information that only 3 more orders for Product X lives. For example if the products table has a stock_remaining column, then for me the natural thing to do would be to use optimistic locking on the products table I wrote up some possibilities at http://www.spacevatican.org/2008/6/8/dealing-with-concurrency Fred What do you think? Steve! --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Complex forms: only one level of “arra yness” is allowed?
On Apr 15, 1:07 am, PJ camillieri...@gmail.com wrote: model_a[model_b_attributes][][model_c_attributes][][an_attribute] But it doesn't seem to work. I read herehttp://guides.rubyonrails.org/form_helpers.html that only one level of “arrayness” is allowed and that I should use hashes instead, but I am not quite sure I understand how to do it. Do you have any idea? What that comment is saying is that you can replace an array eg [a,b,c] with a hash eg {1 = a, 2= b, 3=c} Generating those keys is up to your client side code, approaches included using a number you increment or going for some unique thing you generate on the spot (eg time in milliseconds concatenated with a random number) so that you don't have to keep track of how many fields and what not you have created clientside. Fred --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Rails Error
On Apr 15, 4:55 am, fadil muhammadfadil...@gmail.com wrote: I'm totally new with ruby on rails My machine running ubuntu 8.10 and i have installed ruby 1.8.7, rubygems 1.3.1 and rails 2.3.2, sqlite3, postfix adn subversion. The problem is when i want to create a simple blog application this error came out. That stack trace looks you are using ruby 1.9.0 which you almost certainly don't want to use (1.9.0 was the development version of what was eventually released as ruby 1.9.1) Fred fa...@fadil-laptop:~$ sudo rails blog /var/lib/gems/1.9.0/gems/activesupport-2.3.2/lib/active_support/ core_ext/uri.rb:8:in `top (required)': uninitialized constant URI::Parser (NameError) from /var/lib/gems/1.9.0/gems/activesupport-2.3.2/lib/active_support/ core_ext.rb:3:in `require' from /var/lib/gems/1.9.0/gems/activesupport-2.3.2/lib/active_support/ core_ext.rb:3:in `block in top (required)' from /var/lib/gems/1.9.0/gems/activesupport-2.3.2/lib/active_support/ core_ext.rb:1:in `each' from /var/lib/gems/1.9.0/gems/activesupport-2.3.2/lib/active_support/ core_ext.rb:1:in `top (required)' from /var/lib/gems/1.9.0/gems/activesupport-2.3.2/lib/ active_support.rb:55:in `require' from /var/lib/gems/1.9.0/gems/activesupport-2.3.2/lib/ active_support.rb:55:in `top (required)' from /var/lib/gems/1.9.0/gems/rails-2.3.2/lib/rails_generator.rb: 28:in `require' from /var/lib/gems/1.9.0/gems/rails-2.3.2/lib/rails_generator.rb: 28:in `top (required)' from /var/lib/gems/1.9.0/gems/rails-2.3.2/bin/rails:14:in `require' from /var/lib/gems/1.9.0/gems/rails-2.3.2/bin/rails:14:in `top (required)' from /usr/bin/rails:19:in `load' from /usr/bin/rails:19:in `main' fa...@fadil-laptop:~$ Help me please. Regards. Fadil --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Passenger caching in development mode, wtf?
On Apr 15, 5:58 am, Petr Janda rails-mailing-l...@andreas-s.net wrote: This makes no difference. The problem is with mongrel is that I need the devel applications to be accessible even when im not developing, ie. client review. And id need to make a start up script in case i reboot the server to make all the mongrels start up. Its just hassle. dispatch.cgi/fcgi was ideal for simple setup in development mode where speed usually doesnt matter. Well the passenger docs imply that it should all just work: If you set RailsEnv development in your Apache configuration, then Rails will automatically reload your application code after each request You might want to ask the passenger mailing list or similar why it doesn't seem to be working for you. Fred PP Junty wrote: perhaps here: http://www.modrails.com/documentation/Users%20guide.html#RailsSpawnMe... but can't you use mongrel for development and passenger for production? Petr Janda wrote: I just tested with Ruby 1.8 and its the same behaviour. An clues people? -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Spreadsheet -avoid reading and writing from file how?
Hi I am using http://spreadsheet.rubyforge.org/ in my application..Usage like book = Spreadsheet::Workbook.new book.write #{RAILS_ROOT}/public/uploads/excel-file.xls render :file = #{RAILS_ROOT}/public/uploads/excel-file.xls headers['Content-Type'] = application/vnd.ms-excel headers['Content-Disposition'] = attachment; filename=excel-file.xls headers['Cache-Control'] = '' In the above i am writing to a file in a location and then read. My question is is there any method so that writing to a file can be avoided ..Because if there are some 100 requests the file will be overwritten(Am I right?) or if give seperate names for the files the upload folder will grow..So is there alternative and i can read the same content directly Thanks in advance Sijo -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: install error for rails-widgets
This is what you should see as a result of your plugin install: /widgets 516 script/plugin install git://github.com/paolodona/rails-widgets.git Initialized empty Git repository in /Users/rick/widgets/vendor/plugins/ rails-widgets/.git/ remote: Counting objects: 78, done. remote: Compressing objects: 100% (71/71), done. remote: Total 78 (delta 8), reused 21 (delta 0) Unpacking objects: 100% (78/78), done. From git://github.com/paolodona/rails-widgets * branchHEAD - FETCH_HEAD cp /Users/rick/widgets/vendor/plugins/rails-widgets/images/ tooltip_arrow.gif /Users/rick/widgets/public/images/widgets/ tooltip_arrow.gif cp /Users/rick/widgets/vendor/plugins/rails-widgets/images/ tooltip_image.gif /Users/rick/widgets/public/images/widgets/ tooltip_image.gif cp /Users/rick/widgets/vendor/plugins/rails-widgets/javascripts/ tooltip.js /Users/rick/widgets/public/javascripts/widgets/tooltip.js Did you omit this output from your mail message or what? Was any output produced when you ran the install? On Apr 14, 2:05 pm, nmt999 nmt...@yahoo.com wrote: When i am trying to install the rails-widgets on windows vista fromhttp://wiki.github.com/paolodona/rails-widgetslocation I get an error. Please help. cd myrails-app ruby script/plugin install git://github.com/paolodona/rails-widgets.git rake widgets:setup following is the error rake aborted! Don't know how to build task 'widgets:setup' (See full trace by running task with --trace) --- Then I tried with the following command rake widgets:setup --trace following is the error --- rake aborted! Don't know how to build task 'widgets:setup' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1704:in `[]' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2026:in `invoke_task' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `top_level' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `each' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `top_level' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in `standard_exception_handling' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1999:in `top_level' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1977:in `run' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in `standard_exception_handling' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1974:in `run' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/bin/rake:31 c:/ruby/bin/rake:16:in `load' c:/ruby/bin/rake:16 -- View this message in context:http://www.nabble.com/install-error-for-rails-widgets-tp23048157p2304... Sent from the RubyOnRails Users mailing list archive at Nabble.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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: German letter ä, ö, ü in rfpdf
Salil Gaikwad wrote: Hi all, anyone found any solution for German letter ä, ö, ü in rf pdf i'm facing same problem and i must have tto use PDF::Writer on linux. Regards, Salil Hi Salil, I made use of the prawn plugin mentioned above. It is very easy and powerful. Cheers -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Re: Re: Re: [ANN]Rubricks - CMS on Rails
Shouta Ohnishi wrote: Eric Wagoner wrote: However, I couldn't figure out how to go about using it once it was installed. From watching the movie, I understood users and the box model for the pages, but couldn't figure out how to add real content to the pages. Sorry, Current version of Rubricks has no real content, only System Component. We are making News Component now, and will release it next week. Our current release plan is follow: April : News Component May : RSS Component,Search Block June : Official Theme2, Calendar Block July : Todo Component,Forum Component,Dash Board(like mac os x tiger) Instead of real contents,you can try to install 'Hello World' component now. http://dev.rubricks.org/wiki/HelloWorldRubricks P.S. We'll give out documents for developing components soon. We're dreaming of enriching of components like XOOPS. Thanks. Shouta I wonder if there are people here who installed and used Rubricks since Shouta San sent this announcement. I am looking for a CMS system which I will be using as the skeleton of an application I want to develop, and I just had a look at the current version of Rubricks. I think it looks very promising. So if anyone have experience / extensions or whatever to share, I'd be happy to know. Oren -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: German letter ä, ö, ü in rfpdf
Hi Salil, I made use of the prawn plugin mentioned above. It is very easy and powerful. Cheers Hi Adam, Thanx. I try following code and it works fine for me.I test it only on linux though. enc = Iconv.new('Windows-1252', 'UTF-8') pdf.select_font(Helvetica) @data=enc.iconv(Persönlicher LS Vorhunden) table.data = [ {name = @data, race = } ] then it display Persönlicher LS Vorhunden correctly. Regards, Salil -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Looking for Developers to work fulltime
Hi, We are looking for developers who are well versed with PHP, MySQL and RoR. The requirement is for full time technical developers and team leads for a startup, WebMurga.com website: http://www.webmurga.com Go through the website to understand what it is about, and interested people may send in their resumes at care...@webmurga.com mentioning: a. skillset and experience b. relevant projects c. current and expected CTC d. how soon can u join Regards, Aditya Jain WebMurga.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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: German letter ä, ö, ü in rfpdf
MaD wrote: You might wanna change Vorhunden to vorhanden to make it German. thanx. but I check it with google language tools and it translate correctly. neways that's not an issue i just wanna print special characters like ä, ö, ü in rfpdfand fortunatelly for me it works. Regards, Salil -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: German letter ä, ö, ü in rfpdf
You might wanna change Vorhunden to vorhanden to make it German. --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] radio buttons?
if i got a couple of radio buttons on my form that i want to use a published_at field rather than a boolean field how would i go about this? I know that if i'm using a boolean i can do the following. %= f.radio_button :published_at, true % Yes %= f.radio_button :published_at, false % No but what would i have to change to use the datetime field? many thanks in advance guys, -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Please help in Multiple Checkbox and RadioButtons
I am using multiple check box (more than 1 checkboxes) and a radio button and when I click the Submit button, it calls the create method it is inserting only 1 value for checkbox and also for the radio button. How to insert multiple check box values in create. Also, in the scaffold edit page, the default edit method displays all the fields (including checkbox and radio buttons) as text_field(text box) with only single value. How to populate multiple checkbox and radio buttons in the edit page with the values populating. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: radio buttons?
On 15 Apr 2009, at 12:05, Dave Smith wrote: if i got a couple of radio buttons on my form that i want to use a published_at field rather than a boolean field how would i go about this? I know that if i'm using a boolean i can do the following. %= f.radio_button :published_at, true % Yes %= f.radio_button :published_at, false % No but what would i have to change to use the datetime field? Are you expecting people to enter a date or to choose between one of several dates ? Fred --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: radio buttons?
Frederick Cheung wrote: On 15 Apr 2009, at 12:05, Dave Smith wrote: if i got a couple of radio buttons on my form that i want to use a published_at field rather than a boolean field how would i go about this? I know that if i'm using a boolean i can do the following. %= f.radio_button :published_at, true % Yes %= f.radio_button :published_at, false % No but what would i have to change to use the datetime field? Are you expecting people to enter a date or to choose between one of several dates ? Fred Hi, i was actually hoping for when they check the yes option is puts the current time in the field. and when they click no it is removed. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: RoR engineers needed in San Francisco
Very interesting, but I am not in US. What a pity.. :( --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: RoR engineers needed in San Francisco
Me, either... On Wed, Apr 15, 2009 at 7:51 PM, 饕餮 | Daniel mayapain...@gmail.com wrote: Very interesting, but I am not in US. What a pity.. :( -- Tony Luo http://blog.tech4k.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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: radio buttons?
On 15 Apr 2009, at 12:54, Dave Smith wrote: Frederick Cheung wrote: On 15 Apr 2009, at 12:05, Dave Smith wrote: if i got a couple of radio buttons on my form that i want to use a published_at field rather than a boolean field how would i go about this? I know that if i'm using a boolean i can do the following. %= f.radio_button :published_at, true % Yes %= f.radio_button :published_at, false % No but what would i have to change to use the datetime field? Are you expecting people to enter a date or to choose between one of several dates ? Fred Hi, i was actually hoping for when they check the yes option is puts the current time in the field. and when they click no it is removed. Ah, so that's more than a radio button. it's some radio buttons + your favourite date input method, together with a chunk of javascript that does stuff to those input controls. The radio_button would be for a separate attribute (which might not even be a real one) to published_at Fred -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Multiple CheckBox and Radio Buttons
I am using multiple check box (more than 1 checkboxes) and a radio button and when I click the Submit button, it calls the create method it is inserting only 1 value for checkbox and also for the radio button. Could you please tell how to insert multiple check box values in create. Also, in the scaffold edit page, the default edit method displays all the fields (including checkbox and radio buttons) as text_field(text box) with only single value. Could you please tell how to populate multiple checkbox and radio buttons in the edit page with the values populating. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: SQL Server via DBI/ODBC configuration
Mike, in my experience this has been painful. Here's a few things to look for: First, make sure that TDS is set up fine. Verify it with this command: tsql -S server -U user -P password Make sure you have ruby-odbc to have ruby load the ODBC driver (think this could potentially solve your issue). My instructions on a fedora box are: RubyODBC: wget http://ch-werner.de/rubyodbc/ruby-odbc-0.9996.tar.gz tar -xvzpf ruby-odbc-0.9996.tar.gz cd ruby-odbc-0.9996 ruby extconf.rb make sudo make install Test it out again. If you have a problem with the data source, a way to test it directly is: isql -v datasource username password Hope that helps, -Harold On Apr 14, 7:21 pm, mvargo mfva...@gmail.com wrote: Dear Chris, Thank you for reponding. I tried that. I get the same error from a different stack. It finds the new sqlserver.rb from the gem you suggested. But it still barfs in DBI because it can't find the ODBC driver. I wonder if it's some kind of path thing for finding the dbd- odbc thing. It's beyond my rails capabilities to figure out how the gems find each other. I'm sure it's some lame thing (it always is!). Any other advice would be greatly appreciated. Mike subscriber = Subscriber.find(1) DBI::InterfaceError: Unable to load driver 'ODBC' from /usr/lib/ruby/gems/1.8/gems/dbi-0.4.0/lib/dbi.rb:286:in `load_driver' from /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize' from /usr/lib/ruby/gems/1.8/gems/dbi-0.4.0/lib/dbi.rb:236:in `load_driver' from /usr/lib/ruby/gems/1.8/gems/dbi-0.4.0/lib/dbi.rb:154:in `_get_full_driver' from /usr/lib/ruby/gems/1.8/gems/dbi-0.4.0/lib/dbi.rb:139:in `connect' from /home/mvargo/.gem/ruby/1.8/gems/rails-sqlserver-2000-2005- adapter-2.2.15/lib/active_record/connection_adapters/ sqlserver_adapter.rb:26:in `sqlserver_connection' On Apr 14, 11:22 am, Chris Johnson ch...@johnsonch.com wrote: Try this gem out, works for me I think your on the right path...http://github.com/rails-sqlserver/2000-2005-adapter/tree/master On Tue, Apr 14, 2009 at 12:29 PM, mvargo mfva...@gmail.com wrote: I have followed the cookbook on http://wiki.rubyonrails.org/database-support/ms-sql but am having problems with the rails part. I can connect to the database using sqsh so I think all the freetds plumbing is good. When I try to connect to the db with a rake db:migrate or just using script/ console I get this error: Client.find(:first) DBI::InterfaceError: Unable to load driver 'ODBC' from /usr/lib/ruby/gems/1.8/gems/dbi-0.4.0/lib/dbi.rb:286:in `load_driver' from /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize' from /usr/lib/ruby/gems/1.8/gems/dbi-0.4.0/lib/dbi.rb:236:in `load_driver' from /usr/lib/ruby/gems/1.8/gems/dbi-0.4.0/lib/dbi.rb:154:in `_get_full_driver' from /usr/lib/ruby/gems/1.8/gems/dbi-0.4.0/lib/dbi.rb:139:in `connect' from /usr/lib/ruby/gems/1.8/gems/activerecord-sqlserver- adapter-1.0.0.9250/lib/active_record/connection_adapters/ sqlserver_adapter.rb:47:in `sqlserver_connection' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/ connection_adapters/abstract/connection_pool.rb:223:in `send' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/ connection_adapters/abstract/connection_pool.rb:223:in `new_connection' database.yml is: development: adapter: sqlserver mode: ODBC dsn: CONTENT_STORE username: joebob password: secret So I looked into dbi.rb and I see where it throws the exception. It can't seem to get the Driver called ODBC. I do have dbd-odbc-0.2.4 installed. Seems like the dbi part is not connecting to the odbc part. Rails is running on ubuntu 8.1. Any pointers would be very welcome. Sincerely, Mike Vargo *** LOCAL GEMS *** actionmailer (2.3.2) actionpack (2.3.2) activerecord (2.3.2) activerecord-sqlserver-adapter (1.0.0.9250) activeresource (2.3.2) activesupport (2.3.2) capistrano (2.5.5) cgi_multipart_eof_fix (2.5.0) daemons (1.0.10) dbd-odbc (0.2.4) dbi (0.4.0) deprecated (2.0.1) fastthread (1.0.7) gem_plugin (0.2.3) highline (1.5.0) linecache (0.43) mongrel (1.1.5) net-scp (1.0.2) net-sftp (2.0.2) net-ssh (2.0.11) net-ssh-gateway (1.0.1) rails (2.3.2) rake (0.8.4) ruby-debug-base (0.10.3) ruby-debug-ide (0.4.5) rubygems-update (1.3.1) sqlite3-ruby (1.2.4) --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at
[Rails] Re: About haml and ruby on rail
Nilesh Kulkarni wrote: [...] code of show.html.erb and show.html.haml is in haml_and_html_file.txt attachment whth first post.. Sorry, I missed that. I'll check it out. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Passenger caching in development mode, wtf?
I've not tried this, but as a last resort you might try: touch tmp/always_restart.txt in your application’s root folder. Cheers-- Charles On Wed, Apr 15, 2009 at 3:11 AM, Frederick Cheung frederick.che...@gmail.com wrote: On Apr 15, 5:58 am, Petr Janda rails-mailing-l...@andreas-s.net wrote: This makes no difference. The problem is with mongrel is that I need the devel applications to be accessible even when im not developing, ie. client review. And id need to make a start up script in case i reboot the server to make all the mongrels start up. Its just hassle. dispatch.cgi/fcgi was ideal for simple setup in development mode where speed usually doesnt matter. Well the passenger docs imply that it should all just work: If you set RailsEnv development in your Apache configuration, then Rails will automatically reload your application code after each request You might want to ask the passenger mailing list or similar why it doesn't seem to be working for you. Fred PP Junty wrote: perhaps here: http://www.modrails.com/documentation/Users%20guide.html#RailsSpawnMe. .. but can't you use mongrel for development and passenger for production? Petr Janda wrote: I just tested with Ruby 1.8 and its the same behaviour. An clues people? -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: install error for rails-widgets
When I executed the install command, I did not get any output. The only thing I noticed after investigating my application directory is that, it created a directory in vendor/plugins/rails-widgets. However, this directory is empty. Thanks, Rick-13 wrote: This is what you should see as a result of your plugin install: /widgets 516 script/plugin install git://github.com/paolodona/rails-widgets.git Initialized empty Git repository in /Users/rick/widgets/vendor/plugins/ rails-widgets/.git/ remote: Counting objects: 78, done. remote: Compressing objects: 100% (71/71), done. remote: Total 78 (delta 8), reused 21 (delta 0) Unpacking objects: 100% (78/78), done. From git://github.com/paolodona/rails-widgets * branchHEAD - FETCH_HEAD cp /Users/rick/widgets/vendor/plugins/rails-widgets/images/ tooltip_arrow.gif /Users/rick/widgets/public/images/widgets/ tooltip_arrow.gif cp /Users/rick/widgets/vendor/plugins/rails-widgets/images/ tooltip_image.gif /Users/rick/widgets/public/images/widgets/ tooltip_image.gif cp /Users/rick/widgets/vendor/plugins/rails-widgets/javascripts/ tooltip.js /Users/rick/widgets/public/javascripts/widgets/tooltip.js Did you omit this output from your mail message or what? Was any output produced when you ran the install? On Apr 14, 2:05 pm, nmt999 nmt...@yahoo.com wrote: When i am trying to install the rails-widgets on windows vista fromhttp://wiki.github.com/paolodona/rails-widgetslocation I get an error. Please help. cd myrails-app ruby script/plugin install git://github.com/paolodona/rails-widgets.git rake widgets:setup following is the error rake aborted! Don't know how to build task 'widgets:setup' (See full trace by running task with --trace) --- Then I tried with the following command rake widgets:setup --trace following is the error --- rake aborted! Don't know how to build task 'widgets:setup' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1704:in `[]' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2026:in `invoke_task' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `top_level' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `each' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `top_level' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in `standard_exception_handling' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1999:in `top_level' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1977:in `run' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in `standard_exception_handling' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1974:in `run' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/bin/rake:31 c:/ruby/bin/rake:16:in `load' c:/ruby/bin/rake:16 -- View this message in context:http://www.nabble.com/install-error-for-rails-widgets-tp23048157p2304... Sent from the RubyOnRails Users mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/install-error-for-rails-widgets-tp23048157p23059621.html Sent from the RubyOnRails Users mailing list archive at Nabble.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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: radio buttons?
Frederick Cheung wrote: On 15 Apr 2009, at 12:54, Dave Smith wrote: %= f.radio_button :published_at, false % No i was actually hoping for when they check the yes option is puts the current time in the field. and when they click no it is removed. Ah, so that's more than a radio button. it's some radio buttons + your favourite date input method, together with a chunk of javascript that does stuff to those input controls. The radio_button would be for a separate attribute (which might not even be a real one) to published_at Fred ahh ok! thanks, is that much more difficult to implement? i have searched for examples online and in my rails books but cannot find anything. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] [ANN] rspec 1.2.4 Released
rspec version 1.2.4 has been released! Be sure to check History.rdoc and Updgrade.rdoc at http://rspec.rubyforge.org/rspec/1.2.4/ before upgrading. * http://rspec.info * http://rubyforge.org/projects/rspec * http://github.com/dchelimsky/rspec/wikis * rspec-de...@rubyforge.org Behaviour Driven Development for Ruby. Changes: ### Version 1.2.4 * bug fix * just one - update the manifest ### Version 1.2.3 * enhancements * support for specifying single examples with colon syntax. Closes #712. (Ben Mabey) * you can now say spec some_spec.rb:12 in addition to spec some_spec.rb --line 12 * run specs locally with --drb if no drb server is running. Closes #780. * still prints No server running to stderr * bug fixes * support expectations on DelegateClass (Clifford T. Matthews). Closes #48. * Fixed match_array blows up if elements can't be sorted (Jeff Dean). Closes #779. * deprecations * BaseFormatter#add_example_group (use #example_group_started instead) * ExampleGroupProxy#backtrace (use #location instead) * ExampleProxy#backtrace (use #location instead) * BaseFormatter#example_pending now expects two arguments. The third argument is deprecated. * ExampleGroupProxy#filtered_description. This was only used in one place internally, and was a confusing solution to the problem. If you've got a custom formatter that uses it, you can just use ExampleGroupProxy#description and modify it directly. * predicate_matchers (use the new Matcher DSL instead) * Spec::Matchers.create (use Spec::Matchers.define instead) * http://rspec.info * http://rubyforge.org/projects/rspec * http://github.com/dchelimsky/rspec/wikis * rspec-de...@rubyforge.org --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Can Rails I18n translate plugins ?
Hi there, can anyone tell me if it is possible for Rails' (2.3.2) I18n component to translate files *outside* of the 'app' folder (i.e. plugins in the 'vendor' folder)? Would it need any kind of hack or would files be translated following simply the standard procedure? Thanks! Tom -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Controlling concurrency
If you positively cannot have overbooking (oops, airline talk) over-selling, then all your orders have to either lock a table (using the database to enforce serialization), or they have to be serially examined in someway, such as a single order FIFO queue. You could create an observer, for example, that monitors the creation of an order, checks to see if stock (tickets, seats, CD's, whatever) is available; and gracefully back-out an order that goes over. Personally, I would be tempted to try a simple solution, like a queue of some sort first, or perhaps an observer, rather than use the database. This is one of those cases where trying to optimize too early may hurt. A simple, single, global queue may be all you need. YMMV. Cheers-- Charles On Wed, Apr 15, 2009 at 3:02 AM, Frederick Cheung frederick.che...@gmail.com wrote: On Apr 14, 10:55 pm, steveluscher goo...@steveluscher.com wrote: What do you think is the best way to prevent overselling in this case? I've considered: * Table locking (sucks) * Setting a lock file per-Product (filesystem-y and not elegantly scalable past one machine) * Setting a lock variable per-Product in a memcached store * A single-worker queue that validates and processes orders in sequence * A per Product single-worker queue that validates and processes orders in sequence * Something I haven't considered? It sort of depends where the information that only 3 more orders for Product X lives. For example if the products table has a stock_remaining column, then for me the natural thing to do would be to use optimistic locking on the products table I wrote up some possibilities at http://www.spacevatican.org/2008/6/8/dealing-with-concurrency Fred What do you think? Steve! --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] gem install mysql checking for mysql_query() in -lmysqlclie
I've seen this before but I've forgotten how to solve it. It appears that I have the mysql client libraries installed: i...@retro[08:25:55][~/] locate libmysqlclient.so /usr/lib/mysql3/mysql/libmysqlclient.so /usr/lib/mysql3/mysql/libmysqlclient.so.10 /usr/lib/mysql3/mysql/libmysqlclient.so.10.0.0 /usr/lib/mysql/libmysqlclient.so /usr/lib/mysql/libmysqlclient.so.14 /usr/lib/mysql/libmysqlclient.so.10 /usr/lib/mysql/libmysqlclient.so.10.0.0 /usr/lib/mysql/libmysqlclient.so.14.0.0 My LD_LIBRARY_PATH is: export LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.4/client64/lib:/usr/lib/mysql/ OS: Linux XYZ 2.6.18-128.1.6.el5 #1 SMP Tue Mar 24 12:05:57 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux What gives? Full gem install mysql output follows: ERROR: Error installing mysql: ERROR: Failed to build gem native extension. /home/iono/packages/ruby-1.8.7/bin/ruby extconf.rb install mysql checking for mysql_query() in -lmysqlclient... no checking for main() in -lm... yes checking for mysql_query() in -lmysqlclient... no checking for main() in -lz... yes checking for mysql_query() in -lmysqlclient... no checking for main() in -lsocket... no checking for mysql_query() in -lmysqlclient... no checking for main() in -lnsl... yes checking for mysql_query() in -lmysqlclient... no *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/home/iono/packages/ruby-1.8.7/bin/ruby --with-mysql-config --without-mysql-config --with-mysql-dir --without-mysql-dir --with-mysql-include --without-mysql-include=${mysql-dir}/include --with-mysql-lib --without-mysql-lib=${mysql-dir}/lib --with-mysqlclientlib --without-mysqlclientlib --with-mlib --without-mlib --with-mysqlclientlib --without-mysqlclientlib --with-zlib --without-zlib --with-mysqlclientlib --without-mysqlclientlib --with-socketlib --without-socketlib --with-mysqlclientlib --without-mysqlclientlib --with-nsllib --without-nsllib --with-mysqlclientlib --without-mysqlclientlib Gem files will remain installed in /home/iono/packages/gems/gems/mysql-2.7 for inspection. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] external programs
how i can follow to execute external programs: define, that they don't hung with Kernel method system or another? may be use timeout? excuse me for my bad english :) -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: radio buttons?
On 15 Apr 2009, at 15:05, Dave Smith wrote: Frederick Cheung wrote: On 15 Apr 2009, at 12:54, Dave Smith wrote: %= f.radio_button :published_at, false % No i was actually hoping for when they check the yes option is puts the current time in the field. and when they click no it is removed. Ah, so that's more than a radio button. it's some radio buttons + your favourite date input method, together with a chunk of javascript that does stuff to those input controls. The radio_button would be for a separate attribute (which might not even be a real one) to published_at Fred ahh ok! thanks, is that much more difficult to implement? i have searched for examples online and in my rails books but cannot find anything. Not massively difficult. Not a rails issue at all though - get out your html and javascript books to find out about event handling and so on. Fred -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Controlling concurrency
On Tue, Apr 14, 2009 at 2:55 PM, steveluscher goo...@steveluscher.com wrote: 1) You are selling Orders for items of various ProductVariants, belonging to one Product 2) There may be an upper limit to how many Orders you can take for any given Product What do you think is the best way to prevent overselling in this case? * Something I haven't considered? My wife sells jewelry and many pieces are one-of-a-kind. I have an inventory table with an entry for each piece, including location: web site, gallery, etc. If a customer puts that item in a cart, then the location is set to the cart id, and no one else can even see the item, much less purchase it. If the cart times out, the item is returned to inventory and becomes visible again. Maybe not directly analogous to your situation, but something to think about. :-) HTH, -- Hassan Schroeder hassan.schroe...@gmail.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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Backspace in strings and patterns
Interesting. Not what I expected. This is Ruby 1.8.6. irb irb(main):001:0 str = abx\bc = abx\bc irb(main):002:0 str.length = 5 irb(main):003:0 s = str.sub(/.\b/, '') = ab\bc irb(main):004:0 s.length = 4 irb(main):005:0 s = str.sub(/.\x08/, '') = abc irb(main):006:0 s.length = 3 irb(main):007:0 Backspace character representation in ASCII, UTF-8, etc. is 8. Jeffrey --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: external programs
you may try something along this line: timeout(10) do %x{sleep 12} end rescue Timeout::Error # Do something to handle the time out. puts The sleep command timed out end Hope that gets you going in a good direction. BenH On Apr 15, 7:41 am, Svetlana Vt rails-mailing-l...@andreas-s.net wrote: how i can follow to execute external programs: define, that they don't hung with Kernel method system or another? may be use timeout? excuse me for my bad english :) -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Controlling concurrency
On Apr 15, 3:28 pm, Charles Johnson gm.johns...@gmail.com wrote: If you positively cannot have overbooking (oops, airline talk) over-selling, then all your orders have to either lock a table (using the database to enforce serialization) I don't think things have to be quite so drastic, eg a row level lock is almost certainly enough. It does sort of depend on how the quantity information is stored (but there is almost always a better way than a table lock) Fred , or they have to be serially examined in someway, such as a single order FIFO queue. You could create an observer, for example, that monitors the creation of an order, checks to see if stock (tickets, seats, CD's, whatever) is available; and gracefully back-out an order that goes over. Personally, I would be tempted to try a simple solution, like a queue of some sort first, or perhaps an observer, rather than use the database. This is one of those cases where trying to optimize too early may hurt. A simple, single, global queue may be all you need. YMMV. Cheers-- Charles On Wed, Apr 15, 2009 at 3:02 AM, Frederick Cheung frederick.che...@gmail.com wrote: On Apr 14, 10:55 pm, steveluscher goo...@steveluscher.com wrote: What do you think is the best way to prevent overselling in this case? I've considered: * Table locking (sucks) * Setting a lock file per-Product (filesystem-y and not elegantly scalable past one machine) * Setting a lock variable per-Product in a memcached store * A single-worker queue that validates and processes orders in sequence * A per Product single-worker queue that validates and processes orders in sequence * Something I haven't considered? It sort of depends where the information that only 3 more orders for Product X lives. For example if the products table has a stock_remaining column, then for me the natural thing to do would be to use optimistic locking on the products table I wrote up some possibilities at http://www.spacevatican.org/2008/6/8/dealing-with-concurrency Fred What do you think? Steve! --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Return to previous page
Is there a 'rails way' to allow easy navigation to the previous page or should we use parameters and 'ifs'? I'm talking about, for example, a 'Back' button that links to differente pages depending the previous page. 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: gem install mysql checking for mysql_query() in -lmysqlclie
/home/iono/packages/gems/gems/mysql-2.7 for inspection. Might give some clues. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Backspace in strings and patterns
On Apr 15, 4:13 pm, Jeffrey L. Taylor r...@abluz.dyndns.org wrote: Interesting. Not what I expected. This is Ruby 1.8.6. Inside a rexexp, \b is not a backspace (except in a character class). it means word boundary. Fred irb irb(main):001:0 str = abx\bc = abx\bc irb(main):002:0 str.length = 5 irb(main):003:0 s = str.sub(/.\b/, '') = ab\bc irb(main):004:0 s.length = 4 irb(main):005:0 s = str.sub(/.\x08/, '') = abc irb(main):006:0 s.length = 3 irb(main):007:0 Backspace character representation in ASCII, UTF-8, etc. is 8. Jeffrey --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Backspace in strings and patterns
Jeffrey L. Taylor wrote: Interesting. Not what I expected. This is Ruby 1.8.6. ask ruby talk or core? -=r -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] RoR developer req in DC area with my direct client
Hi, I am Sr. Resource Manager at Marlabs and we are seeking a RoR developer for our direct client in DC area. Pl advise if you are interested. The req is as follows: - Sr. Developer - Ruby on Rails Job Description Seeking strong Sr. Developer profiles for a client opp. In Washington D.C. area (Virginia). Below are the basic requirements: -min 5 years OOD -CSS + html experience - Strong knowledge of JavaScript and comfortable with Ajax - min 2 years ROR experience - unit test experience Knowledge of legal technologies domain is a plus (EDRM, ESI, etc.) Let me know if any additional info is required Salary: - DOE Pl contact me at vi...@marlabs.com, if you are interested. regards, Vikas --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] [ANN] Rails plugin to improve log format
I have created a Rails plugin to improve the log file format. (It also adds an optional “Exception” parameter to the warn() and error() methods to print a stack trace automatically.) It's available here: http://github.com/pauldowman/better_logging ___Improved log format___ It adds severity level (with colour, if ActiveRecord::Base.colorize_logging == true), hostname and process ID to each log line, and it and adds warn() and exception() methods that take an exception as an argument and print the stack trace. For example, here’s how the default format looks: Session ID: 7eeb00aa62b395698a28bf033e56b7c5 Parameters: {action=show, id=1, controller=people} User Load (0.4ms) SELECT * FROM `users` WHERE (id = '1') LIMIT 1 User Columns (2.1ms) SHOW FIELDS FROM `users` Rendering template within layouts/application Rendering people/show Rendered layouts/_head (3.1ms) Rendered layouts/_navigation (2.2ms) Adding Cache-Control header Completed in 164ms (View: 116, DB: 21) | 200 OK [http://localhost/ people/1] Here’s how the same thing would look with the better_logging plugin installed in development mode (it looks best with a proportional font). Note that the severity (INFO, WARN, ERROR, etc), is printed in colour (if colour is enabled for the log, which it is by default in development mode). INFO Session ID: 7eeb00aa62b395698a28bf033e56b7c5 INFO Parameters: {action=show, id=1, controller=people} DEBUG User Load (0.4ms) SELECT * FROM `users` WHERE (id = '1') LIMIT 1 DEBUG User Columns (2.1ms) SHOW FIELDS FROM `users` INFO Rendering template within layouts/application INFO Rendering people/show DEBUG Rendered layouts/_head (3.1ms) DEBUG Rendered layouts/_navigation (2.2ms) INFO Adding Cache-Control header INFO Completed in 164ms (View: 116, DB: 21) | 200 OK [http:// localhost/people/1] And here’s how it would look with the better_logging plugin installed in production mode, on a host named “akash”, with process id 27471: akash.27471 13:27:04 INFO Session ID: 7eeb00aa62b395698a28bf033e56b7c5 akash.27471 13:27:04 INFO Parameters: {action=show, id=1, controller=people} akash.27471 13:27:04 INFO Rendering template within layouts/ application akash.27471 13:27:04 INFO Rendering people/show akash.27471 13:27:04 INFO Adding Cache-Control header akash.27471 13:27:04 INFO Completed in 164ms (View: 116, DB: 21) | 200 OK [http://localhost/people/1] And here’s how it would look in production mode on a host with a long name. This host name is “myreallybigserver-7.mydomain.com”. igserver-7.27471 13:27:04 INFO Session ID: 7eeb00aa62b395698a28bf033e56b7c5 igserver-7.27471 13:27:04 INFO Parameters: {action=show, id=1, controller=people} igserver-7.27471 13:27:04 INFO Rendering template within layouts/ application igserver-7.27471 13:27:04 INFO Rendering people/show igserver-7.27471 13:27:04 INFO Adding Cache-Control header igserver-7.27471 13:27:04 INFO Completed in 164ms (View: 116, DB: 21) | 200 OK [http://localhost/people/1] Note that the hostname process ID is added to the beginning of each line of a multi-line log statement. So even if you call logger.error() with a string that has newlines in it, the host process ID will be added to each line, not only the first. This is so that you can filter your log with a regular expression like /^igserver-7\.27471/ and not miss lines. Improved warn() and error() methods The warn() and error() methods now allow an Exception object to be given as an optional second parameter. If the exception is given, then the stack trace will be automatically logged. For example: begin # do something that raises an exception rescue Exception = e log.error Oops, e end The above code will log “Oops”, and then log the stack trace. ___Why?___ Adding severity: All lines printed to the log have a “severity” level, this can be “DEBUG”, “WARN”, “ERROR”, etc. Normally this isn’t included in the log output, so it’s impossible to search a log file for warnings or errors, or filter based on severity, and it’s just a useful thing to see. Adding hostname and process ID Normally, when not in development mode, a Rails app consists of more than one Rails process responding to requests at the same time. Those processes may be printing lines to the log at the same time, and it’s hard to know which process printed a certain line. Also, it’s common to have multiple servers working in parallel, and a user’s session might involve requests to multiple servers. If the log files are combined it’s useful to know which process on which server printed a given line. This makes it possible to filter a Rails log to show output from one process only, and to combine the log files from multiple servers. The hostname is truncated (by default to 10 characters but this is configurable). The end of the hostname is printed, rather than the beginning, because often the end of the hostname is more unique. Adding a
[Rails] Re: HTTP Digest Authentication PUT DELETE problem. Bug ?
This is a bug in Rails 2.3.2. I've created a Lighthouse ticket for it (#2490) and created a patch that fixes it. It will probably help get the fix into a release if others acknowledge the problem and can verify my patch fixes it for them. https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2490-http-digest-auth-uses-wrong-request-method-for-put-delete#ticket-2490-1 On Mar 27, 4:51 pm, Scott Ahten lightandshado...@mac.com wrote: I've run into the same problem. GET and POST work find, but PUT and DELETE repeatedly asks for login information and never succeeds. On Mar 19, 6:47 pm, greq gdo...@gmail.com wrote: Hi all, I've got a problem with HTTP Digest Authentication after upgrading Rails to 2.3.2. It seems that it is broken for PUT and DELETE requests method. --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: external programs
Excuse the self reply - something that comes in handy is to capture the exit status of the external application. To do this use $?.exitstatus %x{echo Hello World} puts $?.exitstatus On Apr 15, 8:15 am, BenH benh...@gmail.com wrote: you may try something along this line: timeout(10) do %x{sleep 12} end rescue Timeout::Error # Do something to handle the time out. puts The sleep command timed out end Hope that gets you going in a good direction. BenH On Apr 15, 7:41 am, Svetlana Vt rails-mailing-l...@andreas-s.net wrote: how i can follow to execute external programs: define, that they don't hung with Kernel method system or another? may be use timeout? excuse me for my bad english :) -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Complex forms: only one level of “arra yness” is allowed?
Thanks Fred. Considering there is a bit of wizardry that needs to be done and that Rails doesn't include helpers to do this simply, does it mean it is not recommended to build such complex forms? I am not very experienced with Rails, but I love the fact it is very clean and I feel a bit cautious having to generate keys manually. PJ On Apr 15, 9:05 am, Frederick Cheung frederick.che...@gmail.com wrote: On Apr 15, 1:07 am, PJ camillieri...@gmail.com wrote: model_a[model_b_attributes][][model_c_attributes][][an_attribute] But it doesn't seem to work. I read herehttp://guides.rubyonrails.org/form_helpers.html that only one level of “arrayness” is allowed and that I should use hashes instead, but I am not quite sure I understand how to do it. Do you have any idea? What that comment is saying is that you can replace an array eg [a,b,c] with a hash eg {1 = a, 2= b, 3=c} Generating those keys is up to your client side code, approaches included using a number you increment or going for some unique thing you generate on the spot (eg time in milliseconds concatenated with a random number) so that you don't have to keep track of how many fields and what not you have created clientside. Fred --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: a client and a contractor are both users, share some attrib but not others, how to implement as users
Contnuing your theme of each column being its own table - there is some sort of merit in thinking that way - at least initially. has ittle to do with rails of course, but just as a general framework of thought. If you think conceptually about things that are hard to to in relational databases and things that are easy to do. It is, for example, much harder to add a new column than a new row to an exisiting database. So, if you have a very abstracted design like this.. Entity (entity id, entity name) Rowdata (rowdataid, domainid,entityid, colname,colvalue) Domain (domainid, domain_data_type) Then you could simply add new rows into the domain table and new rows into the Rowdata table every time you want to extend the schema. This of course is far too simplistic an approach - I have mixed the schema up with the values, so it is hopelessly unnormalized), but it sort of sets the mind off onto asking the questions about when we need ultimate flexibility vs when something just needs to work simply and quickly. The answers are never as simple as you think! However, I would also say, don't dwell on the what might possible ne... but implement what is most reasonable. Of course it is judgement, but when developing we always have to use our judgement. When we have made a design decision about such a thorny issue, document it so you don't have to revisit the reasons. You may have to revisit the decision, so it would be handy to know why the decision was made the way it was. I do have lots of rules (of thumb and otherwise) around this stuff - but that's how I make my living! http://businessanditarchitecture.blogspot.com C On Apr 14, 9:00 pm, Nik niks...@gmail.com wrote: Thank you vERY much, Chris! -- One often has moments where he/she notices something that may or may not be a real worry, but is too doubtful to speak of it. I have each of your described considerations pulsing through my head each time I think of the future of how these models will be in case of modification or deletion, but it was too vague as I had no substance to fill even a hypothetical example. But your spelling them out certainly relieved me a little. Having been thinking of these (potential) problems, it compelled me to think whether there's a kind of tutorial I can read up on some rules of thumb of deciding if table or no table and so on. I thought, a few days, ago, that in the worst case, if I made each column its own table, a Phone Model, a Gender Model, an Areacode Model, etc, basically every thing would have its own model, though unrealistically complex, it'd work ( sort of conveying that the more orthogonal bases you have, the better; in Linear Algebra). So building up a network of tables each holding exactly one column, I was thinking that, some empirical/theory-based rules for combining these hypothetical single column tables. And your Socratic method (I hope I am using this phrase right) isn't bad, at all. I will discuss with my supervisor for possible scenarios that call for minor/major table alterations, then I will begin to ask these questions myself :) Thanks again! Thank you, everyone! On Apr 14, 11:16 am, Chris Bird seabir...@gmail.com wrote: This is a specific case of a more general problem - how to manage inheritance in these kinds of models. There are several things to think about here. However they break down fairly easily. I'll use your specific example, but some of the observations might not make a whole lot of sense. So I will pose some questions and then give some guiding thinking. This will not be RAILS specific thinking, but bringing experience from enterprise class systems where we have things like this all the time. You can generalize the thinking questioning when the structures are even deeper. Which attributes are common between Clients/Contractors? - If there are a lot of attributes in common you might get away with a single table, and a type field in the table. Are there relationships identified that both Clients and Contractors can have? - If for example you had a security tag table and it needed to have the associated person, and it doesn't matter if the person is a client or a contractor, then it might be worth managing that relationship via a separate table (a Person table). Do you expect to add new kinds of things? - Are Clients and Contractors the only types of Persons? Will you need to add something else in the future - e.g. Overseas Contractor which is like a Contractor but has a bunch more fields, its own processes, screens, etc. If so you may want to break into multiple tables. Do you expect to have a role concept that cuts across Clients/ Contractors? - Similar to relationships above, but let's imagine you also have roles like administrator, user, ... If those roles are independent of the Client/Contractor status, then again you might want separate tables. Do you have to worry about
[Rails] Re: RSS feed consumption.
I thought that I would first try out activeresource manually and discover how things are done. I have a valid RSS feed from the Bank of Canada that I wish to pull from. I have defined my class as: class ForexCASource ActiveResource::Base self.site = 'http://www.bankofcanada.ca/rss/fx/noon/fx-noon-all.xml' end Inside the console I try to do this: forex = ForexCASource.find or forex = ForexCASource.find(:all) and I receive a 404 error in both cases. I can reach the site url given in the resource class from a Firefox instance running on the same host using cut and paste so the url in the site assignment is valid. What am I missing? -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Revision: Background image contained in stylesheet
I realized that I should have included a bit more information in my previous post, so here's the revision. application.html.erb is correctly finding the stylesheet for my project via %= stylesheet_link_tag 'style1' %. My webpages reflect the styling properly with a few exceptions .. the most notable being some .jpg images defined for background do not display at all. I have those images in public/images. The following is the stylesheet code containing the reference to the image. #navigation { width: 180px; height: 484px; background: #7da5a8 url(nav-bg.jpg) no-repeat; } I tried the absolute path to the image above per: background: #7da5a8 url(C:\InstantRails\rails_apps\getdowninthevalley\public\images\nav-bg.jpg) no-repeat; but that didn't work either This worked fine until I retrofitted the webpages into the Rails framework (which I really like, but which I'm relative new to). If anyone knows the solution, I would really appreciate it ... thanks in advance! Rubio -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: gem install mysql checking for mysql_query() in -lmysqlclie
I've had this issue before - I'm pretty sure I ended up solving it by installing the mysql-devel package first. On Apr 15, 10:33 am, Rob Redmon rails-mailing-l...@andreas-s.net wrote: I've seen this before but I've forgotten how to solve it. It appears that I have the mysql client libraries installed: i...@retro[08:25:55][~/] locate libmysqlclient.so /usr/lib/mysql3/mysql/libmysqlclient.so /usr/lib/mysql3/mysql/libmysqlclient.so.10 /usr/lib/mysql3/mysql/libmysqlclient.so.10.0.0 /usr/lib/mysql/libmysqlclient.so /usr/lib/mysql/libmysqlclient.so.14 /usr/lib/mysql/libmysqlclient.so.10 /usr/lib/mysql/libmysqlclient.so.10.0.0 /usr/lib/mysql/libmysqlclient.so.14.0.0 My LD_LIBRARY_PATH is: export LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.4/client64/lib:/usr/lib/mysql/ OS: Linux XYZ 2.6.18-128.1.6.el5 #1 SMP Tue Mar 24 12:05:57 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux What gives? Full gem install mysql output follows: ERROR: Error installing mysql: ERROR: Failed to build gem native extension. /home/iono/packages/ruby-1.8.7/bin/ruby extconf.rb install mysql checking for mysql_query() in -lmysqlclient... no checking for main() in -lm... yes checking for mysql_query() in -lmysqlclient... no checking for main() in -lz... yes checking for mysql_query() in -lmysqlclient... no checking for main() in -lsocket... no checking for mysql_query() in -lmysqlclient... no checking for main() in -lnsl... yes checking for mysql_query() in -lmysqlclient... no *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/home/iono/packages/ruby-1.8.7/bin/ruby --with-mysql-config --without-mysql-config --with-mysql-dir --without-mysql-dir --with-mysql-include --without-mysql-include=${mysql-dir}/include --with-mysql-lib --without-mysql-lib=${mysql-dir}/lib --with-mysqlclientlib --without-mysqlclientlib --with-mlib --without-mlib --with-mysqlclientlib --without-mysqlclientlib --with-zlib --without-zlib --with-mysqlclientlib --without-mysqlclientlib --with-socketlib --without-socketlib --with-mysqlclientlib --without-mysqlclientlib --with-nsllib --without-nsllib --with-mysqlclientlib --without-mysqlclientlib Gem files will remain installed in /home/iono/packages/gems/gems/mysql-2.7 for inspection. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Revision: Background image contained in stylesheet
On Wed, Apr 15, 2009 at 9:32 AM, Rob Blimploid rails-mailing-l...@andreas-s.net wrote: I realized that I should have included a bit more information in my previous post, so here's the revision. application.html.erb is correctly finding the stylesheet for my project via %= stylesheet_link_tag 'style1' %. My webpages reflect the styling properly with a few exceptions .. the most notable being some .jpg images defined for background do not display at all. I have those images in public/images. The following is the stylesheet code containing the reference to the image. #navigation { width: 180px; height: 484px; background: #7da5a8 url(nav-bg.jpg) no-repeat; } Your path needs to specify the full relative path. url(/images/nav-bg.jpg) Looks like you're missing 'images/' I tried the absolute path to the image above per: background: #7da5a8 url(C:\InstantRails\rails_apps\getdowninthevalley\public\images\nav-bg.jpg) no-repeat; but that didn't work either This worked fine until I retrofitted the webpages into the Rails framework (which I really like, but which I'm relative new to). If anyone knows the solution, I would really appreciate it ... thanks in advance! Rubio -- Posted via http://www.ruby-forum.com/. -- Robby Russell Chief Evangelist, Partner PLANET ARGON, LLC design // development // hosting w/Ruby on Rails http://planetargon.com/ http://robbyonrails.com/ http://twitter.com/planetargon aim: planetargon +1 503 445 2457 +1 877 55 ARGON [toll free] +1 815 642 4068 [fax] --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Complex forms: only one level of “arra yness” is allowed?
On Apr 15, 5:09 pm, PJ camillieri...@gmail.com wrote: Thanks Fred. Considering there is a bit of wizardry that needs to be done and that Rails doesn't include helpers to do this simply, does it mean it is not recommended to build such complex forms? I am not very experienced with Rails, but I love the fact it is very clean and I feel a bit cautious having to generate keys manually. There is the nested forms stuff in rails 2.3 (unfortunately not yet documented in the guide). Fred PJ On Apr 15, 9:05 am, Frederick Cheung frederick.che...@gmail.com wrote: On Apr 15, 1:07 am, PJ camillieri...@gmail.com wrote: model_a[model_b_attributes][][model_c_attributes][][an_attribute] But it doesn't seem to work. I read herehttp://guides.rubyonrails.org/form_helpers.html that only one level of “arrayness” is allowed and that I should use hashes instead, but I am not quite sure I understand how to do it. Do you have any idea? What that comment is saying is that you can replace an array eg [a,b,c] with a hash eg {1 = a, 2= b, 3=c} Generating those keys is up to your client side code, approaches included using a number you increment or going for some unique thing you generate on the spot (eg time in milliseconds concatenated with a random number) so that you don't have to keep track of how many fields and what not you have created clientside. Fred --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: gem install mysql checking for mysql_query() in -lmysqlclie
Roger Pack wrote: /home/iono/packages/gems/gems/mysql-2.7 for inspection. Might give some clues. Duh. This is what worked: cd /home/iono/packages/gems/gems/mysql-2.7 ruby extconf.rb --with-mysql-config=/usr/bin/mysql_config Thanks for such speedy help!! R -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: gem install mysql checking for mysql_query() in -lmysqlclie
Rob Redmon wrote: Roger Pack wrote: /home/iono/packages/gems/gems/mysql-2.7 for inspection. Might give some clues. Duh. This is what worked: cd /home/iono/packages/gems/gems/mysql-2.7 ruby extconf.rb --with-mysql-config=/usr/bin/mysql_config Thanks for such speedy help!! R For completeness, I then did (as per README.html): make make install Testing ActiveRecord through mysql now seems to work well. R -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] hpricot bug?
I get an error in the hpricot-gem on Windows XP sp3. I have tested different versions of it and combined them with different versions of sequel (including the latest of both). The error triggers on the line when I do: require ’hpricot’. The line that causes the error in the hpricot-gem in the file elements.rb (line 395) looks like this: nth = proc { |num,i| self.position == num.to_i } What is proc for kind of function? Maybe the gem or component that defines proc is out of sync with hpricot ? NOTE: I have the same code and gem versions running on debian linux working fine, and it also worked nicely before on windows. I run ruby 1.8.6 and installed it with the one-click installer for Windows. Best regards! Kristofer, Sweden ArgumentError in Admin portal srv propController#srv_prop_cmd wrong number of arguments (0 for 1) RAILS_ROOT: F:/srv/dreamgallery/content/v400 Application Trace | Framework Trace | Full Trace f:/ruby/lib/ruby/gems/1.8/gems/hpricot-0.6.164-x86-mswin32/lib/hpricot/elements.rb:395:in `proc' f:/ruby/lib/ruby/gems/1.8/gems/hpricot-0.6.164-x86-mswin32/lib/hpricot/elements.rb:395 f:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' f:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' f:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require' f:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in' f:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require' f:/ruby/lib/ruby/gems/1.8/gems/hpricot-0.6.164-x86-mswin32/lib/hpricot/traverse.rb:1 f:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' f:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' f:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require' f:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in' f:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require' f:/ruby/lib/ruby/gems/1.8/gems/hpricot-0.6.164-x86-mswin32/lib/hpricot.rb:23 f:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' f:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' f:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require' f:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in' f:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require' app/models/db_helper.rb:1 app/models/exhibit_node.rb:132:in `updateexhibitnodes_internal' app/models/exhibit_node.rb:119:in `updateexhibitnodes_with_params' app/controllers/admin_portal_srv_prop_controller.rb:118:in `srv_prop_cmd' f:/ruby/lib/ruby/gems/1.8/gems/hpricot-0.6.164-x86-mswin32/lib/hpricot/elements.rb:395:in `proc' f:/ruby/lib/ruby/gems/1.8/gems/hpricot-0.6.164-x86-mswin32/lib/hpricot/elements.rb:395 f:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' f:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' f:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require' f:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in' f:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require' f:/ruby/lib/ruby/gems/1.8/gems/hpricot-0.6.164-x86-mswin32/lib/hpricot/traverse.rb:1 f:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' f:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' f:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require' f:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in' f:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require' f:/ruby/lib/ruby/gems/1.8/gems/hpricot-0.6.164-x86-mswin32/lib/hpricot.rb:23 f:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' f:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' f:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require' f:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in' f:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require' f:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:382:in `load_without_new_constant_marking' f:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:382:in `load_file'
[Rails] Re: Revision: Background image contained in stylesheet
Robby Russell wrote: On Wed, Apr 15, 2009 at 9:32 AM, Rob Blimploid rails-mailing-l...@andreas-s.net wrote: The following is the stylesheet code containing the reference to the image. #navigation { width: 180px; height: 484px; background: #7da5a8 url(nav-bg.jpg) no-repeat; } Your path needs to specify the full relative path. url(/images/nav-bg.jpg) Looks like you're missing 'images/' Rubio -- Posted via http://www.ruby-forum.com/. -- Robby Russell Chief Evangelist, Partner PLANET ARGON, LLC design // development // hosting w/Ruby on Rails Thanks for the reply .. I changed it to: url(../images/nav-bg.jpg) and it now works beautifully. Thanks for taking the time to address this problem ! -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Newbie Model Question
I'm building a shop in rails as a learning excercise. I've got to the last part when I'm sending out e-mail order confirmations. The e-mails contain a list of each line item the customer ordered, I also want to display the catgory name the customer ordered from. The database is setup: Category Product Line_item. So I want to navigate back from line_item product category so i can display the category name in the email however im not sure how I tell it to find the category name from the item. Be greatful for anyhelp. --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Newbie Model Question
On Apr 15, 2009, at 10:09 AM, Nicktabs wrote: I'm building a shop in rails as a learning excercise. I've got to the last part when I'm sending out e-mail order confirmations. The e-mails contain a list of each line item the customer ordered, I also want to display the catgory name the customer ordered from. The database is setup: Category Product Line_item. So I want to navigate back from line_item product category so i can display the category name in the email however im not sure how I tell it to find the category name from the item. Be greatful for anyhelp. @line_item.product.category.name Assuming all the associations are setup correctly. You can also set it up using :through so that you can just to @line_item.category.name -philip --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: RSS Feed parsing problem
On 12 Apr., 22:02, Nick Hoyle rails-mailing-l...@andreas-s.net wrote: Nick Hoyle wrote: hi thanks for the reply, was much needed. I knew what i was trying to do which was like you say call each of the items in the array i just wasnt sure how to do it, and attempted a similar type of loop but had no luck. I will look into this and see if i can achieve what i want Thanks alot nick just another quick question how would i able to output each parsed feed from the array @feeds[] in a view? You would do something like this: ul id=feeds %- @feeds.each do |feed| -% li%= feed.channel.title %/li %- end -% /ul Voila, a list of feed titles. :) -- Best regards, David Knorr http://twitter.com/rubyguy --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Return to previous page
On 15 Apr., 17:18, Juan Kinunt rails-mailing-l...@andreas-s.net wrote: Is there a 'rails way' to allow easy navigation to the previous page or should we use parameters and 'ifs'? I'm talking about, for example, a 'Back' button that links to differente pages depending the previous page. You can easily make a back button like this: %= button_to Back, :back % button_to will pass the second argument (:back) on to url_for, and as you can see in the documentation (http://api.rubyonrails.org/classes/ ActionView/Helpers/UrlHelper.html#M001564), :back will be translated to request.env[HTTP_REFERER] or javascript:history.back() if referer is blank. That's it! -- Best regards, David Knorr http://twitter.com/rubyguy --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Generating a css file from ruby code
Hi all! I'm playing around with an app at the moment in which users can specify their own style settings for the majority of the HTML on their profile through selecting some form options. Alternatively they can upload a stylesheet of thier own if they have CSS experience. I thought of a couple of different way of doing this but the most logical way seemed to be creating a seperate stylesheet for each user in the model and calling this stylesheet when the page is rendered. I've created a plugin which takes a ruby hash and creates a hunk of text which is then written to a css file. http://github.com/GavinM/css_writer/tree/master I'm just curious as to whether anyone can think of a better way of doing this? Also - this is my first plugin. I would welcome any feedback/ constructive criticism thanks -:) --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Injecting Ruby code into a javascript file?
Hi, as far as I know it's possible to inject Ruby code into javascript code if the javascript code is included in a view/page. But is this also possible when the javascript code is in a separate .js file that is located in the folder public/javascripts? Thanks for your help! Tom -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Controlling concurrency
@Fred: The information that only n more products exist will come from (@product.order_limit - @product.orders.count) = n. It's a bit more complicated than that, because I plan to have optional per- ProductVariant limits too, but let's leave it there for now. @Fred @Hassan: I don't really want to have unsold ProductVariants hanging around in the database, because the availability of ProductVariants is largely procedural. If the order_limit on the Product as a whole was 20, the order_limit on ProductVariant A was 10, and ProductVariant B had no order_limit, then I'd end up with a whole lot of questions as to how many unsold ProductVariants to create of each type, and which ones to destroy when others were sold. Bah, too much mess! @Charles: I like the idea of an OrderTaker global queue, but global queue means worker process, and worker process means extra messy infrastructure, right? I'm all for it, I'm just wondering if anyone has a better mousetrap. @Fred: Row-level locks are out of the question, since I'm not interested in blocking updates to a given row, but the creation of rows that don't yet exist in the Orders table. That said, I found this today – named locks in MySQL. It's a database-specific solution, but perhaps an easy one? http://gist.github.com/95977 Named locks in MySQL: http://dev.mysql.com/doc/refman/5.0/en/miscellaneous-functions.html#function_get-lock Shopify's locking implementation: http://github.com/Shopify/locking/blob/835469ed48f4c2de95856fe2f221eaa624b267a2/lib/locking.rb --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Best framework for graphs and charts
I have some data in a bunch of tables that I would like to display in a set of graphs. I've been looking at the Google Visualization API, Ziya and Fusioncharts - they all look nice but it would feel better to go with something more Rubyesque ;) So far I've looked at Gruff and Scruffy. Gruff seems to be the most active of the two. Any opinions? 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Injecting Ruby code into a javascript file?
Philip Hallstrom wrote: [...] Or consider setting some initial JS objects or JSON strings that your JS methods can look at when doing their thing. If you do it this way, the browser can cache the JS and not hammer your server. I highly recommend this approach rather than dynamically generating JS. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Complex forms: only one level of “ arrayn ess” is allowed?
PJ wrote: [...] The natural indexing should (I think) be: model_a[model_b_attributes][][model_c_attributes][][an_attribute] But it doesn't seem to work. [...] There is a bug in Rails at least up to 2.2.2 that you may be running into. I reported it on this list around Christmas 2008. If you search the archives for my name around that time, you will find the ensuing discussion and a patch that Fred submitted for the bug. Good luck! Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: ROR performance for milions pageviews/month
Tom, Check Joyent's article on LinkedIn scaling (Scale Rails to 1 Billion Pageviews): http://www.joyent.com/a/scale-rails-to-1-billion-pageviews Also, we're currently revamping a couple very large sites using rails, so we're quite confident on its performance. (vc tá em SP?) Cheers, Sazima On Apr 14, 2:26 pm, Tom Lobato tomlob...@gmail.com wrote: Hi all! I`ll rewrite a 10 years old site, written in asp/mysql (www.motonline.com.br). Now it has one milion page views a month, and we can hope it grows after rewrite. Well, I know several ror sites, but have no idea about its access stats. I already use ror for smaller projects and only need to confirm if ror can satisfy the performance demands for this. Can you comment about the ror performance for such a page view scale and/or point to some cases or statistics from existing sites? Thank you, Tom Lobato --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Associations, named_scope, and active records
Hello all, We are converting our application so that user-generated content such as votes, photos, users, comments, etc are all disabled instead of deleted. This serves us better as administrators of the site as well as fits into a UI redesign coming later that will include undo functionality. The question I have is would it be better to place the active=true condition part of all my associations I already have in place (little work), or do I strip my associations down to barebones and build named_scopes for my active state, and any other states? The problem here is I would need to append nearly all calls to photo.votes, photo.comments, project.photos, project.votes, etc with .active (much more work). Which is the better method in the long run? Thanks guys. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Associations, named_scope, and active records
Makes sense just to add conditions to the associations so: class Photo has_many :votes, :conditions = ['active = ? ', true] end I presume this is what you're planning on doing at the moment? Less work and I doubt the scope would perform noticeably better (if at all) ? Why not try both methods and check the speed of each query? On Apr 15, 9:58 pm, Bryan Corey rails-mailing-l...@andreas-s.net wrote: Hello all, We are converting our application so that user-generated content such as votes, photos, users, comments, etc are all disabled instead of deleted. This serves us better as administrators of the site as well as fits into a UI redesign coming later that will include undo functionality. The question I have is would it be better to place the active=true condition part of all my associations I already have in place (little work), or do I strip my associations down to barebones and build named_scopes for my active state, and any other states? The problem here is I would need to append nearly all calls to photo.votes, photo.comments, project.photos, project.votes, etc with .active (much more work). Which is the better method in the long run? Thanks guys. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Controlling concurrency
On Apr 15, 8:36 pm, steveluscher goo...@steveluscher.com wrote: @Fred: Row-level locks are out of the question, since I'm not interested in blocking updates to a given row, but the creation of rows that don't yet exist in the Orders table. That said, I found this Actually that's not true (and mentioned in the blog post I linked). You can lock the row corresponding to a given product, even if you are not going to update that product, purely as a synchronization mechanism (and in that sense it is similar to the named lock stuff). Fred today – named locks in MySQL. It's a database-specific solution, but perhaps an easy one? http://gist.github.com/95977 Named locks in MySQL:http://dev.mysql.com/doc/refman/5.0/en/miscellaneous-functions.html#f... Shopify's locking implementation:http://github.com/Shopify/locking/blob/835469ed48f4c2de95856fe2f221ea... --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Model Accessor Does Not Work Until After Reload?
Anyone have any insight into why this would be happening? Please see pastie: http://pastie.org/447786 --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Unknown Action error while updating record
I understand other people have had trouble using :action = 'update' with form_tag... but I haven't figured it out yet... here is my declaration of the form: % form_tag :action = 'update', :html = {:method = put} do % I tried just using % form_tag :action = 'update' % do, along with other structures... It just says UNKNOWN ACTION since it is trying to use the id as the action... Can anyone help?? I would like to keep it as a form_tag though. Thanks in advance for the help --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Getting Started with Rails - post_comment_url
Hi, Thanks for a wonderful Getting Started with Rails. I am up to the last section and just added the comments part. So while testing and looking over comments_controller.rb; I see the reference to post_comment_url calll where is this defined. Below is the message I am getting. Thanks ActionController::RoutingError (post_comment_url failed to generate from {:post_id=#Post id: 1, name: lin, title: post 1, content: content 1, created_at: 2009-04-15 16:56:44, updated_at: 2009-04-15 16:56:44, :action=show, :id=#Comment id: nil, commenter: jake lin, body: this is a new comment, post_id: 1, created_at: nil, updated_at: nil, :controller=comments}, expected: {:action=show, :controller=comments}, diff: {:post_id=#Post id: 1, name: lin, title: post 1, content: content 1, created_at: 2009-04-15 16:56:44, updated_at: 2009-04-15 16:56:44, :id=#Comment id: nil, commenter: jake lin, body: this is a new comment, post_id: 1, created_at: nil, updated_at: nil}): (eval):16:in `post_comment_url' app/controllers/comments_controller.rb:18:in `create' --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Unknown Action error while updating record
Hi, I have a form using the following syntax, and it works just fine: % form_tag({:action = :process_form}, :id = 'contact') do % Brandon -Original Message- From: rubyonrails-talk@googlegroups.com [mailto:rubyonrails- t...@googlegroups.com] On Behalf Of josh.rach...@gmail.com Sent: Wednesday, April 15, 2009 4:12 PM To: Ruby on Rails: Talk Subject: [Rails] Unknown Action error while updating record I understand other people have had trouble using :action = 'update' with form_tag... but I haven't figured it out yet... here is my declaration of the form: % form_tag :action = 'update', :html = {:method = put} do % I tried just using % form_tag :action = 'update' % do, along with other structures... It just says UNKNOWN ACTION since it is trying to use the id as the action... Can anyone help?? I would like to keep it as a form_tag though. Thanks in advance for the help --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Rails 2.3
Hello, I've been looking on the Internet for how to use libxml within Rails. What I'm seeing is a little confusing. If you install the libxml gem, will Rails automatically use that because its installed or do you have to explicitly set libxml to be the default after you've installed it? This posting http://www.coffeepowered.net/2009/03/16/things-to-do-when-upgrading-to-rails-23/ Says to set this in the environment file. 1. ActiveSupport::XmlMini.backend = 'LibXML' But when I do that my app crashes. Anyone have any experience with this? thanks, binh -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Using module methods in Rake task model?
Hello, I'm trying to use some methods I'm defining in a module in a model and my rake task. How can I do this? Any help would be appreciated. I've currently got the following, but my rake task can't access the methods in my module. Instead, I get.. undefined local variable or method `report_csv_process' for #Object:0x284f9e8 /lib/module/order_process module order_process def process_order(id) #do stuff end /lib/tasks/ordering.rake include order_process namespace :send_report do task :order = :environment do process_order(id) end end /app/models/segment.rb class Segment ActiveRecord::Base include report_csv_process bla bla 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Rails and Sphinx
Hi, i'm currently using ferret+acts_as_ferret for doing some searches in the db (not so big for now, just 40k~ records, but they will be near 2M+ soon). For now ferret it's working quite well, but sometimes i've indexes corrupted (i use it's drb server in production) and i've to rebuild all the indexes, so i've bad indexes, angry users and time spent to make it right. I'm looking at sphinx and it seems the answers to this problems, as it seems that it doesn't have this such of problems. But i've seen that i've to remake indexes everytime (/hour or less).. does it take a lot to rebuild them? Is there anyone who use shpinx in production? Another big question about it is if it's possible to create custom indexes without having the records in the db, for example with ferret it's just a :fields = {:my_custom_field = {}} and then a method named my_custom_field which set what i need (for example a list of strings/integers, that i need to index, like category ids 4 8 15 16 23 42, and then doing a query searching with for example 15, or stuff like that (actually i've 8 fields, but soon they will be around 12-15) Is it possible something like this with sphinx? For ferret there is acts_as_ferret, for sphinx what do you suggest ? acts_as_sphinx or is there something else? thank you --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Rails and Sphinx
On Apr 15, 2009, at 3:59 PM, fausto wrote: Hi, i'm currently using ferret+acts_as_ferret for doing some searches in the db (not so big for now, just 40k~ records, but they will be near 2M+ soon). For now ferret it's working quite well, but sometimes i've indexes corrupted (i use it's drb server in production) and i've to rebuild all the indexes, so i've bad indexes, angry users and time spent to make it right. I'm looking at sphinx and it seems the answers to this problems, as it seems that it doesn't have this such of problems. But i've seen that i've to remake indexes everytime (/hour or less).. does it take a lot to rebuild them? Look into the 'delta' options. That way you have a main index and a delta index of recent changes. Quicker to update and then nightly you can rebuild the whole thing. Is there anyone who use shpinx in production? I have in the past yes, using the thinking sphinx plugin. Worked great. Another big question about it is if it's possible to create custom indexes without having the records in the db, for example with ferret it's just a :fields = {:my_custom_field = {}} and then a method named my_custom_field which set what i need (for example a list of strings/integers, that i need to index, like category ids 4 8 15 16 23 42, and then doing a query searching with for example 15, or stuff like that (actually i've 8 fields, but soon they will be around 12-15) Is it possible something like this with sphinx? For ferret there is acts_as_ferret, for sphinx what do you suggest ? acts_as_sphinx or is there something else? thank you --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] uninitialized constant ActiveSupport::Dependencies::Mutex (NameError)
I'm on debian etch w/ ruby1.8, activesupport-2.3.2, getting this on the first line of code which is require 'active_support' : /var/lib/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:55: uninitialized constant ActiveSupport::Dependencies::Mutex (NameError) from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require' from /var/lib/gems/1.8/gems/activesupport-2.3.2/lib/active_support.rb:56 from /usr/lib/ruby/1.8/rubygems/custom_require.rb:33:in `gem_original_require' from /usr/lib/ruby/1.8/rubygems/custom_require.rb:33:in `require' Note that this worked as expected on ubuntu (ibix, amd64). Thanks, m --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Model Accessor Does Not Work Until After Reload?
This was due to a conflict with the Cj4r plugin not using appropriate namespaces for its Product class. On Apr 15, 2:33 pm, thadeous.m...@gmail.com thadeous.m...@gmail.com wrote: Anyone have any insight into why this would be happening? Please see pastie:http://pastie.org/447786 --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Using module methods in Rake task model?
I was a little off, but still haven't quite figured it out. I currently have: /lib/module/order_process.rb module order_process def process_order(id) #do stuff end /lib/tasks/ordering.rake include 'order_process.rb' namespace :send_report do task :order = :environment do process_order(id) end end /app/models/segment.rb class Segment ActiveRecord::Base include 'report_csv_process.rb' bla bla end I tried removing the single quotes, without luck -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] online rails music Application
Online Rails App that converts text into musical compositions thought the communtiy might be interested in this application http://www.literature2music.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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: ActiveRecord Comparison Bug?
Hi Fred, Thank you for the response! What you said made sense. thanks for the explanation. However, looking at the last criteria of the == implementation, we can see why something like what i mentioned would fail: let's say i have an 2 AR objects: old = Something.find(1) = #Something id: 1 then i create a new object: new = Something.new = #Something id: nil new.id = 1 # something like this is possible, how or why is another story... new = #Something id: 1 now do: new == old = true old == new = false == method should be commutative, right? appreciate any comments! -Moo On Apr 10, 10:52 am, Frederick Cheung frederick.che...@gmail.com wrote: On Apr 10, 5:50 pm, Moo janec...@gmail.com wrote: Anyone has any thoughts on this please? Basically the rationale is that == should mean 'do these objects correspond to the same database row ?' The reason why unsaved records are special cased is that two unsaved record would have equal id (nil in both cases) but if you saved them you would end up with 2 distinct rows in your database. I'm not sure why you're getting new ==old not being the same as old == new. They should both be false (and are on my machine) Fred On Apr 8, 5:29 pm, Moo janec...@gmail.com wrote: Hi Everyone, I'm running into a problem with theActiveRecord::Base == method defined here (it's 2.3.2, but it looks the same in older versions too): # File rails-2.3.2/activerecord/lib/active_record/base.rb, line 2816 2816: def ==(comparison_object) 2817: comparison_object.equal?(self) || 2818: (comparison_object.instance_of?(self.class) 2819: comparison_object.id == id 2820: !comparison_object.new_record?) 2821: end Because of the last criteria (!comparison_object.new_record?), something like this happens... say i have a new record and an existing record (different objects) and compare them: new == old = true old == new = false If this is intentional, can someone please explain why this is? Also what is the rational of only comparing the ID and not the all the values too and why does it matter if it's a new record or not? Thank you! -Moo --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Silence logging altogether for certain actions?
Hi, I am looking for a way to silence logging altogether for certain actions. Our app talks to other servers and session components, and our logs get filled up with this nonsense, even in Production mode. I want to completely silence all the automatic logging by Rails of the basic request parts: method, params, etc. I've seen logger.silence, but that doesn't appear to get rid of the basic request chatter. Any ideas? Processing ServersController#register to xml (for 127.0.0.1 at 2009-04-15 20:52:17) [POST] Parameters: {server={uname_node_name=domU, server_type=FLS, management_port=11054, service_address=1.2.3.4, uname_version=#2 SMP Tue Feb 19 10:51:53 EST 2008, service_port=10054, management_address=1.2.3.4, uname_sysname=Linux, max_clients=2000, current_clients=2, instance_uuid=5b7a3804, server_version=2.1.1/edge (r 2009-04-01 11:13:21) [i686-linux], uname_domain_name=(none), uname_release=2.6.18-xenU-ec2-v1.0, uname_machine=i686}, server_stats={cpu_sys=0.00, cpu_nice=0.00, cpu_idle=0.00, cpu_user=0.00}} Rendering servers/register Completed in 79ms (View: 1, DB: 4) | 200 OK [https:// ec2.compute-1.amazonaws.com/servers/register.xml] Processing SessionsController#ping to xml (for 127.0.0.1 at 2009-04-15 20:52:39) [POST] Completed in 16ms (View: 0, DB: 2) | 200 OK [https:// ec2.compute-1.amazonaws.com/session/ping.xml] Processing SessionsController#ping to xml (for 127.0.0.1 at 2009-04-15 20:52:41) [POST] Completed in 6ms (View: 0, DB: 2) | 200 OK [https:// ec2.compute-1.amazonaws.com/session/ping.xml] Processing ServersController#register to xml (for 127.0.0.1 at 2009-04-15 20:52:47) [POST] Parameters: {server={uname_node_name=domU, server_type=FLS, management_port=11054, service_address=1.2.3.4, uname_version=#2 SMP Tue Feb 19 10:51:53 EST 2008, service_port=10054, management_address=1.2.3.4, uname_sysname=Linux, max_clients=2000, current_clients=2, instance_uuid=5b7a3804, server_version=2.1.1/edge (r 2009-04-01 11:13:21) [i686-linux], uname_domain_name=(none), uname_release=2.6.18-xenU-ec2-v1.0, uname_machine=i686}, server_stats={cpu_sys=0.00, cpu_nice=0.00, cpu_idle=0.00, cpu_user=0.00}} Rendering servers/register Completed in 38ms (View: 1, DB: 24) | 200 OK [https:// ec2.compute-1.amazonaws.com/servers/register.xml] --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] :has_many best practice search order
I have a model_one that :has_many model_two-s, I would like to find the ten model_one's that have the most model_two's. What is the best way to do this? Model_One.find(:all, :limit = 10, :include = :model_two, :order =themost of model_two desc) or inorder for me to do this effeciently (I have thousands of model_two-s) would i need to add a column to model_one, to keep track of the number of model_two-s that model_one owns. Or is there some index i can use? What is the best practice in this situation? -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Rails 2.3
Binh Ly wrote: Hello, I've been looking on the Internet for how to use libxml within Rails. What I'm seeing is a little confusing. If you install the libxml gem, will Rails automatically use that because its installed or do you have to explicitly set libxml to be the default after you've installed it? This posting http://www.coffeepowered.net/2009/03/16/things-to-do-when-upgrading-to-rails-23/ Says to set this in the environment file. 1. ActiveSupport::XmlMini.backend = 'LibXML' But when I do that my app crashes. Anyone have any experience with this? If you could provide the entire backtrace, it would be much easier to diagnose. Michael Guterl -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Passenger caching in development mode, wtf?
Ok i resolved it, after hours of trying to figure it out, i noticed that the cause is having config.threadsafe! enabled in development mode. For some reason it causes caching to get enabled. This option should be documented better. Petr -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: :has_many best practice search order
Richard Schneeman wrote: I have a model_one that :has_many model_two-s, I would like to find the ten model_one's that have the most model_two's. What is the best way to do this? Something like this? Model_One.find(:all, :limit = 10, :joins = :model_two, :order = count(model_twos.model_one_id) desc, :group = model_ones.id) I could do it in raw SQL, but I don't know the exact match. Fred Cheung or someone will correct me if I got it wrong! The :joins is so you don't eager-load the models and interfere with the group concept, I suspect. The group is so you are allowed to count within each group. --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Spreadsheet -avoid reading and writing from file how?
Sijo Kg wrote: Hi I am using http://spreadsheet.rubyforge.org/ in my application..Usage like book = Spreadsheet::Workbook.new book.write #{RAILS_ROOT}/public/uploads/excel-file.xls render :file = #{RAILS_ROOT}/public/uploads/excel-file.xls headers['Content-Type'] = application/vnd.ms-excel headers['Content-Disposition'] = attachment; filename=excel-file.xls headers['Cache-Control'] = '' In the above i am writing to a file in a location and then read. My question is is there any method so that writing to a file can be avoided ..Because if there are some 100 requests the file will be overwritten(Am I right?) or if give seperate names for the files the upload folder will grow..So is there alternative and i can read the same content directly I didn't test this code, but looking at the api it looks like Workbook#write will take an IO stream. require 'stringio' require 'spreadsheet' book = Spreadsheet::Workbook.new blob = StringIO.new() book.write blob send_data blob Be sure to checkout the link below on send_data, it will allow you to transfer the stream of data without writing it to disk first. http://api.rubyonrails.org/classes/ActionController/Streaming.html#M000402 Michael Guterl -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] How to aggregate tags on child nodes?
Let's say I have a Recipe model, and it is a parent of the Review model. Reviews are entered by users of the system, with one or more tags using the acts_as_taggable_on_steroids plugin (for instance). What I'm interested in is how to show *all* tags for a particular Recipe - meaning all tags applied to every child Review of that Recipe. For an example of what I'm talking about, look at this page from this fine website: http://97bottles.com/breweries/us/ca/santa-rosa/russian-river-brewing-company/blind-pig-ipa/ They are showing the most popular tags from all Reviews on a particular Beer. I'm trying to figure out how to do that. But I have no idea where to start, since the tagging is such a wily concept to me. Any suggestions? --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: install error for rails-widgets
Are you running Rails 2.3.2 by any chance? If so, you might need to patch a file related to plugin install git... On Apr 15, 4:03 am, nmt999 nmt...@yahoo.com wrote: When I executed the install command, I did not get any output. The only thing I noticed after investigating my application directory is that, it created a directory in vendor/plugins/rails-widgets. However, this directory is empty. Thanks, Rick-13 wrote: This is what you should see as a result of your plugin install: /widgets 516 script/plugin install git://github.com/paolodona/rails-widgets.git Initialized empty Git repository in /Users/rick/widgets/vendor/plugins/ rails-widgets/.git/ remote: Counting objects: 78, done. remote: Compressing objects: 100% (71/71), done. remote: Total 78 (delta 8), reused 21 (delta 0) Unpacking objects: 100% (78/78), done. From git://github.com/paolodona/rails-widgets * branch HEAD - FETCH_HEAD cp /Users/rick/widgets/vendor/plugins/rails-widgets/images/ tooltip_arrow.gif /Users/rick/widgets/public/images/widgets/ tooltip_arrow.gif cp /Users/rick/widgets/vendor/plugins/rails-widgets/images/ tooltip_image.gif /Users/rick/widgets/public/images/widgets/ tooltip_image.gif cp /Users/rick/widgets/vendor/plugins/rails-widgets/javascripts/ tooltip.js /Users/rick/widgets/public/javascripts/widgets/tooltip.js Did you omit this output from your mail message or what? Was any output produced when you ran the install? On Apr 14, 2:05 pm, nmt999 nmt...@yahoo.com wrote: When i am trying to install the rails-widgets on windows vista fromhttp://wiki.github.com/paolodona/rails-widgetslocationI get an error. Please help. cd myrails-app ruby script/plugin install git://github.com/paolodona/rails-widgets.git rake widgets:setup following is the error rake aborted! Don't know how to build task 'widgets:setup' (See full trace by running task with --trace) --- Then I tried with the following command rake widgets:setup --trace following is the error --- rake aborted! Don't know how to build task 'widgets:setup' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1704:in `[]' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2026:in `invoke_task' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `top_level' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `each' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `top_level' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in `standard_exception_handling' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1999:in `top_level' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1977:in `run' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in `standard_exception_handling' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1974:in `run' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/bin/rake:31 c:/ruby/bin/rake:16:in `load' c:/ruby/bin/rake:16 -- View this message in context:http://www.nabble.com/install-error-for-rails-widgets-tp23048157p2304... Sent from the RubyOnRails Users mailing list archive at Nabble.com. -- View this message in context:http://www.nabble.com/install-error-for-rails-widgets-tp23048157p2305... Sent from the RubyOnRails Users mailing list archive at Nabble.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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: URL Redirect and affect on Routes?
Thanks, I figured this should be a Rewrite rule but was not familiar enough with rails/routes to determine if I was making it more complicated. I feel pretty confident in working with Apache. Thanks much! --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Rating Model and DB Relationships
I appreciate the debate, and I agree the constraint should be the DB as a primary. Back to my main question though - how should the relationships be set up for a rating system? --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] how to ensure
how do i get my app database info only after another server has called my app's method and updated my app's database? Now, i can just get the database info before anther server calls my app's method. def one some code two some code end def two calls another server's methods and sends my app ping url(http:// myhost/.../three) that will be automaticlly called by that server after executing the two method end def three another server calls this method and updates database end --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: ActiveRecord Comparison Bug?
Hi Fred, Thank you for the response! What you said made sense. thanks for the explanation. However, looking at the last criteria of the == implementation, we can see why something like what i mentioned would fail: let's say i have an 2 AR objects: old = Something.find(1) = #Something id: 1 then i create a new object: new = Something.new = #Something id: nil new.id = 1 # something like this is possible, how or why is another story... new = #Something id: 1 now do: new == old = true old == new = false == method should be commutative, right? You've got something screwy somewhere... old = Toy.fin old = Toy.find(1) = #BabyToy id: 1, .. new = Toy.new = #Toy id: nil, new.id = 1 = 1 old == new = false new == old = false Rails 2.3.2.1 -philip appreciate any comments! -Moo On Apr 10, 10:52 am, Frederick Cheung frederick.che...@gmail.com wrote: On Apr 10, 5:50 pm, Moo janec...@gmail.com wrote: Anyone has any thoughts on this please? Basically the rationale is that == should mean 'do these objects correspond to the same database row ?' The reason why unsaved records are special cased is that two unsaved record would have equal id (nil in both cases) but if you saved them you would end up with 2 distinct rows in your database. I'm not sure why you're getting new ==old not being the same as old == new. They should both be false (and are on my machine) Fred On Apr 8, 5:29 pm, Moo janec...@gmail.com wrote: Hi Everyone, I'm running into a problem with theActiveRecord::Base == method defined here (it's 2.3.2, but it looks the same in older versions too): # File rails-2.3.2/activerecord/lib/active_record/base.rb, line 2816 2816: def ==(comparison_object) 2817: comparison_object.equal?(self) || 2818: (comparison_object.instance_of?(self.class) 2819: comparison_object.id == id 2820: !comparison_object.new_record?) 2821: end Because of the last criteria (!comparison_object.new_record?), something like this happens... say i have a new record and an existing record (different objects) and compare them: new == old = true old == new = false If this is intentional, can someone please explain why this is? Also what is the rational of only comparing the ID and not the all the values too and why does it matter if it's a new record or not? Thank you! -Moo --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---