Re: [Rails] Re: problem on subtract one year from current year in ruby on rails

2011-12-13 Thread amvis
Thanks for the reply. get each month data between year. ie [ 2010-12-13 to 2011-12-13]. here i got this current date and last date in rails. have any idea to select that? i have to fetch the data in each month from database? Thank you vishnu -- You received this message because you are

Re: [Rails] Re: problem on subtract one year from current year in ruby on rails

2011-12-13 Thread Michael Pavling
On 13 Dec 2011 08:08, amvis vgrkrish...@gmail.com wrote: any idea to select that? i have to fetch the data in each month from database? Yes. what have you tried? -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group,

Re: [Rails] Re: problem on subtract one year from current year in ruby on rails

2011-12-13 Thread amvis
*Date.today.month or Time.now.month* to get the month then how will continue. i think about that on how to continue. But i can't proceed. i need to take the each month report from the one year. -- You received this message because you are subscribed to the Google Groups Ruby on Rails:

[Rails] Web Application Development Beginner

2011-12-13 Thread Libber
Dear all, I am new to this web application development and have no previous background. I need to develop a web application which does the following duties. 1) Take a txt file as input from the clients. 2) Use this input and run a set of C++ programs at the server side. 3) Create a pdf file

[Rails] Radio buttons

2011-12-13 Thread Reva
hi i m new to rails and i m facinga problem with radio buttons. i need to create a portal with multiple choice question. i m using html here. once i submit the answer the page is getting refreshed and the selected radio button is also refreshed. and is show a page with no radio button selected.

[Rails] Re: ExecJS::RuntimeError in Home#index

2011-12-13 Thread Luis Lavena
On Dec 12, 8:23 pm, zigomir ziz li...@ruby-forum.com wrote: This is crime. Dunno why are you having this level of issues. On a fresh installation of Windows and RailsInstaller I was able to use execjs with the Windows Scripting Host by default without issues. There was no need to install node,

[Rails] Sub queries problem with Active Record

2011-12-13 Thread amvis
*select count(*) from ( * * SELECT loyalty_id FROM transactions GROUP BY loyalty_id HAVING COUNT(*)1 * *) as t * problem when writing the corresponding rails queries...? I am using * Rails2.3.11* Also this have error *select sum(points) from transactions where transaction_type

Re: [Rails] Sub queries problem with Active Record

2011-12-13 Thread Jim Ruther Nill
On Tue, Dec 13, 2011 at 8:31 PM, amvis vgrkrish...@gmail.com wrote: *select count(*) from ( * * SELECT loyalty_id FROM transactions GROUP BY loyalty_id HAVING COUNT(*)1 * *) as t * problem when writing the corresponding rails queries...? I am using * Rails2.3.11* Also

Re: [Rails] Sub queries problem with Active Record

2011-12-13 Thread amvis
Thanks for the reply.. sorry, that made a mistake when i post here. that query had't an id. i think the problem with rails version..? am using rails2.3.11. This is mysql query *select sum(points) from transactions where transaction_type =new_customer or transaction_type= review or

[Rails] Re: help with temporary database tables

2011-12-13 Thread jsnark
Fred, Thank you so very much for your response. If I am understanding you correctly, you are confirming my conclusion that the only way to use temporary tables with sqlite3 and mysql is to use raw SQL. -- You received this message because you are subscribed to the Google Groups Ruby on Rails:

[Rails] Re: Upgrading from rails 1.8 to rails 3

2011-12-13 Thread CavalryJim
On Dec 12, 11:35 am, Frederick Cheung frederick.che...@gmail.com wrote: On Dec 12, 3:42 pm, Chloe Koh pehwah@gmail.com wrote: Hi guys, I need some help with my ruby on rails application. I want to upgrade it from rails 1.8 to rails 3. Can anyone help me? There is no rails 1.8 (rails

Re: [Rails] Radio buttons

2011-12-13 Thread Walter Lee Davis
On Dec 13, 2011, at 1:11 AM, Reva wrote: hi i m new to rails and i m facinga problem with radio buttons. i need to create a portal with multiple choice question. i m using html here. once i submit the answer the page is getting refreshed and the selected radio button is also refreshed. and

Re: [Rails] Make text field accepts only numeric values

2011-12-13 Thread Walter Lee Davis
I would go ahead and code the input type=number element from HTML5, then provide a fallback for visitors whose browsers don't understand that element. Here's a Prototype.js solution, modify if needed to jQuery depending on your environment: //include prototype.js before this point

[Rails] Re: Make text field accepts only numeric values

2011-12-13 Thread JavierQQ
On 12 dic, 16:28, Angelo Cordova acord...@gmail.com wrote: Hello people I need your help again. What I want to do is make a text field accepts only numeric values... Thant's means if I press a letter or a simbol the text field should not be filled, it should be just if I press a number.

[Rails] Validates presence

2011-12-13 Thread JavierQQ
Hi everyone, I just need a quick help :) What is the best way to write some code in :presence option? I have a Question model and one of the fields is question_type: - example question - static question Each question has alternatives, and each of them has scores What I want is to validate

[Rails] is that a good example for using has_many :through?

2011-12-13 Thread Mauro
I have Company has_many :categories and Category has_many :companies. One Company for an associated Category has classifications, example: Company-1 has Category OG1 with Classification_type I Classification_amount 10.000 and Classification_type II Classification_amount 50.000. Is that a good

Re: [Rails] Make text field accepts only numeric values

2011-12-13 Thread Walter Lee Davis
Typo, left out a trailing parenthesis: //include prototype.js before this point document.observe('dom:loaded', function(){ var test = new Element('input',{type:'number'}); if(test.type != 'number'){ $$('input[type=number]').each(function(elm){ elm.observe('blur',function(evt){

[Rails] Re: Validates presence

2011-12-13 Thread JavierQQ
Well I found the code here: http://stackoverflow.com/questions/1673812/rails-validation-for-users-email-only-want-it-to-validate-when-a-user-signs-up validates :score, :presence = true, :if = Proc.new{ (some code here) } -- You received this message because you are subscribed to the Google

[Rails] where define the script_name?

2011-12-13 Thread blackspace
module ActionController module UrlFor extend ActiveSupport::Concern include AbstractController::UrlFor I have read the rails source.In the actionpack/lib/action_controller/ metal/url_for.rb def url_options @_url_options ||= super.reverse_merge( :host = request.host,

[Rails] Trouble setting up Rails with a JS runtime environment

2011-12-13 Thread Nathan Feaver
Hi all, I'm using Ubuntu 11.10 and the terminal to install and run Rails. Here is the process I've taken so far to setup Rails: download and install Ruby 1.9.2 and Rails 3.1.0 -- I did this using 'sudo apt-get ruby1.9.1' and 'sudo gem install rails' I made a new rails app using 'rails new

Re: [Rails] passenger and postgresql in production environment

2011-12-13 Thread Craig White
On Dec 12, 2011, at 6:34 PM, gato pardo wrote: I should remenber that there are no great differences between development and production section in the database yml file. # config/database.yml development: adapter: postgresql encoding: unicode database: db_album

[Rails] Is Rails on IIS dead?

2011-12-13 Thread John Doe
Internet references are years out of date and links to downloads broken. Is Rails on IIS dead? We need to make a development decision and right now the situation it looks dire for Ruby on Rails... We could do with a straight answer. -- Posted via http://www.ruby-forum.com/. -- You received

[Rails] Re: where define the script_name?

2011-12-13 Thread Frederick Cheung
On Dec 13, 2:28 pm, blackspace weiwuf...@gmail.com wrote: what mean the script_name?where define the script_name? It's part of the environment you get from rack / your web server (apache, nginx etc.). I'd check either the rack source or the documentation for your web server for its precise

Re: [Rails] Is Rails on IIS dead?

2011-12-13 Thread Kevin Bedell
What is IIS? On Tue, Dec 13, 2011 at 12:16 PM, John Doe li...@ruby-forum.com wrote: Internet references are years out of date and links to downloads broken. Is Rails on IIS dead? -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post

Re: [Rails] Is Rails on IIS dead?

2011-12-13 Thread Michael Pavling
On 13 December 2011 17:16, John Doe li...@ruby-forum.com wrote: Internet references are years out of date and links to downloads broken. Is Rails on IIS dead? Was it ever alive?! :-/ We need to make a development decision and right now the situation it looks dire for Ruby on Rails... We

[Rails] jquery questions

2011-12-13 Thread Craig White
Rails 3.1.x 2 questions... Perhaps I am doing this too much in the raw of jquery but I can't seem to find any other way to do these things 1 - drag_drop.js has... $.post( groups/add_member/, { add: ui.draggable.text() } ); which is almost everything I want but I want to add

Re: [Rails] Is Rails on IIS dead?

2011-12-13 Thread Walter Lee Davis
On Dec 13, 2011, at 12:16 PM, John Doe wrote: Internet references are years out of date and links to downloads broken. Is Rails on IIS dead? We need to make a development decision and right now the situation it looks dire for Ruby on Rails... We could do with a straight answer. Do any of

Re: [Rails] Is Rails on IIS dead?

2011-12-13 Thread DK
On Tue, Dec 13, 2011 at 12:21 PM, Michael Pavling pavl...@gmail.com wrote: On 13 December 2011 17:16, John Doe li...@ruby-forum.com wrote: Internet references are years out of date and links to downloads broken. Is Rails on IIS dead? Was it ever alive?! :-/ We need to make a development

[Rails] Re: Is Rails on IIS dead?

2011-12-13 Thread John Doe
Kevin Bedell wrote in post #1036546: What is IIS? Your are kidding, right? -- 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

Re: [Rails] is that a good example for using has_many :through?

2011-12-13 Thread Dave Aronson
On Tue, Dec 13, 2011 at 11:17, Mauro mrsan...@gmail.com wrote: I have Company has_many :categories and Category has_many :companies. One Company for an associated Category has classifications, example: Company-1 has Category OG1 with Classification_type I Classification_amount 10.000 and

Re: [Rails] Re: Is Rails on IIS dead?

2011-12-13 Thread Michael Pavling
On 13 Dec 2011 17:31, John Doe li...@ruby-forum.com wrote: Kevin Bedell wrote in post #1036546: What is IIS? Your are kidding, right? Why should he be? This is a Rails list; if you asked on a .Net list whether C# apps could be deployed with Passenger, some people there might ask what

Re: [Rails] Re: Is Rails on IIS dead?

2011-12-13 Thread Michael Pavling
On 13 December 2011 17:40, Michael Pavling pavl...@gmail.com wrote: This is a Rails list; if you asked on a .Net list whether C# apps could be deployed with Passenger, some people there might ask what 'Passenger' is :-/ /s/Passenger/Nginx ...would probably be a better equivalent ;-) -- You

Re: [Rails] Is Rails on IIS dead?

2011-12-13 Thread Michael Pavling
On 13 December 2011 17:31, DK structuralartis...@gmail.com wrote: not sure but I hear the folks at Bloomberg.com develop rails on windows, not sure if they deploy to windows but maybe that is a lead. But really my experience was a nightmare trying to deploy on windows. Windows is not

[Rails] Re: Is Rails on IIS dead?

2011-12-13 Thread John Doe
I appreciate the answers, but, why is everyone asking about my business case for IIS? Suffice it to say that I am bound by corporate policy which is now committed to Microsoft technology. I don't want to get into an argument over merits of Apache versus IIS but corporate policy perceives

Re: [Rails] Re: Is Rails on IIS dead?

2011-12-13 Thread Michael Pavling
On 13 December 2011 17:56, John Doe li...@ruby-forum.com wrote: I appreciate the answers, but, why is everyone asking about my business case for IIS? Because you're telling us about a problem you have, and we're asking you to back-up a little... Suffice it to say that I am bound by corporate

[Rails] Re: Is Rails on IIS dead?

2011-12-13 Thread John Doe
Michael Pavling wrote in post #1036557: On 13 December 2011 17:31, DK structuralartis...@gmail.com wrote: Windows is not necessarily IIS - it's perfectly possible to deploy on Windows (with Apache, Passenger, etc). Deploying with IIS as per the OP... that's likely to be much harder. I am

Re: [Rails] Is Rails on IIS dead?

2011-12-13 Thread Miquel Cubel
Hi, You can have a look at http://www.helicontech.com/zoo/ I used to work with .Net, now I'm developing with RoR (for a year) from windows platform, and my recommendation will be to stay with ubuntu + apache server for production, as much as I will

Re: [Rails] Re: Is Rails on IIS dead?

2011-12-13 Thread Craig White
On Dec 13, 2011, at 11:09 AM, John Doe wrote: Michael Pavling wrote in post #1036557: On 13 December 2011 17:31, DK structuralartis...@gmail.com wrote: Windows is not necessarily IIS - it's perfectly possible to deploy on Windows (with Apache, Passenger, etc). Deploying with IIS as per

Re: [Rails] Re: Is Rails on IIS dead?

2011-12-13 Thread Michael Pavling
On 13 December 2011 18:09, John Doe li...@ruby-forum.com wrote: However, I am bound by corporate policy to at least explore the possibility of using the native web server using other options only as a last resort (i.e. where this can be proven not to be possible or practical). Well, that's

[Rails] Re: Re: Is Rails on IIS dead?

2011-12-13 Thread John Doe
Michael Pavling wrote in post #1036562: On 13 December 2011 17:56, John Doe li...@ruby-forum.com wrote: Suffice it to say that I am bound by corporate policy which is now committed to Microsoft technology. Well, then you won't be using Rails, as it's not MS technology, and you would be

[Rails] Re: Is Rails on IIS dead?

2011-12-13 Thread Frederick Cheung
On Dec 13, 5:16 pm, John Doe li...@ruby-forum.com wrote: Internet references are years out of date and links to downloads broken. Is Rails on IIS dead? We need to make a development decision and right now the situation it looks dire for Ruby on Rails... We could do with a straight answer.

[Rails] Action Controller: Exception caught

2011-12-13 Thread Scott Sewares
Hello, I am trying to this project to work but I ran into this issue, the project is from a book called Beginning Ruby on Rails E-Commerce: From Novice to Professional. It references stuff from Rails 1.0. I am still new at using Ruby and Rails. Thanks for any help. NoMethodError in

[Rails] Mechanize 2.0.1 question

2011-12-13 Thread Spec Ex
Hi all, I'm currently working on a screen scraping app using Mechanize and Rails 2.3.4. I have two parts of the app that need to work together. First, there is a user driven iframe - once the user gets to a specific page on the website to be scraped, I want the user to be able to press a button

[Rails] Using ActiveSupport's autoload_at

2011-12-13 Thread Eugene G.
After discovering http://api.rubyonrails.org/classes/ActiveSupport/Autoload.html I thought it'd be nice if we could replace our zillion occurences of: autoload :Something, 'some_path/something' with: autoload_at 'some_path' do autoload :Something end But I keep getting undefined method

Re: [Rails] Action Controller: Exception caught

2011-12-13 Thread Frederick Cheung
Error messages for was removed in rails 3. It was extracted to a plugin, don't remember exactly what the plugin was called but it's in the rails GitHub repo. Rails has changed massively since 1.0 - I really would try and find some more up to date material to work from. Fred. Sent from my

[Rails] Re: how to use javascript to update markers on Google maps

2011-12-13 Thread skrite
Jim. You are correct, when i show typeof(sites) from when sites = %= @mapped_sites = i get object when i do typeof(sites) after getting sites from the url_that_returns_json i get string i suppose that i am not getting returned correctly. if i look at the source of @mapped_sites and from the

[Rails] Development vs Production Performance over a VPN

2011-12-13 Thread danm
A meaty issue for the networking gurus out there. I am using my development and production environments over a VPN that I have set up between two office locations. The issue is that my production application instance runs as fast as I could want, but the development environment is extremely

Re: [Rails] Development vs Production Performance over a VPN

2011-12-13 Thread Craig White
On Dec 13, 2011, at 1:34 PM, danm wrote: A meaty issue for the networking gurus out there. I am using my development and production environments over a VPN that I have set up between two office locations. The issue is that my production application instance runs as fast as I could want,

Re: [Rails] Development vs Production Performance over a VPN

2011-12-13 Thread Scott Ribe
On Dec 13, 2011, at 1:34 PM, danm wrote: Any ideas? Does WebBrick send out a lot more data to the browser than Apache? I'm going to guess the problem is latency--lots of small requests, which doesn't show up at all on the local net. -- Scott Ribe scott_r...@elevated-dev.com

[Rails] Re: jquery questions

2011-12-13 Thread Craig White
1 down - 1 to go... can anyone toss me a bone here? On Dec 13, 2011, at 10:25 AM, Craig White wrote: Rails 3.1.x 2 questions... Perhaps I am doing this too much in the raw of jquery but I can't seem to find any other way to do these things 1 - drag_drop.js has... $.post(

[Rails] Re: Is Rails on IIS dead?

2011-12-13 Thread Luis Lavena
On Dec 13, 2:16 pm, John Doe li...@ruby-forum.com wrote: Internet references are years out of date and links to downloads broken. Is Rails on IIS dead? We need to make a development decision and right now the situation it looks dire for Ruby on Rails... We could do with a straight answer.

[Rails] continuous jquery partial update

2011-12-13 Thread Craig White
Rails 3.1.x - jquery drag_drop.js $(function() { $( [id^=moveable] ).draggable(); $( #droppable2 ).droppable({ drop: function( event, ui ) { $( this ) .addClass( ui-state-highlight ) $.post( groups/add_member/, { add: ui.draggable.text() }, function(data) {

Re: [Rails] Re: jquery questions

2011-12-13 Thread Frederick Cheung
On 13 Dec 2011, at 21:07, Craig White craig.wh...@ttiltd.com wrote: 1 down - 1 to go... can anyone toss me a bone here? On Dec 13, 2011, at 10:25 AM, Craig White wrote: Rails 3.1.x 2 questions... Perhaps I am doing this too much in the raw of jquery but I can't seem to find any other

Re: [Rails] continuous jquery partial update

2011-12-13 Thread Frederick Cheung
On 13 Dec 2011, at 21:29, Craig White craig.wh...@ttiltd.com wrote: Works - well, I still need a way to pass @group instance variable in the 'post' string back to controller but in the meantime, I am stuck in that after the first drag/drop/update I can't do more drag and drop apparently

Re: [Rails] Re: jquery questions

2011-12-13 Thread Leonardo Mateo
On Tue, Dec 13, 2011 at 6:07 PM, Craig White craig.wh...@ttiltd.com wrote: 1 down - 1 to go... can anyone toss me a bone here? On Dec 13, 2011, at 10:25 AM, Craig White wrote: Rails 3.1.x 2 questions... Perhaps I am doing this too much in the raw of jquery but I can't seem to find any

Re: [Rails] Re: how to use javascript to update markers on Google maps

2011-12-13 Thread Frederick Cheung
On 13 Dec 2011, at 19:54, skrite sh...@skrite.net wrote: Jim. You are correct, when i show typeof(sites) from when sites = %= @mapped_sites = i get object when i do typeof(sites) after getting sites from the url_that_returns_json i get string responseText is always going to be text

Re: [Rails] Sub queries problem with Active Record

2011-12-13 Thread Jim Ruther Nill
On Tue, Dec 13, 2011 at 9:00 PM, amvis vgrkrish...@gmail.com wrote: Thanks for the reply.. sorry, that made a mistake when i post here. that query had't an id. i think the problem with rails version..? am using rails2.3.11. This is mysql query *select sum(points) from transactions where

Re: [Rails] Re: Validates presence

2011-12-13 Thread Jim Ruther Nill
On Wed, Dec 14, 2011 at 12:41 AM, JavierQQ jquari...@gmail.com wrote: Well I found the code here: http://stackoverflow.com/questions/1673812/rails-validation-for-users-email-only-want-it-to-validate-when-a-user-signs-up validates :score, :presence = true, :if = Proc.new{ (some code here)

Re: [Rails] Re: Validates presence

2011-12-13 Thread Javier Quarite
On Tue, Dec 13, 2011 at 8:16 PM, Jim Ruther Nill jvn...@gmail.com wrote: while this may work in your case, you should remember the following (a shameless copy and paste from the api) Finally, the options :if, :unless, :on, :allow_blank and :allow_nil can be given to one specific

[Rails] Re: how to use javascript to update markers on Google maps

2011-12-13 Thread skrite
ok, even though the @mapped_sites.to_json works, the output of that does not look like json. It looks like an array example: var sites = [[35.931341,-102.32205,381.75,288.0,AL,AL, 557,#7F7F7F,#FF,287.1,288.3,ALbr0 psi,0], [35.88125039,-102.3088989,525.0,83.4,DC,DC,

[Rails] Migration from MySQL to NoSQL

2011-12-13 Thread Satyaram B V
Hi All, We are working on a rails application using MySQL. It has become inevitable for us to use NoSQL DB for one of our models. Please note that performance is not yet the reason for us to move to NoSQL. I have the following questions: 1. Should we move all the models from MySQL to NoSQL; or

[Rails] Rails Wiki content not appearing

2011-12-13 Thread Mike Kim
Hi everyone, I apologize in advance for the newbie question, but I haven't been able to view any content on the Rails Wiki pages. All I get are the Table of Contents and the Discussions. I am able to view content when I click on View Page Source, but obviously this is not ideal. I'm using

[Rails] How can I get RVM/Passenger/Apache2 to play nicely together

2011-12-13 Thread Vell
Hello all, Can anyone point me to any solid documentation on how to set up a production server using RVM, Passenger, and Apache2? I have been at this for a week with absolutely no luck at all so I thought I would post here to see if anyone has managed to get this to work and written down the