[Rails] Skip index in array.each_with_index loop

2013-05-23 Thread Ajit Teli
Can anyone help me on how to skip index in ARRAY.each_with_index loop? Please look at below case: In a ARRAY.each_with_index loop, I would like increase the index by 10 whenever a condition is met. arr is array of numbers from 0 to 50 arr.each_with_index do |x,i| if i % 10 == 0 puts #{x}

Re: [Rails] Skip index in array.each_with_index loop

2013-05-23 Thread Dheeraj Kumar
Use the `next` statement. http://www.tutorialspoint.com/ruby/ruby_loops.htm -- Dheeraj Kumar On Thursday 23 May 2013 at 2:54 PM, Ajit Teli wrote: Can anyone help me on how to skip index in ARRAY.each_with_index loop? Please look at below case: In a ARRAY.each_with_index loop, I would

[Rails] Re: Skip index in array.each_with_index loop

2013-05-23 Thread Javix
On Thursday, 23 May 2013 11:24:36 UTC+2, Ruby-Forum.com User wrote: Can anyone help me on how to skip index in ARRAY.each_with_index loop? Please look at below case: In a ARRAY.each_with_index loop, I would like increase the index by 10 whenever a condition is met. arr is array of

[Rails] rake assets:precompile issue with JS and stylesheets files with similar name

2013-05-23 Thread Farukh D.M
Hi, I've got following two files with same names under javascripts and stylesheets directories as: - app/assets/javascripts/test_vendor.js - app/assets/stylesheets/test_vendor.scss Essentially a JS and an stylesheet files with same name.

[Rails] Re: Skip index in array.each_with_index loop

2013-05-23 Thread Ajit Teli
Dear Dheeraj, Thanks for your reply. The statement `next` will increment the index by 1. But I want to increment the index by 10. 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

Re: [Rails] Re: Skip index in array.each_with_index loop

2013-05-23 Thread Dheeraj Kumar
use `next if (i % 10 != 0)` -- Dheeraj Kumar On Thursday 23 May 2013 at 3:25 PM, Ajit Teli wrote: Dear Dheeraj, Thanks for your reply. The statement `next` will increment the index by 1. But I want to increment the index by 10. Thanks, -- Posted via

[Rails] Re: rake assets:precompile issue with JS and stylesheets files with similar name

2013-05-23 Thread Farukh D.M
Never mind, My bad :) I was not using correct convention for including css file. it has to be test_vendor.css instead of test_vendor.scss Following works. *config.assets.precompile += %w(test_vendor.js test_vendor.css)* On Thursday, 23 May 2013 15:20:51 UTC+5:30, Farukh D.M wrote: Hi,

[Rails] Re: Skip index in array.each_with_index loop

2013-05-23 Thread jsnark
Write a loop that generates the desired indexes and then reference arr: (0..5).each do |j| i = 10*j puts #{arr[i]} at #{i} end Your example output does not match the code. It does not include 0, 20, and 40. On Thursday, May 23, 2013 5:24:36 AM UTC-4, Ruby-Forum.com User wrote: Can

[Rails] Re: Skip index in array.each_with_index loop

2013-05-23 Thread Robert Walker
jsnark wrote in post #1109941: Write a loop that generates the desired indexes and then reference arr: (0..5).each do |j| i = 10*j puts #{arr[i]} at #{i} end Your example output does not match the code. It does not include 0, 20, and 40. # Print every 10th object

Re: [Rails] Skip index in array.each_with_index loop

2013-05-23 Thread Rob Biedenharn
On 2013-May-23, at 05:24 , Ajit Teli wrote: Can anyone help me on how to skip index in ARRAY.each_with_index loop? Please look at below case: In a ARRAY.each_with_index loop, I would like increase the index by 10 whenever a condition is met. arr is array of numbers from 0 to 50

[Rails] Does someone there experience with resque worker and appfog?

2013-05-23 Thread bh
I couldn't run resque workers in appfog (RoR+Resque+Appfog) -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com.

[Rails] First capistrano deploy question

2013-05-23 Thread Alfred Nutile
Seems like it went well. The site is there. And when I do an update and push to it with git and run cap deploy again I can see my edits in a file on the server but not on the webpage. For example if I go into the folder current and run grep -rn 'testingcapdeploy1' * I get

[Rails] How to do it the rest way ? Question from fledgeling Ruby programmer

2013-05-23 Thread Mateusz Urban
Hi! Reading Rails For .NET Developers i started to consider the example of building the flight system with cancellations. So, I've generated flights scaffold and passengers scaffold and I'd like that we could cancel the flight and then, each of the passengers would be informed about that fact.

Re: [Rails] Re: Skip index in array.each_with_index loop

2013-05-23 Thread Colin Law
On 23 May 2013 13:52, jsnark s...@monmouth.com wrote: Write a loop that generates the desired indexes and then reference arr: (0..5).each do |j| i = 10*j puts #{arr[i]} at #{i} end Your example output does not match the code. It does not include 0, 20, and 40. I don't think the OP

Re: [Rails] How to do it the rest way ? Question from fledgeling Ruby programmer

2013-05-23 Thread Colin Law
On 23 May 2013 12:56, Mateusz Urban mateuszurb...@gmail.com wrote: Hi! Reading Rails For .NET Developers i started to consider the example of building the flight system with cancellations. So, I've generated flights scaffold and passengers scaffold and I'd like that we could cancel the flight

[Rails] Re: How to do it the rest way Question from fledgeling Ruby programmer

2013-05-23 Thread Robert Walker
Colin Law wrote in post #1109974: There is no need for a separate controller, one way would be to handle it within the flights controller Edit action, using a url parameter or the Submit button name to indicate that cancel is required rather than edit. However, REST should not be treated as a

Re: [Rails] Re: How to do it the rest way Question from fledgeling Ruby programmer

2013-05-23 Thread Colin Law
On 23 May 2013 21:30, Robert Walker li...@ruby-forum.com wrote: Colin Law wrote in post #1109974: There is no need for a separate controller, one way would be to handle it within the flights controller Edit action, using a url parameter or the Submit button name to indicate that cancel is

Re: [Rails] Does someone there experience with resque worker and appfog?

2013-05-23 Thread Hassan Schroeder
On Wed, May 22, 2013 at 8:30 AM, bh bakhtiyo...@gmail.com wrote: I couldn't run resque workers in appfog (RoR+Resque+Appfog) Suggested: http://www.catb.org/esr/faqs/smart-questions.html -- Hassan Schroeder hassan.schroe...@gmail.com http://about.me/hassanschroeder

[Rails] Re: Re: How to do it the rest way Question from fledgeling Ruby programmer

2013-05-23 Thread Robert Walker
Colin Law wrote in post #1109983: On 23 May 2013 21:30, Robert Walker li...@ruby-forum.com wrote: creating a new flight on the collection of flights, rather than changing the state of an existing flight. Sure POST would work (and technically PATH/PUT is simulated using a POST), but using

[Rails] Re: First capistrano deploy question

2013-05-23 Thread mike
On Wednesday, May 22, 2013 1:26:06 PM UTC-4, Alfred Nutile wrote: Seems like it went well. The site is there. And when I do an update and push to it with git and run cap deploy again I can see my edits in a file on the server but not on the webpage. For example if I go into the folder

[Rails] feature requests/voting/tracking solution

2013-05-23 Thread slavix slavix
Hello, I am looking for a good solution for a community development project. I want users or our application to be able to create feature requests, vote on them and track progress over time. I have done a little research found this to be closest to what I am looking for.