[Rails] how to create a form for multiple entries?

2010-04-05 Thread ct9a
hi guys, I have a fairly simple application for a party. An "invite" object has many "guest" objects. When I open up localhost:3000/invites/:id/guests/, I expect to see the details of the "invite" along with all the guest objects associated with the given invite. I would like to have a form

Re: [Rails] how to upload video file??

2010-04-05 Thread shyam mohan
Try this http://jimneath.org/2008/06/03/converting-videos-with-rails-converting-the-video/ -Shyam On Tue, Apr 6, 2010 at 3:46 AM, Rutvij Pandya wrote: > Dear all, > > kindly help me to upload video files... > > Thanking you. > -- > Posted via http://www.ruby-forum.com/. > > -- > You recei

[Rails] Re: hash string to symbol

2010-04-05 Thread Srijith nair
Have you included the lib file in your class like include Hash or require 'hash.rb' If include is present then call the method like object.key_strings_to_symbols! If require is present then call the method like class_name = Student class_name.key_strings_to_symbols! Keep rocking! Chris Habgood

Re: [Rails] hash string to symbol

2010-04-05 Thread Philip Hallstrom
On Apr 5, 2010, at 7:36 PM, Me wrote: I found a method to convert the keys that are string to symbols. I included the file in the lib directory but when I call it it says it does not recognize the method. Ideas? class Hash # Recursively replace key names that should be symbols with symbols.

[Rails] Re: SWM seeking new function in ActionView

2010-04-05 Thread Fearless Fool
Solved my own problem once I remembered that routes.rb is what triggers the definition of the new___path methods. Adding the missing: map.resources :service_addresses, :has_many => :metered_services in routes.rb fixed the problem. I'm learning... - ff -- Posted via http://www.ruby-forum.c

[Rails] hash string to symbol

2010-04-05 Thread Me
I found a method to convert the keys that are string to symbols. I included the file in the lib directory but when I call it it says it does not recognize the method. Ideas? class Hash # Recursively replace key names that should be symbols with symbols. def key_strings_to_symbols! r = Ha

[Rails] SWM seeking new function in ActionView

2010-04-05 Thread Fearless Fool
(Okay, kidding about the SWM part, and I hope the spam filters agree...) I have a three-level nested model, and can't invoke the link_to path for the "inner" nested pair without error. Here are the models (pardon the code tags -- they're still useful): [code] class User < ActiveRecord::Base has

[Rails] Authenticating against ActiveDirectory - can't read userPassword/unicodePwd?

2010-04-05 Thread Marcelo de Moraes Serpa
Hello list, So, the application I am working on right now needs to have LDAP authentication build in, meaning that if the user enabled it, we will query about his basic data (email,pwd) on a user-setup LDAP directory. It used to work fine when I was testing with OpenLDAP. The code, essentially, is

Re: [Rails] Re: SystemTimer failing

2010-04-05 Thread Marcelo de Moraes Serpa
Thanks, Jeff. This could be an alternative. However, we are lucky that the SystemTimer is working fine on Ubuntu. It's just failing on my local dev box (An OSX Snow Leopard one) and I'm intrigued... Marcelo. On Mon, Apr 5, 2010 at 6:18 PM, Jeff Lewis wrote: > Hi Marcelo, > > Not to avoid your s

[Rails] Re: Retrieve redirect URLs from an URL

2010-04-05 Thread Rutvij Pandya
Tom Pett wrote: > Anyone got any advice on this situation? dude, do u require to perform any operation btw each redirect?? Reply -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the G

[Rails] Re: mysql syntax error when trying to capture cumulative sum

2010-04-05 Thread Frederick Cheung
On Apr 6, 12:19 am, John Merlino wrote: > Hey all, > > I've searched the web and cannot find an example of getting a cumulative > count by month for a specific object using Rails, and then displaying > that in an array. This gives a mysql syntax error: > count is expecting a rather simpler situ

[Rails] Re: Retrieve redirect URLs from an URL

2010-04-05 Thread Tom Pett
Anyone got any advice on this situation? -- 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-t...@googlegroups.com. To unsubscribe from this group, se

Re: [Rails] use ActiveSupport::Deprecation myself?

2010-04-05 Thread Jeremy Kemper
On Mon, Apr 5, 2010 at 2:48 PM, Jonathan Rochkind wrote: > So I have a plugin that is shared by many people.  I'd really like a > good way to mark certain methods as 'deprecated', that will be > disappearing in a future version. > > I noticed that ActiveSupport::Deprecation seems to already includ

[Rails] mysql syntax error when trying to capture cumulative sum

2010-04-05 Thread John Merlino
Hey all, I've searched the web and cannot find an example of getting a cumulative count by month for a specific object using Rails, and then displaying that in an array. This gives a mysql syntax error: count = Student.count("SELECT x1.MonthNo , x1.MonthName , x1.Added

[Rails] Re: SystemTimer failing

2010-04-05 Thread Jeff Lewis
Hi Marcelo, Not to avoid your specific SystemTimer and ldap timeout issue, but Have you thought about trying the pure-ruby ldap lib Net::LDAP (http://net-ldap.rubyforge.org/) instead of the c-based Ruby/ LDAP lib you're currently using (http://sourceforge.net/projects/ruby- ldap/)? I've alw

[Rails] Re: SystemTimer failing

2010-04-05 Thread Marcelo de Moraes Serpa
Forgot to include other relevant information: Rails 2.3.5, SystemTimer 1.2, ruby-ldap 0.9.11 all on Mac OSX Snow Leopard. Cheers, Marcelo. On Mon, Apr 5, 2010 at 5:06 PM, Marcelo de Moraes Serpa wrote: > Hello list, > > I have searched everywhere else, tesed extensively and came to a point >

[Rails] Re: please help; form_for passes nil

2010-04-05 Thread Rutvij Pandya
dirtbug wrote: > I have an update button that doesn't update. Watching the server > during the attempt, I see: > > Processing OrvesController#update (for 128.119.60.171 at 2010-04-02 > 13:13:29) [PUT] > Parameters: {"orf"=>nil, "commit"=>"Update", "id"=>"19544"} > > orf is my model I'm trying

[Rails] how to upload video file??

2010-04-05 Thread Rutvij Pandya
Dear all, kindly help me to upload video files... Thanking you. -- 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-t...@googlegroups.com. To un

[Rails] Re: please help; form_for passes nil

2010-04-05 Thread Frederick Cheung
On Apr 5, 9:46 pm, dirtbug wrote: > Thanks for the reply. I've now fixed the html (removed the table), but > it didn't fix the problem. The edit view is: You've still got a form nested inside a form (button_to creates a form) Fred > Editing orf > <% form_for @orf do |f| %> >   <%= f.error_me

[Rails] Using RadRails

2010-04-05 Thread Tig
Hi, I'm new to RoR and have downloaded RadRails to use (on windows) after seeing some good recommendations. However, in setting up a new project I get the error below: C:/ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:271:in `require_frameworks': RubyGem version error: rack(1.0.0 not

[Rails] SystemTimer failing

2010-04-05 Thread Marcelo de Moraes Serpa
Hello list, I have searched everywhere else, tesed extensively and came to a point where I do not have a clue on what is happening. I am using SystemTimer and Ruby/LDAP in my Rails application. Ruby/LDAP to authenticate against a LDAP server and SystemTimer in an effort to avoid potential long ha

[Rails] use ActiveSupport::Deprecation myself?

2010-04-05 Thread Jonathan Rochkind
So I have a plugin that is shared by many people. I'd really like a good way to mark certain methods as 'deprecated', that will be disappearing in a future version. I noticed that ActiveSupport::Deprecation seems to already include such things, and is used internally for marking Rails code as dep

Re: [Rails] Re: please help; form_for passes nil

2010-04-05 Thread Colin Law
On 5 April 2010 21:46, dirtbug wrote: > Thanks for the reply. I've now fixed the html (removed the table), but > it didn't fix the problem. The edit view is: > Editing orf > <% form_for @orf do |f| %> >  <%= f.error_messages %> >  <%= h @orf.locus_tag %> >  <%= f.text_field 'current_annotation', :

[Rails] Re: please help; form_for passes nil

2010-04-05 Thread dirtbug
Thanks for the reply. I've now fixed the html (removed the table), but it didn't fix the problem. The edit view is: Editing orf <% form_for @orf do |f| %> <%= f.error_messages %> <%= h @orf.locus_tag %> <%= f.text_field 'current_annotation', :size => 50 %> <%= f.submit "Update" %> <%= bu

Re: [Rails] Re: 'to_f or not to_f', that is the matter of my question...

2010-04-05 Thread Colin Law
On 5 April 2010 19:48, Grary wrote: > Colin, > > So, there is something I will regret either in terms of i) db > performance or ii) db maintenance by not using default float (int) > defaults where appropriate? > > My view of the tradeoff was: 1) coding defaults to the attributes in a > migration v

[Rails] Re: 'to_f or not to_f', that is the matter of my question...

2010-04-05 Thread Robert Walker
Grary Stimon wrote: > So, there is something I will regret either in terms of i) db > performance or ii) db maintenance by not using default float (int) > defaults where appropriate? > > My view of the tradeoff was: 1) coding defaults to the attributes in a > migration vs. 2) calling to_f (to_i)on

[Rails] Re: activerecord sql server frustrations

2010-04-05 Thread stewbawka
Finally some luck!!! I followed this and finally got my migration to run: http://wiki.rubyonrails.org/database-support/ms-sql#dsn-less_connection On Apr 5, 2:42 pm, MattUebel wrote: > Unfortunately I have no advice to offer, but I can say that I am > mightily interested in this question.  I wil

[Rails] Re: incompatible character encodings: ASCII-8BIT and UTF-8

2010-04-05 Thread Manos
Are you sure you don't have hard coded strings in the partial or strings assigned to variables through controller? Andre Lewis wrote: > > I just tried to migrate one of my applications from ruby 1.8 to ruby 1.9 > > and get following error: > > Showing app/views/layouts/application.html.erb where

[Rails] Re: 'to_f or not to_f', that is the matter of my question...

2010-04-05 Thread Grary
Colin, So, there is something I will regret either in terms of i) db performance or ii) db maintenance by not using default float (int) defaults where appropriate? My view of the tradeoff was: 1) coding defaults to the attributes in a migration vs. 2) calling to_f (to_i)on them in logic. With no

[Rails] Re: activerecord sql server frustrations

2010-04-05 Thread MattUebel
Unfortunately I have no advice to offer, but I can say that I am mightily interested in this question. I will undoubtedly be trying to hook up to a MSSQL DB at some point, and everything I have read so far looks INCREDIBLY painful. :( Good luck. On Apr 5, 1:28 pm, stewbawka wrote: > First off,

Re: [Rails] 'to_f or not to_f', that is the matter of my question...

2010-04-05 Thread Colin Law
On 5 April 2010 17:57, Grary wrote: > What is the best practice for handling ActiveRecord attributes in > logic when those attributes were allowed to be nil? I've been handling > the possibly-nil status of my Numeric attributes in my logic by > calling to_f (to_i) on them, but I wonder if there's

[Rails] activerecord sql server frustrations

2010-04-05 Thread stewbawka
First off, i'm on ubuntu trying to connect to sql server 2008.. I installed the latest version of the activerecord-sqlserver-adapter gem (2.3.4). in my database.yml i first tried connecting with the mode: ADO, but got this message: Please use version 2.3.1 of the adapter for ADO connections. Futu

[Rails] 'to_f or not to_f', that is the matter of my question...

2010-04-05 Thread Grary
What is the best practice for handling ActiveRecord attributes in logic when those attributes were allowed to be nil? I've been handling the possibly-nil status of my Numeric attributes in my logic by calling to_f (to_i) on them, but I wonder if there's a better practice? For example, default value

[Rails] Risk Assessment Application

2010-04-05 Thread MattUebel
I am going to be developing a Risk Assessment system for a secure environment whose database will double as an asset management system. Or at least the Risk Assessment stuff will be an outcropping of the asset management system. Has anyone had any experience with this or a similar project? This i

Re: [Rails] syntax error, unexpected '\n', expecting tASSOC

2010-04-05 Thread Colin Law
On 5 April 2010 14:28, John Merlino wrote: > Hey all, > > I get the following error. Now I know it's related to a curly brace, but > it seems that all curly braces are properly in place. So I'm not sure > why I get this error: > >  SyntaxError in DashboardController#panels > > rails/app/controller

[Rails] Re: syntax error, unexpected '\n', expecting tASSOC

2010-04-05 Thread Frederick Cheung
On Apr 5, 2:28 pm, John Merlino wrote: >           �...@pie_chart = >             Highchart.line({ >               :chart => { >                 :renderTo => 'container', >                 :zoomType => 'x', >                 :margin => [330, 30, 30, 80], >                 :events => { >        

Re: [Rails] Switching from SQLite 3 to MySQL DB gives strange redirects

2010-04-05 Thread Colin Law
On 5 April 2010 10:36, Blaise wrote: > Hi there, > > I have a site that's been running for a few years now and I want to > change the Database to MySQL from SQLite, Is that a good idea? I don't think sqlite is recommended for deployed systems. Colin -- You received this message because you ar

Re: [Rails] syntax error, unexpected '\n', expecting tASSOC

2010-04-05 Thread Philip Hallstrom
And line 170 is??? You could also try removing code until the error goes away. Then put it back and fix it. On Apr 5, 2010, at 6:28 AM, John Merlino wrote: Hey all, I get the following error. Now I know it's related to a curly brace, but it seems that all curly braces are properly in p

Re: [Rails] Switching from SQLite 3 to MySQL DB gives strange redirects

2010-04-05 Thread Philip Hallstrom
On Apr 5, 2010, at 2:36 AM, Blaise wrote: Hi there, I have a site that's been running for a few years now and I want to change the Database to MySQL from SQLite, Using yaml_db I performed the migration fairly seamlessly, and have the site up and running with all my data in MySQL now, however

[Rails] I18n in ruby scripts

2010-04-05 Thread CiriusMex
Hello, I created a ruby script for my RubyOnRails application that send a mail to my application users. This script is executed using a cron job everyday at midnight. Ok so that part works just great. My problem is that I have to use RubyOnRails I18n system to translate a large part of the emails s

[Rails] Re: incompatible character encodings: ASCII-8BIT and UTF-8

2010-04-05 Thread Andre Lewis
> I just tried to migrate one of my applications from ruby 1.8 to ruby 1.9 > and get following error: > Showing app/views/layouts/application.html.erb where line #48 raised: > incompatible character encodings: ASCII-8BIT and UTF-8 Most likely, you are outputting content stored in your DB as U

Re: [Rails] Re: Secuiyrt issue in App

2010-04-05 Thread Hassan Schroeder
On Mon, Apr 5, 2010 at 5:29 AM, Mario Sergio Coelho Marroquim wrote: > Yes, you can escape user data. But you also should not allow the original > request (with the "Hack") to complete. Try to use mod_security in your > apache installation! Is there a non-Apache-httpd equivalent? -- Hassan Schr

[Rails] Re: incompatible character encodings: ASCII-8BIT and UTF-8

2010-04-05 Thread Heinz Strunk
FYI: I execute these commands: db:drop db:create db:setup Still same error. -- 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-t...@googlegroups.com

[Rails] Re: incompatible character encodings: ASCII-8BIT and UTF-8

2010-04-05 Thread Heinz Strunk
I tried it, no it doesn't :( -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to

Re: [Rails] Re: Re: Re: I18n retuns empty string?

2010-04-05 Thread Hassan Schroeder
On Mon, Apr 5, 2010 at 2:58 AM, Heinz Strunk wrote: > By the way I'm using globalize2 for model translation. Could that be the > problem? Presumably it could -- so add it to your new app and see :-) -- Hassan Schroeder hassan.schroe...@gmail.com twitter: @hassan -- Yo

[Rails] Re: incompatible character encodings: ASCII-8BIT and UTF-8

2010-04-05 Thread Heinz Strunk
That means if I do a "db:migrate:reset" (recreate the db with Ruby 1.9) that error would disappear? -- 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 rubyonrai

[Rails] syntax error, unexpected '\n', expecting tASSOC

2010-04-05 Thread John Merlino
Hey all, I get the following error. Now I know it's related to a curly brace, but it seems that all curly braces are properly in place. So I'm not sure why I get this error: SyntaxError in DashboardController#panels rails/app/controllers/dashboard_controller.rb:170: syntax error, unexpected '\n

[Rails] Re: Re: Is it possible to have a form without a submit tag i

2010-04-05 Thread Robert Walker
Colin Law wrote: > So it is not likely that the tutorial the OP is following is assuming > that this will work. As far as I can tell that is precisely what the the tutorial the OP is following is assuming. I also have a copy of that book and the example form is exactly as presented by the OP. Tw

[Rails] Re: Re: deciml

2010-04-05 Thread Tom Mac
Hi Thanks for all your reply Tom -- 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-t...@googlegroups.com. To unsubscribe from this group, send

Re: [Rails] Re: Secuiyrt issue in App

2010-04-05 Thread Mario Sergio Coelho Marroquim
Yes, you can escape user data. But you also should not allow the original request (with the "Hack") to complete. Try to use mod_security in your apache installation! 2010/4/5 Tushar Gandhi > Charanya Nagarajan wrote: > > use > > <%= h @user.information %> > > This will escape angle brackets and

Re: [Rails] Re: deciml

2010-04-05 Thread Colin Law
On 5 April 2010 12:54, Priyanka Pathak wrote: > Hi, >     When you set field to decimal than default it accept 10 digits. so > when you add the value over the limit it set to maximum decimal value. > >     Add two validation in this case: > >     a. validates_length_of - for length of decimal >  

[Rails] Re: incompatible character encodings: ASCII-8BIT and UTF-8

2010-04-05 Thread Manos
If you have have hard coded strings in ruby code you should try Mystring ="bla bla" Mystring.force_encoding('ASCII-8BIT') Before using it. For database strings you should search for mysql to force encoding (this is for db created with ruby 1.8) Good luck Heinz Strunk wrote: > Not yet, had to switch

[Rails] Re: `test': wrong number of arguments (1 for 2) (ArgumentError)

2010-04-05 Thread Frederick Cheung
On Apr 5, 12:40 pm, Ram wrote: > Hi, > > Im trying to change the syntax of my tests to the > > test "some method" do > ... > end > [snip] > > Am I missing something here? Im running Rails 2.1.0 . That feature was only added after rails 2.1 if my memory is correct. Fred -- You received this

[Rails] Re: deciml

2010-04-05 Thread Priyanka Pathak
Hi, When you set field to decimal than default it accept 10 digits. so when you add the value over the limit it set to maximum decimal value. Add two validation in this case: a. validates_length_of - for length of decimal b. validates_numericality_of - for digits only -- Pos

[Rails] `test': wrong number of arguments (1 for 2) (ArgumentError)

2010-04-05 Thread Ram
Hi, Im trying to change the syntax of my tests to the test "some method" do ... end syntax from the existing def test_some_method ... end syntax. Im pasting my test code below. Im getting the error in the subject line if I try to run the test as a ruby script from the console. require File.di

[Rails] Re: Security issue in app

2010-04-05 Thread Tushar Gandhi
Thanks Priyanka It is working. Priyanka Pathak wrote: > Hi, > Use rails HTML escaping method - html_escape(s) or h(s) to fix that > issue. > > Thanks, > Priyanka Pathak -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "

[Rails] Re: Security issue in app

2010-04-05 Thread Priyanka Pathak
Hi, Use rails HTML escaping method - html_escape(s) or h(s) to fix that issue. Thanks, Priyanka Pathak -- 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 r

[Rails] Re: Security issue in app

2010-04-05 Thread DmitryPush
<%=h @text_from_user %> The point is 'h' helper. http://guides.rubyonrails.org/getting_started.html - will be very useful to read. Good luck. On Apr 5, 2:11 pm, Tushar Gandhi wrote: > Hi, > I am facing a following problem:- >  I have app in which user can edit his/her personal information and we

[Rails] Re: Secuiyrt issue in App

2010-04-05 Thread Tushar Gandhi
Charanya Nagarajan wrote: > use > <%= h @user.information %> > This will escape angle brackets and therefore neutralize any embedded > JavaScript > > ushar Gandhi wrote: >> Hi, >> I am facing a following problem:- >> I have app in which user can edit his/her personal information and we >> are sh

[Rails] Re: incompatible character encodings: ASCII-8BIT and UTF-8

2010-04-05 Thread Heinz Strunk
Not yet, had to switch back to Ruby 1.8.6. Maybe someone else has an idea? -- 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-t...@googlegroups.com.

Re: [Rails] Re: Secuiyrt issue in App

2010-04-05 Thread Colin Law
On 5 April 2010 11:29, Charanya Nagarajan wrote: > use > <%= h @user.information %> > This will escape angle brackets and therefore neutralize any embedded > JavaScript _Any_ user entered data that you display should be escaped in this way. You are lucky that no-one with more malicious intention

[Rails] Re: Secuiyrt issue in App

2010-04-05 Thread Charanya Nagarajan
use <%= h @user.information %> This will escape angle brackets and therefore neutralize any embedded JavaScript ushar Gandhi wrote: > Hi, > I am facing a following problem:- > I have app in which user can edit his/her personal information and we > are showing it on browser. Some of users has add

[Rails] Security issue in app

2010-04-05 Thread Tushar Gandhi
Hi, I am facing a following problem:- I have app in which user can edit his/her personal information and we are showing it on browser. Some of users has added "alert('Hack');" javascript in name textbox. Due to this whenever I am showing name on browser it is executing the script and giving javasc

[Rails] Secuiyrt issue in App

2010-04-05 Thread Tushar Gandhi
Hi, I am facing a following problem:- I have app in which user can edit his/her personal information and we are showing it on browser. Some of users has added "alert('Hack');" javascript in name textbox. Due to this whenever I am showing name on browser it is executing the script and giving javasc

[Rails] css sprite best practices

2010-04-05 Thread huang zhimin
Hi all, Last week I wrote a post "css sprite best prachtices". The practices follow the idea "Convention Over Configuration" to do the css sprite automatically (by using my css_sprite gem/plugi

[Rails] Re: Re: Re: I18n retuns empty string?

2010-04-05 Thread Heinz Strunk
By the way I'm using globalize2 for model translation. Could that be the problem? -- 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-t...@googlegrou

[Rails] Re: Re: Re: I18n retuns empty string?

2010-04-05 Thread Heinz Strunk
Well, I created a new application - no plugins or anything and it worked. -- 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-t...@googlegroups.com.

[Rails] Switching from SQLite 3 to MySQL DB gives strange redirects

2010-04-05 Thread Blaise
Hi there, I have a site that's been running for a few years now and I want to change the Database to MySQL from SQLite, Using yaml_db I performed the migration fairly seamlessly, and have the site up and running with all my data in MySQL now, however I have a few problems on a couple of authentic

[Rails] Re: "Plugin not found"

2010-04-05 Thread Alexander S.
Thank you Ahmed Mohamed. I really wish there was more collection of such solution for Windows platform on the Web. Good job. On Mar 31, 6:09 am, Ahmed Mohamed wrote: > just change > stream.reopen(RUBY_PLATFORM =~ /mswin/ ? 'NUL:' : '/dev/null') > into > stream.reopen('NUL:') > > this because whe

[Rails] Re: incompatible character encodings: ASCII-8BIT and UTF-8

2010-04-05 Thread Zoran Szagaski
I'm ran into the same problems after switching to Ruby 1.9.1. Have you found a solution yet? -- 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-t...

Re: [Rails] multiple foreign keys

2010-04-05 Thread Colin Law
On 5 April 2010 09:58, Josh Cheek wrote: > On Mon, Apr 5, 2010 at 3:15 AM, Colin Law wrote: >> >> It would be less effort for us to work out what you are trying to do >> if you gave us the model relationships (belongs_to etc).   Also if you >> show the sql that works it would allow us to see what

[Rails] Re: Help needed on Select Form

2010-04-05 Thread Charanya Nagarajan
Hi, According to my consideration, You will need the databases to be filled.I assumed that You have a table called OS and Device.And Os and device tables are associated to each other like OS belongs to Device That is how from the device's id we can get the list of OS for that device in @os in t

Re: [Rails] deciml

2010-04-05 Thread Colin Law
On 5 April 2010 09:54, Tom Mac wrote: > Hi >   In my table I have > t.decimal :rent, :precision => 12, :scale => 2 > >    But when ever I enter a large value like > 1234567890333.465 > >    To the table it is stored as 99.99 > >         I would like to know how active record validation can

Re: [Rails] multiple foreign keys

2010-04-05 Thread Josh Cheek
On Mon, Apr 5, 2010 at 3:15 AM, Colin Law wrote: > It would be less effort for us to work out what you are trying to do > if you gave us the model relationships (belongs_to etc). Also if you > show the sql that works it would allow us to see what you mean. > > Colin > Basically I want to say

[Rails] deciml

2010-04-05 Thread Tom Mac
Hi In my table I have t.decimal :rent, :precision => 12, :scale => 2 But when ever I enter a large value like 1234567890333.465 To the table it is stored as 99.99 I would like to know how active record validation can be applied here? Thanks Tom -- Posted via http:/

Re: [Rails] multiple foreign keys

2010-04-05 Thread Colin Law
On 5 April 2010 08:31, Josh Cheek wrote: > Hi, I have two players playing a game. > The game has foreign keys into each player: player1_id, player2_id > > From the Player model, I can get the opponent self played if I know which > player self was, but I want to agnostically pull everyone that self

[Rails] Re: paperclip question

2010-04-05 Thread hansraj
You can do it by just writing a rake task which takes in the already uploaded images one by one and then reprocess them and upload them again. This will take care of the small and other styles of the images. Hope this helps. --Hansraj On Apr 5, 10:13 am, "bramu...@gmail.com" wrote: > Hi All,

[Rails] Re: paperclip question

2010-04-05 Thread oivoodoo
May be you can try to check url for you thumbnails for example: # has_att.. :image if photo.image.blank? or photo.image.url(:small).blank? # end On 5 апр, 08:13, "bramu...@gmail.com" wrote: > Hi All, > >   My application is using paperclip and its working fine without any > problems, I am able

[Rails] Re: multiple foreign keys

2010-04-05 Thread Josh Cheek
Also having difficulty getting the has_many to work with this. I thought about a separate join table for it,and even got it working with has_and_belongs_to_many :beat , :class_name => 'Player' , :foreign_key => 'winner_id' , :association_foreign_key => 'loser_id' , :join_table => 'games' , :condi

[Rails] multiple foreign keys

2010-04-05 Thread Josh Cheek
Hi, I have two players playing a game. The game has foreign keys into each player: player1_id, player2_id >From the Player model, I can get the opponent self played if I know which player self was, but I want to agnostically pull everyone that self has played against, regardless of whether self wa