[Rails] Rspec

2012-08-03 Thread honey ruby
Hi all i'm trying to learn Rspec testing can anyone suggest me the best book to learn Rspec with good sample code. Thanks in advance -- 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@

[Rails] Re: Re: Help installing redmine

2012-08-03 Thread Michael Reed
Hi Weston, No, the four Gemfile.lock file are the only ones on my computer. 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@googleg

[Rails] [Job] Ruby on Rails Developer position - all new development on Heroku in NYC

2012-08-03 Thread Bob_at_StaffIT
It is an Open Ended Consulting Assignment (3-6 months+) with an Open Rate. Please contact us 212-338-9595 if you are available / interested. If you are not, please feel free to forward this to anyone you know, who would be a good fit, and is looking for a job. Thanks Job Description: Under th

[Rails] Re: dynamic loop in a hash

2012-08-03 Thread Sam Ginko
Sam Ginko wrote in post #1071240: > Colin Law wrote in post #1071227: >> On 3 August 2012 22:03, Sam Ginko wrote: >>> i.day.ago.to_date => { :coder=>@numdeployed, :imedidata=>@numdeployed, >>> :balance=>@numdeployed, :CTMS=>@numdeployed }, >>> i += 1 >>> end >>> >>> >>> Original Data Hash >>>

[Rails] Re: Polymorphic one-to-one associations in Rails 3.2 - what's the "correct" Rails way?

2012-08-03 Thread Neil Mowbray
Hello HTH, Thanks. I must have missed in the doc as I thought one could not put polymorphic => true on has_one. Regarding a person having multiple roles (Staff + Mother) I noticed the issue and was planning on putting an intermediate Peron -> Role on-to-many in but you way might be easier. Reg

[Rails] Re: dynamic loop in a hash

2012-08-03 Thread Sam Ginko
Daniel Mantilla wrote in post #1071237: > This should work: > > items = 12.times.map { [i.day.ago.to_date, { :coder=>@numdeployed, > :imedidata=>@numdeployed, > :balance=>@numdeployed, :CTMS=>@numdeployed } ] }.flatten > result = Hash[*items] > > Daniel Thanks Daniel, I will try this. -- Posted

[Rails] Re: dynamic loop in a hash

2012-08-03 Thread Sam Ginko
Colin Law wrote in post #1071227: > On 3 August 2012 22:03, Sam Ginko wrote: >> i.day.ago.to_date => { :coder=>@numdeployed, :imedidata=>@numdeployed, >> :balance=>@numdeployed, :CTMS=>@numdeployed }, >> i += 1 >> end >> >> >> Original Data Hash >> >> @data = { >> 1.day.ago.to_date => {

[Rails] Re: dynamic loop in a hash

2012-08-03 Thread Daniel
This should work: items = 12.times.map { [i.day.ago.to_date, { :coder=>@numdeployed, :imedidata=>@numdeployed, :balance=>@numdeployed, :CTMS=>@numdeployed } ] }.flatten result = Hash[*items] Daniel On Friday, August 3, 2012 5:03:04 PM UTC-4, Ruby-Forum.com User wrote: > > I'm trying to create

Re: [Rails] dynamic loop in a hash

2012-08-03 Thread Colin Law
On 3 August 2012 22:03, Sam Ginko wrote: > I'm trying to create a dynamic loop within the hash @data below and > can't really seem to figure it out. The array within the hash has to be > dynamic i:e the day number has to be generated by a loop either while or > until and the name of the product a

[Rails] Re: ActiveResource and REST API

2012-08-03 Thread masta Blasta
Tom Allison wrote in post #1070825: > Ran into a great problem. REST, as it's implimented via Rails, > identifies > the URL as a plural in every case. So you would retrieve a single issue > through /issues/. This seems to be technically > incorrect. > > I find other (non-Rails) documentation tal

[Rails] dynamic loop in a hash

2012-08-03 Thread Sam Ginko
I'm trying to create a dynamic loop within the hash @data below and can't really seem to figure it out. The array within the hash has to be dynamic i:e the day number has to be generated by a loop either while or until and the name of the product and number are dynamic as well. I'll try to explain

[Rails] Re: accessing from both ends of has many through relationship

2012-08-03 Thread masta Blasta
Martyn W. wrote in post #1071177: > I have a 'has many through' relationship in my models. I am trying to > access objects from either side of this relationship, with mixed > results.Here are my models: > > class Material < ActiveRecord::Base > attr_accessible :description, :number >

Re: [Rails] Simple (I'm sure) Question about Joins

2012-08-03 Thread Colin Law
On 3 August 2012 20:40, Steve Morrissey wrote: > I'm working on a into rails project in parallel with a book I'm reading. > I have 3 models/controllers that I'm trying to get to interact properly: > user, article, comment > > Each article can have many comments, each comment is made by 1 user. > C

[Rails] Re: Simple (I'm sure) Question about Joins

2012-08-03 Thread Steve Morrissey
Douglas Lovell wrote in post #1071218: > Steve: > > Assuming your many comments to one user relation is set-up properly, ask > for cu = comment.user. Then <%= cu.username %> will work for you. > > Doug > > Douglas Lovell > www.wbreeze.com Worked perfectly, thank you! :) -- Posted via http://www

Re: [Rails] Simple (I'm sure) Question about Joins

2012-08-03 Thread Douglas Lovell
Steve: Assuming your many comments to one user relation is set-up properly, ask for cu = comment.user. Then <%= cu.username %> will work for you. Doug Douglas Lovell www.wbreeze.com On 08/03/2012 03:40 PM, Steve Morrissey wrote: I'm working on a into rails project in parallel with a book I

[Rails] Simple (I'm sure) Question about Joins

2012-08-03 Thread Steve Morrissey
I'm working on a into rails project in parallel with a book I'm reading. I have 3 models/controllers that I'm trying to get to interact properly: user, article, comment Each article can have many comments, each comment is made by 1 user. Currently I'm able to get the article to show the comment co

[Rails] Re: [ANN] Rails 3.2.8.rc2 has been released

2012-08-03 Thread Daniel Evans
Our test suite (rspec/capybara+webkit/jasmine) which was broken by 3.2.7 is working perfectly in 3.2.8.rc2. Thanks! --Daniel Evans On Friday, August 3, 2012 8:29:57 AM UTC-6, Santiago Pastorino wrote: > > Hi everyone, > > Rails 3.2.8.rc2 has been released. If no regressions are found we will >

Re: [Rails] Rails app hosting in Network solution

2012-08-03 Thread Norbert Melzer
> I don't know how host to Ruby On Rails app in network solution. > I uploaded file in "/var/www/vhosts/default/htdocs/rails/app-name". > I also used haml in my rails application. Which HTTP-Server are you using? If it is nginx or apache you could take a look into phusion passenger (http://www.mod

Re: [Rails] Re: accessing from both ends of has many through relationship

2012-08-03 Thread Colin Law
Please remember to quote the previous message so that it is easier to follow the thread, remember this is a mailing list not a forum (though you may be accessing it through a forum like interface). On 3 August 2012 17:02, Martyn W. wrote: > For <%= work_ticket.material.number %> > > I get undefin

[Rails] Re: accessing from both ends of has many through relationship

2012-08-03 Thread Martyn W.
For <%= work_ticket.material.number %> I get undefined method `number' for nil:NilClass -- 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@goo

Re: [Rails] accessing from both ends of has many through relationship

2012-08-03 Thread Colin Law
On 3 August 2012 15:57, Martyn W. wrote: > I have a 'has many through' relationship in my models. I am trying to > access objects from either side of this relationship, with mixed > results.Here are my models: > > class Material < ActiveRecord::Base > attr_accessible :description, :numbe

[Rails] accessing from both ends of has many through relationship

2012-08-03 Thread Martyn W.
I have a 'has many through' relationship in my models. I am trying to access objects from either side of this relationship, with mixed results.Here are my models: class Material < ActiveRecord::Base attr_accessible :description, :number has_many :parts has_many :work_tickets,

[Rails] [ANN] Rails 3.2.8.rc2 has been released

2012-08-03 Thread Santiago Pastorino
Hi everyone, Rails 3.2.8.rc2 has been released. If no regressions are found we will release 3.2.8 final around Wednesday 8th. ## IMPORTANT We are removing all the deprecation warnings that we introduced in 3.2.x. We have decided to stop introducing API deprecations in all point releases going fo

Re: [Rails] How to remove a record if it is duplicate end sum values :val

2012-08-03 Thread Esmerino Jr
I'm sorry if it made no sense to my sentence. The next will be clearer. On Fri, Aug 3, 2012 at 9:14 AM, Colin Law wrote: > On 3 August 2012 13:00, Esmerino Jr wrote: > > Michael Pavling, thanks for reply. > > > > Okay, i agree that is a array of hash : list.class => Array end > > list.last.cla

Re: [Rails] How to remove a record if it is duplicate end sum values :val

2012-08-03 Thread Colin Law
On 3 August 2012 13:00, Esmerino Jr wrote: > Michael Pavling, thanks for reply. > > Okay, i agree that is a array of hash : list.class => Array end > list.last.class => Hash. > But your solution only removes duplication and the sum of :val ? I think you need to make it more clear what you are t

Re: [Rails] Remove a record if it is duplicate end sum values

2012-08-03 Thread Esmerino Jr
Botp, thanks for replay, this is solution: list.inject(Hash.new(0)) { |hash, el| hash[el[:cod]] += el[:val] ; hash } I want it out: {"0006"=>120, "0005"=>17, "0004"=>33, "0002"=>27, "0001"=>22} Thanks for replay again. On Fri, Aug 3, 2012 at 8:39 AM, botp wrote: > On Fri, Aug 3, 2012 at 7:3

Re: [Rails] How to remove a record if it is duplicate end sum values :val

2012-08-03 Thread Esmerino Jr
Michael Pavling, thanks for reply. Okay, i agree that is a array of hash : list.class => Array end list.last.class => Hash. But your solution only removes duplication and the sum of :val ? Tom Meinlschmid, thanks for reply. Not a test for job seekers :) Solution: list.inject(Hash.new(0)) { |

Re: [Rails] Remove a record if it is duplicate end sum values

2012-08-03 Thread botp
On Fri, Aug 3, 2012 at 7:33 PM, Esmerino Jr wrote: > Thanks for replay, but this solution only remove the duplication of values > and sum of values duplication? pls show what output you really want. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Ta

Re: [Rails] Remove a record if it is duplicate end sum values

2012-08-03 Thread Esmerino Jr
Thanks for replay, but this solution only remove the duplication of values and sum of values duplication? Thanks again. On Fri, Aug 3, 2012 at 8:13 AM, botp wrote: > On Wed, Aug 1, 2012 at 8:35 PM, Esmerino Jr > wrote: > > I have a hash like so: > > > > list=[ > > {:cod => "0001", :name => "

Re: [Rails] Remove a record if it is duplicate end sum values

2012-08-03 Thread botp
On Wed, Aug 1, 2012 at 8:35 PM, Esmerino Jr wrote: > I have a hash like so: > > list=[ > {:cod => "0001", :name => "name1", :val => 10}, > {:cod => "0001", :name => "name1", :val => 12}, > {:cod => "0002", :name => "name2", :val => 13}, > {:cod => "0002", :name => "name2", :val => 14}, >

Re: [Rails] Development log also recorded while running in production mode

2012-08-03 Thread Colin Law
On 3 August 2012 11:12, sith wrote: > While running RAILS 3 application in production mode , the development log > also gets recorded along with production log.It should only give the > production log right? Right Colin -- You received this message because you are subscribed to the Google Grou

[Rails] Development log also recorded while running in production mode

2012-08-03 Thread sith
While running RAILS 3 application in production mode , the development log also gets recorded along with production log.It should only give the production log right? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group,

[Rails] Re: multiples table+one form or controller

2012-08-03 Thread durga g.
Hi i am new to rails.. can u explain me how do i store data into multiple table from one form.Explain me with sample code Also Explain me about association between tables..i studied many articles .but stil i am confuse. pls help me Thanks Durga -- Posted via http://www.ruby-forum.c

Re: [Rails] Testing Rails app

2012-08-03 Thread hanish jadala
i found the error thanks On Fri, Aug 3, 2012 at 1:55 PM, hanish jadala wrote: > i have followed rails guid and i got error and i posted in this link > > > https://raw.github.com/gist/3245786/8f7f95d0e980111cbfcccba9e2ecf7b63f6e1f29/test > > > On Fri, Aug 3, 2012 at 12:53 PM, Michael Pavling wrot

Re: [Rails] Testing Rails app

2012-08-03 Thread hanish jadala
i have followed rails guid and i got error and i posted in this link https://raw.github.com/gist/3245786/8f7f95d0e980111cbfcccba9e2ecf7b63f6e1f29/test On Fri, Aug 3, 2012 at 12:53 PM, Michael Pavling wrote: > On 3 August 2012 06:32, honey ruby wrote: > > Hi everyone i want to test a rails app

Re: [Rails] Testing Rails app

2012-08-03 Thread Colin Law
On 3 August 2012 08:23, Michael Pavling wrote: > On 3 August 2012 06:32, honey ruby wrote: >> Hi everyone i want to test a rails app and i have no idea on testing the >> rails app. Can any guide me how to test a rails app and what are the best >> way to test an app. > > Have you tried http://www.

Re: [Rails] How to remove a record if it is duplicate end sum values :val

2012-08-03 Thread Tom Meinlschmidt
saw something similar somewhere as a test for job seekers :) so don't know if someone will help you as it's not so hard to solve tom On Aug 1, 2012, at 15:25 , Esmerino Costa wrote: > I have a hash like so: > > list=[ > {:cod => "0001", :name => "name1", :val => 10}, > {:cod => "0001", :n

Re: [Rails] Rails app structure of search portal

2012-08-03 Thread Colin Law
On 1 August 2012 15:54, alecx wrote: > Hello, > I want to create an google-like app with one search box, where you can send > a request to different legacy databases. > And the results of the database requests should be displayed on one site > with jquery databse tables and flot charts . > But

Re: [Rails] Polymorphic one-to-one associations in Rails 3.2 - what's the "correct" Rails way?

2012-08-03 Thread Michael Pavling
On 1 August 2012 02:17, Neil Mowbray wrote: > Unless I'm being dumb I cannot find anything on Google search or in the > Rails books on how to create a one-to-one polymorphic association > (as apposed to a one-to-many polymorphic association). Change the has_many to a has_one, and you should have

Re: [Rails] Testing Rails app

2012-08-03 Thread Michael Pavling
On 3 August 2012 06:32, honey ruby wrote: > Hi everyone i want to test a rails app and i have no idea on testing the > rails app. Can any guide me how to test a rails app and what are the best > way to test an app. Have you tried http://www.google.co.uk/search?q=test+rails+app Imagine that each

Re: [Rails] How to remove a record if it is duplicate end sum values :val

2012-08-03 Thread Michael Pavling
On 1 August 2012 14:25, Esmerino Costa wrote: > I have a hash like so: That's not a hash, it's an array of hashes. > What I would like to learn how to do is how to remove a record if it is > duplicate end sum values :val. list.uniq! -- You received this message because you are subscribed to

[Rails] Remove a record if it is duplicate end sum values

2012-08-03 Thread Esmerino Jr
I have a hash like so: list=[ {:cod => "0001", :name => "name1", :val => 10}, {:cod => "0001", :name => "name1", :val => 12}, {:cod => "0002", :name => "name2", :val => 13}, {:cod => "0002", :name => "name2", :val => 14}, {:cod => "0002", :name => "name2", :val => 14}, {:cod => "0004",

Re: [Rails] ActiveResource and REST API

2012-08-03 Thread daemian mack
Sounds like you want to look at collection_name on your class. More here... http://www.quarkruby.com/2008/3/11/consume-non-rails-style-rest-apis/ On Tue, Jul 31, 2012 at 4:47 PM, Tom Allison wrote: > Ran into a great problem. REST, as it's implimented via Rails, identifies > the URL as a p

[Rails] Re: Start learning from Ruby or directly from Rails.

2012-08-03 Thread jez
Hi. Ruby, first so you can get along with Rails more easily, because in the first place, Rails is built using Ruby language. ;) Try Ruby @ tryruby.org that's where I learned the basics of Ruby. ^_^ After that, head on to CodeSchool and try RailsForZombie course, which is FREE. :) On Wednesd

Re: [Rails] Re: Polymorphic many-to-many relationship?

2012-08-03 Thread Bhushan Ahire
Does anyone got it working for Rails 3 On Sunday, 6 September 2009 18:58:19 UTC+5:30, Mark Studebaker wrote: > > Have you tried has_many_polymorphs (2.13) > > http://m.onkey.org/2007/8/14/excuse-me-wtf-is-polymorphs > > > -- > *From:* Heinz Strunk > *To:* rubyonrails-t

[Rails] Polymorphic one-to-one associations in Rails 3.2 - what's the "correct" Rails way?

2012-08-03 Thread Neil Mowbray
Folks, Unless I'm being dumb I cannot find anything on Google search or in the Rails books on how to create a one-to-one polymorphic association (as apposed to a one-to-many polymorphic association). New to Rails so please forgive my ignorance. The situation is simple: I have the following mode

Re: [Rails] Strange error: uninitialized constant Barby::Code128A on Heroku server?

2012-08-03 Thread Saravanan P
Hi I think your model name or controller name misspelled please check first line of your model or controller.. that should be correct proper name as you created... On Wed, Aug 1, 2012 at 11:43 PM, regedarek wrote: > I can`t figure out why on heroku server my app crashed. On local server > all

Re: [Rails] path methods. Where they came from?

2012-08-03 Thread Cedric de La Beaujardiere
On Monday, September 29, 2008 11:28:53 AM UTC-7, Eric Schulte wrote: > > They come from the map.resources lines in config/routes.rb. See > http://api.rubyonrails.org/classes/ActionController/Resources.html#M000696 > for more information. > This link is now invalid, I'm 90% sure the correct locatio

Re: [Rails] Start learning from Ruby or directly from Rails.

2012-08-03 Thread Capt. Downer
> > How to learn basics of Ruby and make learning interesting? How you all > > started with Ruby? Whether Ruby first or Rails first? > > > I personally started with Ruby first. I like the books from The > Pragmatic Bookshelf. (pragprog.com) Ruby first. Rails is a great tool for quickly generatin

[Rails] Rails app hosting in Network solution

2012-08-03 Thread Saravanan P
Hi everyone, I don't know how host to Ruby On Rails app in network solution. I uploaded file in "/var/www/vhosts/default/htdocs/rails/app-name". I also used haml in my rails application. Can any one help me :) Thank You! Saravanan.P -- You received this message because you are subscribed

[Rails] Nested Forms with belongs_to association

2012-08-03 Thread John Chow
tl;dr: nested attributes isn't setting the belongs_to association I have these two models right now: class Organization < ActiveRecord::Base has_many :groups belongs_to :main_group, :class_name => Group.name, :foreign_key => :main_group_id, :autosave => true validates_presence_of :main_gr

[Rails] Re: Rails 3.3.5 to Rails 3.2 error

2012-08-03 Thread riedwards
Hello, Your class Project does not have a method by the name 'id'. Please review the logic of your code :-) On Tuesday, July 31, 2012 2:30:22 PM UTC+3, Ruby-Forum.com User wrote: > > I have installed the latest version of rails and jruby. I have copied > all my files from rails 2.3.5 version an

[Rails] Rails app structure of search portal

2012-08-03 Thread alecx
Hello, I want to create an google-like app with one search box, where you can send a request to different legacy databases. And the results of the database requests should be displayed on one site with jquery databse tables and flot charts . But I am having problems to display all the results

[Rails] How to remove a record if it is duplicate end sum values :val

2012-08-03 Thread Esmerino Costa
I have a hash like so: list=[ {:cod => "0001", :name => "name1", :val => 10}, {:cod => "0001", :name => "name1", :val => 12}, {:cod => "0002", :name => "name2", :val => 13}, {:cod => "0002", :name => "name2", :val => 14}, {:cod => "0002", :name => "name2", :val => 14}, {:cod => "0004