[Rails] Duplicate queries while eager loading multiple associations

2012-09-17 Thread Dennis Krupenik
Hello all, given the following models and console log: https://gist.github.com/3735116 I do not understand why the latter statements (o.order_items and o.total) yield sql queries. Have I missed something in AR documentation? What should be done to get rid of redundant sql queries? -- You

[Rails] Biometrics fingerprint scanner in RoR? Is it possible? and how?

2012-09-17 Thread RoR newbie
I'm a graduating student of IT right now and in a couple of months, we'll be starting on a new project in the University. My group and I decided to create a voting system which requires Fingerprint scanner to identify the voters and make the voting process more secured. I still don't know how

[Rails] Re: Duplicate queries while eager loading multiple associations

2012-09-17 Thread Frederick Cheung
On Monday, September 17, 2012 2:45:05 AM UTC+1, Dennis Krupenik wrote: Hello all, given the following models and console log: https://gist.github.com/3735116 I do not understand why the latter statements (o.order_items and o.total) yield sql queries. Have I missed something in AR

Re: [Rails] Biometrics fingerprint scanner in RoR? Is it possible? and how?

2012-09-17 Thread Jim Ruther Nill
Hi! On Mon, Sep 17, 2012 at 12:45 PM, RoR newbie johnelau...@yahoo.com wrote: I'm a graduating student of IT right now and in a couple of months, we'll be starting on a new project in the University. My group and I decided to create a voting system which requires Fingerprint scanner to

[Rails] confusion about a exercise

2012-09-17 Thread roelof
Hello, I try to learn myself Ror by following this tutorial : Now I have to make this exercise : Make a Contact page for the sample app. First write a test for the existence of a page at the URI /static_pages/contact. (Hint: Test for the right title.) Then write a second test for the title

Re: [Rails] Biometrics fingerprint scanner in RoR? Is it possible? and how?

2012-09-17 Thread Gintautas Šimkus
Firstly, it doesn't seem right to make a decision while you are still unsure if that is doable by the deadline. In theory I don't see why it couldn't be possible, just it could require a lot of work. But isn't it the point for your group of educated people to come up with something in such a

Re: [Rails] confusion about a exercise

2012-09-17 Thread Gintautas Šimkus
Indeed this is confusing. Can you provide an URL for the exercise? 2012/9/17 roelof rwob...@hotmail.com Hello, I try to learn myself Ror by following this tutorial : Now I have to make this exercise : Make a Contact page for the sample app. First write a test for the existence of a page

Re: [Rails] (JOB) Looking for RoR Engineer

2012-09-17 Thread Gintautas Šimkus
Panayotis Matsinopoulos, I think we agree on the issue of getting enough basic info from the initial ad text. I felt my thoughts about Greece was correct in general, but loosely (and harshly) phrased. So I take the bankrupt word back; though that's how I'd feel about this particular country of

[Rails] Re: New to Ruby

2012-09-17 Thread Samir
Thanks Friends. All the above links are really very helpful. :) On Saturday, September 15, 2012 10:46:15 AM UTC+5:30, Samir wrote: Hi Friends. I am extremely new to Ruby. can you please suggest me how to proceed to grab this in a short span of time... -- You received this message because

[Rails] Re: Lottery Number Matching

2012-09-17 Thread Samir
BPUT On Friday, September 14, 2012 7:00:40 PM UTC+5:30, Samir wrote: Can any body please help me to solve this? Create a lottery app which will take a number as parameter and there will be a set of number from 0 to n random number every time. If the given number matches the random

[Rails] Re: Lottery Number Matching

2012-09-17 Thread Samir
Here I have tried a bit. class Constlottery def self.rand_number randoms = [] loop do puts Enter a random number new_number = gets.chomp if new_number.to_s == rand(1..9).to_s puts You are winner return

Re: [Rails] Re: Lottery Number Matching

2012-09-17 Thread Jim Ruther Nill
On Mon, Sep 17, 2012 at 7:02 PM, Samir samirkanta.d...@indusnet.co.inwrote: Here I have tried a bit. class Constlottery def self.rand_number randoms = [] loop do puts Enter a random number new_number = gets.chomp if new_number.to_s

Re: [Rails] Re: Lottery Number Matching

2012-09-17 Thread Samir
Hi Jim. Thanks for the Suggestions. I will definitely work on it..But as i am new to Ruby m a bit worried how to catch the track and jump for development. On Monday, September 17, 2012 2:43:47 PM UTC+5:30, jim wrote: On Mon, Sep 17, 2012 at 7:02 PM, Samir

Re: [Rails] Re: Lottery Number Matching

2012-09-17 Thread Jim Ruther Nill
On Mon, Sep 17, 2012 at 7:28 PM, Samir samirkanta.d...@indusnet.co.inwrote: Hi Jim. Thanks for the Suggestions. I will definitely work on it..But as i am new to Ruby m a bit worried how to catch the track and jump for development. Is this something that the university gave you as a personal

[Rails] Re: Lottery Number Matching

2012-09-17 Thread Samir
Personal Exercise On Friday, September 14, 2012 7:00:40 PM UTC+5:30, Samir wrote: Can any body please help me to solve this? Create a lottery app which will take a number as parameter and there will be a set of number from 0 to n random number every time. If the given number matches

[Rails] Re: New to Ruby

2012-09-17 Thread Wasif Hyder
http://ureddit.com/class/40250/web-programming-with-ruby-on-rails - This is a good choice to supplement with the Ruby on Rails tutorial. Once you get through these comfortably, you can move onto more advanced topics, and books. Also, Try keeping a blog as a journal and keep track of your day to

[Rails] Re: New to Ruby

2012-09-17 Thread Samir
Hi, Thanks for the Link. I am working on Linux environment On Monday, September 17, 2012 3:22:51 PM UTC+5:30, Wasif Hyder wrote: http://ureddit.com/class/40250/web-programming-with-ruby-on-rails - This is a good choice to supplement with the Ruby on Rails tutorial. Once you get through

Re: [Rails] confusion about a exercise

2012-09-17 Thread roelof
Yes, I can. The exercise can be found here : http://ruby.railstutorial.org/chapters/static-pages#sec-static_pages_exercises Roelof Op maandag 17 september 2012 10:07:48 UTC+2 schreef Dihital het volgende: Indeed this is confusing. Can you provide an URL for the exercise? 2012/9/17 roelof

Re: [Rails] confusion about a exercise

2012-09-17 Thread Gintautas Šimkus
OK I am lost in this particular workflow. You should just test for title and that's it. I don't see how 2 specs are needed for that. Sorry I couldn't help. 2012/9/17 roelof rwob...@hotmail.com Yes, I can. The exercise can be found here :

Re: [Rails] confusion about a exercise

2012-09-17 Thread Jonathan Maddison
Well, if you're trying not to look at the answer - the first test is meant to look at the title that is actually displayed on the page (i.e. heading), and the second test is supposed to check the actual HTML page title (i.e. title tag). On Mon, Sep 17, 2012 at 9:11 PM, roelof rwob...@hotmail.com

[Rails] Re: Duplicate queries while eager loading multiple associations

2012-09-17 Thread Dennis Krupenik
thanks a lot, that did it -- 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.

[Rails] Connecting to an external DB

2012-09-17 Thread Eastside Developer
I am trying to connect to an external database from my Rails application. In my datanase.yml file, I have the following: external_db: adapter: mysql2 database: external_src username: external_src password: mypassword host: myblog.com The database is going to called to retrieve data

Re: [Rails] Simpleton routes

2012-09-17 Thread Joshua Niehus
Indeed, you are right! I saw what I was doing wrong. Thank you, Josh In your wisdom, I am humbled On Sunday, September 16, 2012 10:26:02 PM UTC-7, Hassan Schroeder wrote: Actually, your app goes to some blank page. The guide I linked to earlier explains how to control that :-) If that's

Re: [Rails] Biometrics fingerprint scanner in RoR? Is it possible? and how?

2012-09-17 Thread Scott Ribe
On Sep 16, 2012, at 8:45 PM, RoR newbie wrote: I'm a graduating student of IT right now and in a couple of months, we'll be starting on a new project in the University. My group and I decided to create a voting system which requires Fingerprint scanner to identify the voters and make the

Re: [Rails] Biometrics fingerprint scanner in RoR? Is it possible? and how?

2012-09-17 Thread Walter Lee Davis
On Sep 17, 2012, at 12:14 PM, Scott Ribe wrote: On Sep 16, 2012, at 8:45 PM, RoR newbie wrote: I'm a graduating student of IT right now and in a couple of months, we'll be starting on a new project in the University. My group and I decided to create a voting system which requires

[Rails] Cannot redirect to nil! - basic MVC operation

2012-09-17 Thread Bogdan M.
(I'm having some hard time for days to manage to chose a random item from teh database and to be able to pass it further.) It is basic operation and i tried several ways all, brought me to the same problem, params {id = random} - the name of the controller method controller: def random #

[Rails] require current_password to update user information

2012-09-17 Thread dasibre
Rails newbie here, I have been stuck on this for two days and can't figure out why its not working. I want users to confirm/verify themselves by entering their current/old password before any information is updated. This is what My user_controller update action looks like I'm currently using

Re: [Rails] Cannot redirect to nil! - basic MVC operation

2012-09-17 Thread Hassan Schroeder
On Mon, Sep 17, 2012 at 9:31 AM, Bogdan M. li...@ruby-forum.com wrote: controller: def random @task = Task.find(rand(Task.first.id..Task.last.id)) # REMOVE - UNNECESSARY render random end random.html.erb %= @task % # i want it to make it work, if i pass manually

[Rails] is Phusion Passenger really supported?

2012-09-17 Thread Scott Ribe
And if so, is there a better place than the google group? I have installed twice on OS X 10.6.8 (with nginx, using rvm), once on a dev system where I have had absolutely no problem, and once on a test system where PassengerHelperAgent crashes and results in the app being inaccessible every few

[Rails] Re: inheriting from StandardError

2012-09-17 Thread John Merlino
So we must build an entire class just for sake of more specific rescue statements: class MyError StandardError end try_counter = 0 begin try_counter += 1 puts 'Here 1' raise MyError.new Text unless try_counter 5 puts 'Here 2' rescue MyError puts 'Here 3 - MyError encountered' retry

Re: [Rails] Biometrics fingerprint scanner in RoR? Is it possible? and how?

2012-09-17 Thread Jim
This is not a rails question at all. It's a web browser fingerprint scanner question. Is there any way to access fingerprint scanner results from a web browser? If so, using RoR to handle the backend of the web application is no different than any other web app. If not, rails

[Rails] gem file showing outdated gems?

2012-09-17 Thread wragen22
For some reason my gem file in my rails app shows outdated versions of gems even though i've updated. Ie. gem 'uglifier', '= 1.0.3' However after running bundle update my terminal showed Using uglifier (1.3.0) Is there a dependency path that is incorrect? How can I make sure my gemfile

Re: [Rails] gem file showing outdated gems?

2012-09-17 Thread Jordon Bedwell
On Mon, Sep 17, 2012 at 2:44 PM, wragen22 bradwr...@gmail.com wrote: For some reason my gem file in my rails app shows outdated versions of gems even though i've updated. Ie. gem 'uglifier', '= 1.0.3' However after running bundle update my terminal showed Using uglifier (1.3.0) Is there

Re: [Rails] gem file showing outdated gems?

2012-09-17 Thread wragen22
Ok. Something interesting though. I've updated the version in the gemfile. Then when I run bundle update the gem file is then modified and version reverts back to old versions. On Monday, September 17, 2012 12:48:44 PM UTC-7, Jordon Bedwell wrote: On Mon, Sep 17, 2012 at 2:44 PM, wragen22

[Rails] Re: Creating a link_to from a collection_select

2012-09-17 Thread Brian Ekmark
Shameless bump ... can anyone help on this? On Thursday, September 13, 2012 9:32:34 AM UTC-5, Brian Ekmark wrote: I want to be able to change one attribute of a link_to to be what is the current selection of the collection_select. And needless to say I can't quite figure it out.

[Rails] Unable to install gem on mountain lion?

2012-09-17 Thread wragen22
Hello, I'm trying to install a specific gem but getting this error message below. ERROR: Error installing nokogiri: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb mkmf.rb can't find header files for ruby

Re: [Rails] Re: Creating a link_to from a collection_select

2012-09-17 Thread Jim Ruther Nill
On Tue, Sep 18, 2012 at 7:16 AM, Brian Ekmark brian.ekm...@gmail.comwrote: Shameless bump ... can anyone help on this? On Thursday, September 13, 2012 9:32:34 AM UTC-5, Brian Ekmark wrote: I want to be able to change one attribute of a link_to to be what is the current selection of the

[Rails] multiple modules defining same method included into a class

2012-09-17 Thread John Merlino
In Ruby, classes are never closed: you can always add methods to an existing class. This applies to the classes you write as well as the standard, built-in classes. All you have to do is open up a class definition for an existing class, and the new contents you specify will be added to whatever's

[Rails] Nginx + Phusion Passenger 3 problem with 504 Gateway time-out

2012-09-17 Thread Sebastião Giacheto F . Júnior
Hi, I have a Rails 3.2 app. There is a specific request that takes a long time to execute. The context is, the user uploads a pdf, and then we have some processing through carrierwave + rmagick that generate a jpeg from the first page of the document. Everything works in dev mode using both

Re: [Rails] Nginx + Phusion Passenger 3 problem with 504 Gateway time-out

2012-09-17 Thread Benjamin Iandavid Rodriguez
For actions that take a lot of time I suggest to send it to the background if possible, you can use: - resque https://github.com/defunkt/resque - sideqik http://mperham.github.com/sidekiq/ Regards 2012/9/17 Sebastião Giacheto F. Júnior sebastor...@gmail.com Hi, I have a Rails 3.2 app.

[Rails] Re: multiple modules defining same method included into a class

2012-09-17 Thread John Merlino
So it does appear that the ActionController::Rendering module does include AbstractController::Rendering, which means a call to super in the render method of ActionController::Rendering will in turn call the render method of AbstractController::Rendering. What makes this somewhat confusing is

[Rails] Re: Nginx + Phusion Passenger 3 problem with 504 Gateway time-out

2012-09-17 Thread Sebastião Giacheto F . Júnior
Thanks for your reply, but there's actually no need for speed increase or scalability whatsoever so there's no need to setup a background job queue system. If I cannot solve this problem, I'll probably try thin instead of passenger. I'm actually curious about the solution of this issue :D On Sep

Re: [Rails] Re: Nginx + Phusion Passenger 3 problem with 504 Gateway time-out

2012-09-17 Thread Benjamin Iandavid Rodriguez
Many times I find best to use Nginx + unicorn as the app server, you might give that a try. 2012/9/17 Sebastião Giacheto F. Júnior sebastor...@gmail.com Thanks for your reply, but there's actually no need for speed increase or scalability whatsoever so there's no need to setup a background job

[Rails] pg gem error

2012-09-17 Thread Saravanan P
gem install pg give the following error, please help how can i solve this Building native extensions. This could take a while... ERROR: Error installing pg: ERROR: Failed to build gem native extension. /home/saravanan/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb checking for

Re: [Rails] pg gem error

2012-09-17 Thread Christopher R. Maden
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 09/18/2012 01:29 AM, Saravanan P wrote: gem install pg give the following error, please help how can i solve this Building native extensions. This could take a while... ERROR: Error installing pg: ERROR: Failed to build gem native extension.

[Rails] PDF file is crashing

2012-09-17 Thread kiran cy
PDF file is crashing in my app because of the images present in the pdf which are madeup of polygons so i tried to convert the pdf to images and images back to pdf but there is drastic change in the quality of pdf so i tried to view the pdf in browser and to convert the html to pdf. Is it possible

Re: [Rails] How to read Microsoft document file in ruby on rails ?

2012-09-17 Thread rovin varshney
Hello Everyone, Thanks everyone.Finally got a solution while searching things that you all had explained. There is a docx gem for parsing docx file and docx-html for convert it into HTML. require 'docx' d = Docx::Document.open('example.docx')d.each_paragraph do |p| puts dend and for

Re: [Rails] pg gem error

2012-09-17 Thread Saravanan P
i already installed postgresql. postgresql-dev i think its not a package, did you mean libpq-dev. if yes i already installed that too. i am using ubuntu 12.04. In my error checking for pg_config... yes Using config values from /usr/bin/pg_config checking for libpq-fe.h... yes checking for

[Rails] Find the largest value of given 3 values

2012-09-17 Thread Maddy
Hi folks, Good day! *I want to find the largest value of given 3 values.* *Please suggest me,the simple ways of finding the largest value.* -- 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