[Rails] validating input values(integer)

2012-05-04 Thread Soichi Ishida
Rails 3.1.3 I have a table 'Contribution' having a column, 'price' which must be integers. validate :price = true, :numericality = { :only_intger = true } then, in creating a new Contribution DB, I need to check the user input values. Of course, if the values are not valid, it needs to stay

Re: [Rails] validating input values(integer)

2012-05-04 Thread Michael Pavling
On 4 May 2012 08:16, Soichi Ishida li...@ruby-forum.com wrote: But interestingly, if I input, say, 'this' in the input form, it directs to the next page and the '0' (an integer, though) value is inserted in the DB.  I do not have any default value to 'price'. If you pop open a Rails console

[Rails] Re: validating input values(integer)

2012-05-04 Thread Soichi Ishida
Thanks for your reply. If you pop open a Rails console and type: 'this'.to_i What result do you get? 1.9.3-p0 :008 'this'.to_i = 0 1.9.3-p0 :009 It's zero...it does not seem good at all ;) soichi -- Posted via http://www.ruby-forum.com/. -- You received this message because you

Re: [Rails] Re: validating input values(integer)

2012-05-04 Thread Michael Pavling
On 4 May 2012 09:41, Soichi Ishida li...@ruby-forum.com wrote: 1.9.3-p0 :008 'this'.to_i  = 0 1.9.3-p0 :009 It's zero...it does not seem good at all ;) That's a different thread entirely ;-) -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk

[Rails] Re: Scaffoldings should be made in a temporary folder.

2012-05-04 Thread Dimitri Pekarovsky
In such particular case you could use git branch or something like that? //D вторник, 1 мая 2012 г., 22:20:57 UTC+3 пользователь Joe Le Brech написал: When you use rails g scaffold blah blah it will always produce non-final code, so why not have a scaffolds folder with as many dummy code

[Rails] Can I get some advise on my gem ?

2012-05-04 Thread Juhyeong
Hi All I am a newbie to this community. I recently published a gem called event_watcher for one of my project http://github.com/zzurang/event_watcher It is a simple dsl thing that is designed to help monitor certain function calls I wonder if I can get some feedback or advise in general

[Rails] Database schema question

2012-05-04 Thread Nelson Keating
Im setting up a very basic rails app and have a question about the needed migrations associations. Basically, my app is an occasion reminder service that emails users when occasions that they select or input are coming up. Occasions will be selected from a checkbox type list or alternatively

[Rails] Shortcode design?

2012-05-04 Thread Tuckie
What would you recommend for a shortcode find/replace design similar to wordpress on select fields?: http://codex.wordpress.org/Shortcode_API (Or does something like this already exist, and I'm just not using the right search terms?) -- You received this message because you are subscribed to

Re: [Rails] Re: Country State City using AJAX

2012-05-04 Thread akshar jamgaonkar
Hey Guys... All of You... Thanks alot.. i have achieved iti was struglling on it from 2 3 daysand without all of your help i wouldnt have successeded.. RUBY ON RAILS ROCKthanks On Thu, May 3, 2012 at 7:31 PM, Jeremy Walker jez.wal...@gmail.com wrote: On 3 May 2012

[Rails] confusion after rails upgrade

2012-05-04 Thread Michael Baldock
Hi all, I'm a periodic ruby / rails user, every time I come back to it I end up feeling unsure about what's going on, I'm hoping someone can clarify! I have a project that I've used as a 'template' project for a while, it's called users_with_logon and it basically has some authentication set up

[Rails] Re: ActiveRecord::ConnectionNotEstablished

2012-05-04 Thread Fernando Cano
Were you able to solve the issue? I am getting the exact same error and I using the mysql2 gem. I also have the database name in database.yml. -- 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

[Rails] Unable to Install ruby-odbc gem on windows 2008 server bit

2012-05-04 Thread Raghuram Duvvuri
Hi, I am trying to install the ruby-odbc gem on windows 2008 server Enterprise SP2 64 bit version I have installed the devkit for ruby and it is also getting installed. When trying to install this ruby-odbc gem some how make.exe file is getting crashing and I am unable to install it further. I

[Rails] Re: validating input values(integer)

2012-05-04 Thread Matt Jones
On Friday, 4 May 2012 03:16:32 UTC-4, Ruby-Forum.com User wrote: Rails 3.1.3 I have a table 'Contribution' having a column, 'price' which must be integers. validate :price = true, :numericality = { :only_intger = true } I'm not sure what effect this syntax will actually have, but

[Rails] Re: Shortcode design?

2012-05-04 Thread Robert Walker
Tuckie wrote in post #1059560: What would you recommend for a shortcode find/replace design similar to wordpress on select fields?: http://codex.wordpress.org/Shortcode_API (Or does something like this already exist, and I'm just not using the right search terms?) This looks to me like a

[Rails] Profile Controllers

2012-05-04 Thread Temperature Controller
Process and temperature controllers are powerful process control tools, but they offer very simple operation. Process controllers take a signal from a temperature device, such as a thermocouple or RTD, or from a pressure/ flow/ level sensor, and maintain a set point using an output signal. Mifa

Re: [Rails] Database schema question

2012-05-04 Thread Colin Law
On 4 May 2012 05:50, Nelson Keating nelsonkeat...@gmail.com wrote: Im setting up a very basic rails app and have a question about the needed migrations associations. Basically, my app is an occasion reminder service that emails users when occasions that they select or input are coming up.

[Rails] 1line RVM+Rails install script for Ubuntu

2012-05-04 Thread YogiZoli
Hi, we've found 1click install for Win and Mac but not for Ubuntu. We've made a 1 line RVM and Rails install script for Ubuntu earlier. Now we might want to update it but before it we wanted to ask the community. Is it still useful? Or does anyone made it already? We've found RVM package but it

[Rails] Re: Unable to Install ruby-odbc gem on windows 2008 server bit

2012-05-04 Thread Luis Lavena
On Friday, May 4, 2012 8:56:30 AM UTC-3, Ruby-Forum.com User wrote: Hi, Hello, I am trying to install the ruby-odbc gem on windows 2008 server Enterprise SP2 64 bit version I have installed the devkit for ruby and it is also getting installed. When trying to install this ruby-odbc

[Rails] Re: Unable to Install ruby-odbc gem on windows 2008 server bit

2012-05-04 Thread Raghuram Duvvuri
Hi, Thank you for the reply. The same procedure which I am following is working on windows 32 bit version of 2008 server but the problem is coming when we are trying with a 64 bit version. I just wanted to know if 64 bit version is having a problem when we try to install the ruby-odbc gem. Does

[Rails] Re: 1line RVM+Rails install script for Ubuntu

2012-05-04 Thread Dheeraj Kumar
This is what you're looking for. https://github.com/joshfng/railsready For windows, there's http://railsinstaller.org/ Dheeraj Kumar On Friday 4 May 2012 at 6:12 PM, YogiZoli wrote: Hi, we've found 1click install for Win and Mac but not for Ubuntu. We've made a 1 line RVM and Rails

Re: [Rails] Re: ActiveRecord::ConnectionNotEstablished

2012-05-04 Thread Colin Law
On 4 May 2012 12:39, Fernando Cano li...@ruby-forum.com wrote: Were you able to solve the issue? I am getting the exact same error and I using the mysql2 gem. I also have the database name in database.yml. It seems likely the OP realised he was doing something silly and was too embarrassed to

Re: [Rails] Setting an addional attribute on the join model in a has_many through relationship

2012-05-04 Thread Mohamad El-Husseini
On Wednesday, May 2, 2012 2:35:02 AM UTC-4, Colin Law wrote: On 1 May 2012 22:53, Mohamad El-Husseini husseini@gmail.com wrote: It depends what you mean by 'work'. It will assign the type of @role to admin but the problem is that you have not saved it to the database after

[Rails] Re: Unable to Install ruby-odbc gem on windows 2008 server bit

2012-05-04 Thread Luis Lavena
On Friday, May 4, 2012 9:59:56 AM UTC-3, Ruby-Forum.com User wrote: Hi, Thank you for the reply. The same procedure which I am following is working on windows 32 bit version of 2008 server but the problem is coming when we are trying with a 64 bit version. Has the server the WOW64

[Rails] Re: Unable to Install ruby-odbc gem on windows 2008 server bit

2012-05-04 Thread Raghuram Duvvuri
Hi, Yes the system has WOW64 installation. Please find the attached screen shots for the error which I am getting Kindly let me know what are the headers I need to add to make it working. Regards, Raghuram. Attachments: http://www.ruby-forum.com/attachment/7360/error1.jpg

[Rails] Re: Database schema question

2012-05-04 Thread Nelson Keating
Thanks for pointing that out.. so changing the Reminders table/model to Occasions ... how would i proceed from there? On Thursday, May 3, 2012 9:50:34 PM UTC-7, Nelson Keating wrote: Im setting up a very basic rails app and have a question about the needed migrations associations.

[Rails] Re: Could not find a JavaScript runtime -- Bundler Rbenv

2012-05-04 Thread Johann Aman
AFAIK execjs and rubyracer are not JS runtimes themselves, only wrappers (though I may be wrong!). I got this error too, installed NodeJS on my server, and everything worked perfectly, so I made a conclusion, that NodeJS is suitable JS runtime for Rails:))) On May 3, 9:40 pm, Ari King

Re: [Rails] Re: Database schema question

2012-05-04 Thread Colin Law
On 4 May 2012 18:38, Nelson Keating nelsonkeat...@gmail.com wrote: Thanks for pointing that out.. so changing the Reminders table/model to Occasions ... how would i proceed from there? Have you worked through some tutorials to give you some insight into the basics of Rails? railstutorial.org

[Rails] Re: Unable to Install ruby-odbc gem on windows 2008 server bit

2012-05-04 Thread Luis Lavena
On Friday, May 4, 2012 12:09:15 PM UTC-3, Ruby-Forum.com User wrote: Hi, Yes the system has WOW64 installation. Please find the attached screen shots for the error which I am getting Kindly let me know what are the headers I need to add to make it working. Now that we actually know

[Rails] Re: ActiveRecord::ConnectionNotEstablished

2012-05-04 Thread Fernando Cano
Thanks Colin. Your response actually helped solved the problem. I started having the issue after I upgraded to Rails 3.2.3. I tried to create a new database using rake db:create (as you suggested) and it showed me that the problem was a version difference between MySQL and the client used by

[Rails] Re: validating input values(integer)

2012-05-04 Thread Soichi Ishida
validates :price, :numericality = { :only_integer = true } (note the plural 'validates' rather than 'validate' - they do two quite different things!) I must be blind! It should have been validates :price, :presence = true, ... and plural, yes, it reminds me Rails like plural nouns.