[Rails] Barry Flower is out of the office

2010-12-23 Thread Barry Flower
I will be out of the office starting 23/12/2010 and will not return until 04/01/2011. Please contact Adam Brand as my delegate or if urgent a message can be left on 0439 467 971 Unless otherwise stated, this email is confidential. If received in error, please delete and inform the sender

Re: [Rails] Re: Dreamhost Rails upgrade troubles

2010-12-23 Thread Colin Law
On 22 December 2010 22:18, Brian Wolk li...@ruby-forum.com wrote: Thanks for the replies, everyone. I tried what Water suggested: $ rake rails:freeze:edge RELEASE=2.3.5 I don't think you want the edge. If you want to freeze to the version of rails that the app is currently using then just

Re: [Rails] Dynamic JavaScript -- was: Re: Re: Rails - escape_javascript without all the \n\n\n\n\n

2010-12-23 Thread Matteo Latini
On Dec 22, 2010, at 6:05 PM, Marnen Laibow-Koser wrote: Please quote when replying. Matteo Latini wrote in post #969994: On Dec 21, 2010, at 10:03 PM, Marnen Laibow-Koser wrote: What do you exactly mean by dynamic... By dynamic JavaScript, I mean JavaScript generated on the fly with

Re: [Rails] Difference between rake test:units and individually running ruby -I test test/unit/something_test.rb ?

2010-12-23 Thread Colin Law
On 23 December 2010 03:17, daze dmonopol...@gmail.com wrote: Here's my issue: running ruby -I test test/unit/something_test.rb for each of my unit tests works perfectly. However, running rake test:units brings errors in all of them - some object becomes nil for some reason. Why might this be

[Rails] One form, multiple models, custom validation

2010-12-23 Thread Serafino Picozzi
Hi everyone, I hope someone can help me solve this problem. I have a model called Project with :has_many = :tasks. In the new Project form i allow the creation of 1 to n tasks on the fly thanks to accepts_nested_attributes_for, where the task model has some validations that block the creation of

[Rails] [ANN] WiceGrid 0.6 for Rails 2 and 3.0.0.pre1 for Rails 3 are released

2010-12-23 Thread Yuri Leikind
Hello all, WiceGrid version 0.6 for Rails 2 and 3.0.0.pre1 for Rails 3 are released. WiceGrid is a Rails grid plugin. A more detailed blog post: http://leikind.org/2010/12/23/better-late-than-never Examples online: http://grid.leikind.org/ Source code Rails 2:

[Rails] Re: File not found: lib when installing rails-3.0.0

2010-12-23 Thread Sebastian S.
Solution: $ cd /usr/lib/ruby/gems/1.8/gems/rails-3.0.3/ $ ls . bin if you have only bin directory: $ sudo mkdir lib $ sudo gem install rails Sebastian -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails:

[Rails] Re: Problem with Selenium RC with Rails

2010-12-23 Thread Juhi Choudhary
Hi Your code is missing something. Try this one require test/unit require rubygems require selenium class MyTestClass Test::Unit::TestCase def setup @verification_errors = [] @selenium = Selenium::Client::Driver.new( localhost, ,

[Rails] No such file to load error

2010-12-23 Thread Juhi Choudhary
Hi I am using ruby with selenium to automate my test. But when I execute my test case in eclipse IDE I am getting the following error internal:lib/rubygems/custom_require:29:in `require': no such file to load -- test1 (LoadError) from internal:lib/rubygems/custom_require:29:in `require'

[Rails] Active Record Relations and Nesting

2010-12-23 Thread Devin M
Hello, I am looking to create a rails app that will model and display related nodes. I am just beginning to dive into active record and I was wondering if the following pesudo code would work? class NodeLink ActiveRecord::Base belongs_to :node # foreign key - node_id (recorded as

[Rails] Re: Authlogic Rails 3

2010-12-23 Thread Up 4.
I think you should add the following line in your gem file: gem rails3-generators It is required to add your required generators UP4B LLC http://up4b.com -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails:

[Rails] saravanan

2010-12-23 Thread Saravanan Ravi
Hi, I am new to ruby on rails.. i have one dought in select tag i created table name with products(id,title,price,date) I loaded all title name from mysql databse.but if i select any title means the corresponding price should be display what can i do for that..plz help me.. -- You received

[Rails] Does using :render = :partial breaks the MVC separation during an ajax call

2010-12-23 Thread deepak
I am using this function below which updates a div element with a partial in an ajax call. def publish render :update do |page| page.replace_html 'my_div', :partial = 'my_partial' end end Does this approach breaks the MVC separation. If Yes, how can we avoid it? Thanks Deepak Kumar

Re: [Rails] saravanan

2010-12-23 Thread Jatin kumar
On Thu, Dec 23, 2010 at 12:02 PM, Saravanan Ravi saravanaar...@gmail.comwrote: Hi, I am new to ruby on rails.. i have one dought in select tag i created table name with products(id,title,price,date) Your question is not clear. What do you mean by I loaded all title name from mysql

[Rails] Re: Saving records from multiple tables

2010-12-23 Thread pepe
I see 2 things that might help you. On one hand you could use accepts_nested_attributes_for in your person model and fields_for in your view, then you would only need to save the person and that would take care of the client as well but based on what I see in your code that might not be feasible.

[Rails] has_many :through full stack help

2010-12-23 Thread agilehack
I am trying to implement HMT for the first time and having a ton of trouble. I would like to be able to have the user check a checkbox and fill some extra fields for data input. I have tried so many iterations borrowed from different places I found on the web, none seem to work quite right.

[Rails] Re: rvm, rails and sqlite

2010-12-23 Thread gezope
Hello Rail! I would use this method: - check RVM, set all thing you need, see also this part http://rvm.beginrescueend.com/gemsets/basics/ - is sqlite installed? is it running? - check if needed Ruby version installed and if you can switch, - gem version you need, - particular gem you need - this

[Rails] Re: Connection to database

2010-12-23 Thread gezope
Hi, - first check MySQL console, - then 'gem list m' - you can see here every gem listed starts with letter 'm' (or simply 'gem list') - then what other wrote here 'irb -r active_record'. If your Euby, Gem, Rails installed well, you have the necessary gems (see in gem list), then you can edit

[Rails] Re: Please help with installing mysql gem to linux machine w/ xampp

2010-12-23 Thread gezope
Hello, check RVM because later you can have more problems http://rvm.beginrescueend.com/gemsets/basics/ I had the same problem, and met with this many times in mailing list. Better to avoid in early stage. Cheers, gezope On dec. 22, 21:44, Dan W. li...@ruby-forum.com wrote: Solved!

[Rails] Re: Dynamic JavaScript -- was: Re: Re: Rails - escape_javascript without all the \n\n\n\n\n

2010-12-23 Thread Marnen Laibow-Koser
Matteo Latini wrote in post #970246: On Dec 22, 2010, at 6:05 PM, Marnen Laibow-Koser wrote: really doesn't belong. You wouldn't do that in Ruby; don't do it in JS. Ruby is actually NOT like that... Actually everything we love about rails is thanks to dynamic code... That's not true at

[Rails] MongoMapper with ActiveModel - Rails 3

2010-12-23 Thread Milo Thurston
I'm trying out Rails 3 with MongoMapper for a new application, and have run into a bug when both MongoMapper::Document and ActiveModel::Validations are used in the same model, in this case job.rb. I can create a new model with the various validations I require, but when I attempt to save it I get:

[Rails] Re: rvm, rails and sqlite

2010-12-23 Thread Rail Shafigulin
zoltan, thanks for help. i solved the problem by doing the following: rvm notes returns a list of modules that needed to be installed on linux. after that i gem install sqlite3-ruby and everything worked fine. -- Posted via http://www.ruby-forum.com/. -- You received this message because

[Rails] [JOB] Jr. OS Developer, Greenwich, CT | 65k

2010-12-23 Thread OSS
This is a full time, on-site, salaried Junior Open Source Developer position located in Greenwich, CT paying $55,000 to $65,000 depending on experience + benefits. No telecommuting allowed. US Citizens or Green Card holders only please. Local candidates only. Thank you. Our boutique hedge

[Rails] Re: Difference between rake test:units and individually running ruby -I test test/unit/something_tes

2010-12-23 Thread daze
On Dec 22, 10:38 pm, Marnen Laibow-Koser li...@ruby-forum.com wrote: Let's see your error messages.  But why the heck are you defining an object like this anyway?  What are you trying to achieve? I'm trying to get a test for acts_as_list working. I've defined a method in test_helper that I

[Rails] Re: Scheduling Plugin

2010-12-23 Thread ppgeng...@prevailhs.com
On Dec 22, 11:12 am, Mike Porter li...@ruby-forum.com wrote: Hi, We are looking for a calendar scheduling solution that supports recurring events. I haven't used it, but when I was filling idle time a little bit ago the one I found that I liked the best was:

[Rails] Re: Difference between rake test:units and individually running ruby -I test test/unit/something_tes

2010-12-23 Thread Marnen Laibow-Koser
daze wrote in post #970337: On Dec 22, 10:38pm, Marnen Laibow-Koser li...@ruby-forum.com wrote: Let's see your error messages. But why the heck are you defining an object like this anyway? What are you trying to achieve? I'm trying to get a test for acts_as_list working. I've defined a

[Rails] rails/ruby test - error report without line numbers

2010-12-23 Thread Joshua S.
Hi all, I'm new to Rails and new to Rails testing. I have a few questions: First, the most important question. How do I get line numbers to be reported with my errors when testing. Here is what I get back on a typical error: j...@josh-laptop:~/d/test$ ruby unit/line_test.rb -n test_update

[Rails] Re: rails/ruby test - error report without line numbers

2010-12-23 Thread Marnen Laibow-Koser
Joshua S. wrote in post #970342: Hi all, I'm new to Rails and new to Rails testing. I have a few questions: First, the most important question. How do I get line numbers to be reported with my errors when testing. soapbox Probably by not using Test::Unit. :) It sucks. Try RSpec instead.

[Rails] Re: Weird issue with converting floats to integer

2010-12-23 Thread Jeff Lewis
Or just change the way you calculate to get at the level of accuracy that you want/need: irb (291.15.to_f * 1000.0).to_i/10 = 29115 Jeff On Dec 22, 7:41 pm, Marnen Laibow-Koser li...@ruby-forum.com wrote: TomRossi7 wrote in post #970207: Any idea why this calculates the integer the way it

[Rails] Re: Weird issue with converting floats to integer

2010-12-23 Thread Marnen Laibow-Koser
Please quote when replying. Jeff Burlysystems wrote in post #970344: Or just change the way you calculate to get at the level of accuracy that you want/need: irb (291.15.to_f * 1000.0).to_i/10 = 29115 That's incredibly silly IMHO. Besides, it will not always be the same for all values,

[Rails] Re: Weird issue with converting floats to integer

2010-12-23 Thread TomRossi7
I have currency information that I plan to store as an integer -- ironically to avoid issues like this. The user input will always be in a decimal form. I'm thinking I will just do this ('291.15'.to_f * 100).round instead. That should round out any of the weird float issues. On Dec 23, 12:51 

[Rails] Re: rails/ruby test - error report without line numbers

2010-12-23 Thread Joshua S.
I posted an unpleasant solution on stackoverflow: http://stackoverflow.com/questions/4521203/ruby-tests-error-messages-dont-include-line-numbers-or-file-name/4521275#4521275 -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups

[Rails] Re: Weird issue with converting floats to integer

2010-12-23 Thread Marnen Laibow-Koser
Please quote when replying. TomRossi7 wrote in post #970346: I have currency information that I plan to store as an integer -- ironically to avoid issues like this. The user input will always be in a decimal form. I'm thinking I will just do this ('291.15'.to_f * 100).round instead. That

[Rails] Re: Difference between rake test:units and individually running ruby -I test test/unit/something_tes

2010-12-23 Thread daze
Oh whoa okay thanks. I better make some changes now... :/ Can I use Shoulda w/ Rspec, or do I just use one over the other? And I should use this one https://github.com/rspec/rspec-rails, right? -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk

[Rails] Re: Difference between rake test:units and individually running ruby -I test test/unit/something_tes

2010-12-23 Thread Marnen Laibow-Koser
Please quote when replying. daze wrote in post #970358: Oh whoa okay thanks. I better make some changes now... :/ Can I use Shoulda w/ Rspec, or do I just use one over the other? I understand Shoulda is usable with RSpec. I've never actually used Shoulda on any of my projects, though.

[Rails] Re: Weird issue with converting floats to integer

2010-12-23 Thread Matt Jones
On Dec 22, 10:34 pm, TomRossi7 t...@themolehill.com wrote: Any idea why this calculates the integer the way it does? irb (291.15.to_f * 100.0).to_i = 29114 As Marnen's already pointed out, the issue is that the result is a *tiny* bit smaller than 29115, so to_i truncates off the entire

[Rails] Re: Scheduling Plugin

2010-12-23 Thread Matt Jones
On Dec 23, 12:00 pm, ppgeng...@prevailhs.com ppgeng...@gmail.com wrote: On Dec 22, 11:12 am, Mike Porter li...@ruby-forum.com wrote: Hi, We are looking for a calendar scheduling solution that supports recurring events. I haven't used it, but when I was filling idle time a little bit

[Rails] Re: Saving records from multiple tables

2010-12-23 Thread giorgio
Thanks for reply pepe. You say to use a transaction... I already am using a transaction! The issue is that if the person save succeeds and the client save fails then the transaction is rolled back fine. However the person record now has a person.id and subsequent code assumes that the record is

[Rails] MySQL update BLOB

2010-12-23 Thread Roman Mandeleil
Hi I am trying to update a blob column from Ruby script into MySQL DB. The script is running on PC and DB on Linux host. The problem I see is that only 255 bytes of data being stored , is there any way to deal with that problem ? myconnect = Mysql::new(host, user, , db) f =

[Rails] Re: Devise restrict concurrent login

2010-12-23 Thread Matt Jones
On Dec 22, 10:36 am, Hitesh Rawal li...@ruby-forum.com wrote: Hi, I am using devise 1.0.8, and I want to restrict concurrent login of user i.e. same user should not be login from different browser or different location if he already login from some where. and if he really wants to login

Re: [Rails] rails/ruby test - error report without line numbers

2010-12-23 Thread Colin Law
On 23 December 2010 17:40, Joshua S. li...@ruby-forum.com wrote: Hi all, I'm new to Rails and new to Rails testing. I have a few questions: First, the most important question. How do I get line numbers to be reported with my errors when testing. Here is what I get back on a typical error:

[Rails] Re: Weird issue with converting floats to integer

2010-12-23 Thread Peter Vandenabeele
TomRossi7 wrote in post #970346: I have currency information that I plan to store as an integer -- ironically to avoid issues like this. The user input will always be in a decimal form. I'm thinking I will just do this ('291.15'.to_f * 100).round instead. That should round out any of the

[Rails] Re: Saving records from multiple tables

2010-12-23 Thread pepe
You say to use a transaction... I already am using a transaction! Sorry about that. I obviously didn't read carefully your post. The issue is that if the person save succeeds and the client save fails then the transaction is rolled back fine. However the person record now has a person.id and

Re: [Rails] Re: Weird issue with converting floats to integer

2010-12-23 Thread Colin Law
On 23 December 2010 03:41, Marnen Laibow-Koser li...@ruby-forum.com wrote: TomRossi7 wrote in post #970207: Any idea why this calculates the integer the way it does? irb (291.15.to_f * 100.0).to_i = 29114 Because of the vagaries of floating-point arithmetic: irb (291.15.to_f * 100.0)

[Rails] Re: Re: Weird issue with converting floats to integer

2010-12-23 Thread Marnen Laibow-Koser
Colin Law wrote in post #970376: On 23 December 2010 03:41, Marnen Laibow-Koser li...@ruby-forum.com wrote: 29114.9996362021192908287048 It bears repeating: never, ever use Floats for arithmetic. If you can't use fixed-point math, then use BigDecimal. I have to disagree here. I

Re: [Rails] Re: Re: Weird issue with converting floats to integer

2010-12-23 Thread Colin Law
On 23 December 2010 21:34, Marnen Laibow-Koser li...@ruby-forum.com wrote: Colin Law wrote in post #970376: On 23 December 2010 03:41, Marnen Laibow-Koser li...@ruby-forum.com wrote: 29114.9996362021192908287048 It bears repeating: never, ever use Floats for arithmetic. If you can't

[Rails] Re: One form, multiple models, custom validation

2010-12-23 Thread Peter Vandenabeele
Would this not be the proper solution ? User has many payments. I want the user to have at least one payment with an amount, before a user is valid. class User ActiveRecord::Base default_scope :order = :id has_many :payments validate :has_one_complete_payment private def

Re: [Rails] One form, multiple models, custom validation

2010-12-23 Thread Fidel Viegas
On 23/12/10 10:32, Serafino Picozzi wrote: Hi everyone, I hope someone can help me solve this problem. I have a model called Project with :has_many = :tasks. In the new Project form i allow the creation of 1 to n tasks on the fly thanks to accepts_nested_attributes_for, where the task model

[Rails] Rails 3 - polymorphic associations problem with ActiveRecord::Relation

2010-12-23 Thread Gerardo
Hi, My application is running over ubuntu 10, ruby 1.9.2, rails 3.0.3 and passenger 3.0.2 + nginx. This application has several polymorphic associations and the problem is that when the associations are called it randomly returns either the related object or an ActiveRecord::Relation object.

[Rails] logserver with log4r

2010-12-23 Thread Eshark
Hey guys, I am trying to set up a logging server using log4r ! When I try to run the server I get the following error message LogServer not supported. ROMP is required (RuntimeError) I installed romp the way its mentioned in some blog with similar issue. Any ideas about it ? Thanks. -- You

[Rails] update a foreign key in an association table

2010-12-23 Thread Fabrice
Hello, I'd like to know how to update a foreign key in an association table (many_to_many association) ? Here is my model, Split is the association table between Account and Transaction: class Account ActiveRecord::Base set_primary_key :guid has_many :splits, :foreign_key =

[Rails] Re: MySQL update BLOB

2010-12-23 Thread Frederick Cheung
On Dec 23, 8:51 pm, Roman Mandeleil li...@ruby-forum.com wrote: Hi I am trying to update a blob column from Ruby script into MySQL DB. The script is running on PC and DB on Linux host. The problem I see is that only 255 bytes of data being stored , is there any way to deal with that problem

[Rails] Re: Running Rails 2 and Rails 3 side by side on Obuntu

2010-12-23 Thread Peter Vandenabeele
Marnen Laibow-Koser wrote in post #970178: Peter Vandenabeele wrote in post #970143: [...] Thanks for that hint. It lead me to this page: http://rvm.beginrescueend.com/gemsets/basics/ You hadn't read that before? No. I am fairly new to rvm. Figured out $ rvm gemset help as a useful

[Rails] Re: Re: Weird issue with converting floats to integer

2010-12-23 Thread Robert Walker
Marnen Laibow-Koser wrote in post #970377: Then use fixed-point math. IEEE floats are 100% inappropriate for any sort of mathematical calculation. And who cares how fast they are if they're inaccurate? Inaccurate engineering calculations are worse than none at all -- do *you* want to drive

[Rails] Re: MySQL update BLOB

2010-12-23 Thread Roman Mandeleil
tinyblob -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to

[Rails] Re: Re: Re: Re: Where put require

2010-12-23 Thread Paul Bergstrom
Paul Bergstrom wrote in post #970168: And so have I. But as I said. I'm not a natural programmer. But I try to be a software developer and I think Rails is much easier to use than e g php. Hopefully it will stay that way. Actually that should be web developer. A bit tired when I wrote that

[Rails] Re: Re: Re: Re: Re: Where put require

2010-12-23 Thread Paul Bergstrom
David Kahn wrote in post #970173: Well said. :-) -- 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-t...@googlegroups.com. To unsubscribe from this

[Rails] Re: Re: Weird issue with converting floats to integer

2010-12-23 Thread Marnen Laibow-Koser
Robert Walker wrote in post #970390: Marnen Laibow-Koser wrote in post #970377: Then use fixed-point math. IEEE floats are 100% inappropriate for any sort of mathematical calculation. And who cares how fast they are if they're inaccurate? Inaccurate engineering calculations are worse than

[Rails] Re: MySQL update BLOB

2010-12-23 Thread Marnen Laibow-Koser
Please quote when replying. Roman Mandeleil wrote in post #970391: tinyblob Well, there's your problem -- a MySQL TINYBLOB only holds 255 bytes of data! Best, --  Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org Sent from my iPhone -- Posted via http://www.ruby-forum.com/. --

[Rails] Spree drag and drop: not recognizing JS

2010-12-23 Thread Dan Sadaka
Greetings, I asked this over at the Spree google group but got no response. I'm hoping someone here might have experience with this. I am implementing a drag and drop cart with Rails 3 and jQuery. This cart works outside of Spree. The URL I call from the drop action is hardcoded as

[Rails] Re: MySQL update BLOB

2010-12-23 Thread Roman Mandeleil
Yep I got it. So much trouble with the script so I missed the obvious. But, I still don't understand why the place holder for the update statement doesn't work: I mean that syntax: update_sql = update SHARE set COMPANY_LOGO = ? WHERE ID = 8982167534873685924; stmt = myconnect.prepare(update_sql)