[Rails] rake test:integration appears to load routes twice

2009-06-28 Thread tonypm
Whilst trying to find out why I was having problems running Webrat, I put a puts into the routes file to see when it was loaded, and noticed it gets loaded twice. Is there any problem with this. It only happens with rake, not if running the test directly. for a large routes folder, it would

[Rails] Re: Starting Mongrels = no such file to load -- initializer (load error)

2009-06-28 Thread Xiaoming Wang
Hi JMcG : I also get this error , then i upgrade rails to 2.3.2 , it works. -- 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

[Rails] Complicated polymorphic relation

2009-06-28 Thread Adrien Coquio
Hi, I need to do a polymorphic association but i want to save the field XXX_type in an other table, like that : Table: USERS - id - name Table: CITY - id - name Table: STATES - id - name Table: MANDATES - id - name - place_type = city or states Table: ELECTED - id - user_id - mandate_id -

[Rails] Question about a date range selector

2009-06-28 Thread Älphä Blüë
All of my stat tables house data that is compiled weekly. I know how to add a date range selector to the table but I'm not sure how I can restrict the selector to show specific weeks only unless I use a symbolic type of selector. For instance: Suppose there are 13 weeks in a season. Data is

[Rails] Re: Question about a date range selector

2009-06-28 Thread Älphä Blüë
I was playing around with distinct and tried the following: %= collection_select(:rushing_offense, :compiled_on, RushingOffense.find(:all, :select = 'DISTINCT compiled_on'), :id, :compiled_on, {:prompt = true}) % With my current week's data for instance there are 120 timestamps. Using the

[Rails] CheckBox and Ruby on Rails

2009-06-28 Thread David
I have two questions: 1. I have a checkbox on a form and after submit I need to check the status of the checkbox. Any idea how to see what the checkbox is set to? I am assuming this must be done in the controller or model but cannot figure it out. 2. On load I am checking for a cookie and

[Rails] Re: Complicated polymorphic relation

2009-06-28 Thread Marnen Laibow-Koser
Adrien Nom wrote: Hi, I need to do a polymorphic association but i want to save the field XXX_type in an other table, like that : [...] Table: ELECTED - id - user_id - mandate_id - place_id - id of CITY.id or STATES.id depending on MANDATES.place_type related by mandate_id How can

[Rails] Re: Complicated polymorphic relation

2009-06-28 Thread Adrien Coquio
I want to do that way because i must save the possible mandates in one table. Then i use an other table to save the relation between mandates and users. How can i do that with an other way ? thanks for your answer adrien On Jun 28, 4:22 pm, Marnen Laibow-Koser rails-mailing-l...@andreas- s.net

[Rails] which design pattern will work best with AR

2009-06-28 Thread Grayson Piercee
Hello, I'm writing a Rails application that will track people's interests. I'd like to keep detailed information about each type of interest so I can't just put everything in the interest table (the table would be just too wide) User has_many :interests Interest belongs_to :user

[Rails] Re: Complicated polymorphic relation

2009-06-28 Thread Marnen Laibow-Koser
Adrien Nom wrote: I want to do that way because i must save the possible mandates in one table. That's not a good rationale. The place_id is part of the mandate just as much as the olace_type is, so it belongs in the mandates table. Then i use an other table to save the relation between

[Rails] Re: which design pattern will work best with AR

2009-06-28 Thread Marnen Laibow-Koser
Grayson Piercee wrote: Hello, I'm writing a Rails application that will track people's interests. I'd like to keep detailed information about each type of interest so I can't just put everything in the interest table (the table would be just too wide) There is absolutely nothing wrong

[Rails] Re: CheckBox and Ruby on Rails

2009-06-28 Thread Marnen Laibow-Koser
David wrote: I have two questions: 1. I have a checkbox on a form and after submit I need to check the status of the checkbox. Any idea how to see what the checkbox is set to? I am assuming this must be done in the controller or model but cannot figure it out. The value of the checkbox

[Rails] Re: which design pattern will work best with AR

2009-06-28 Thread Colin Law
2009/6/28 Marnen Laibow-Koser rails-mailing-l...@andreas-s.net: Grayson Piercee wrote: Hello, I'm writing a Rails application that will track people's interests.  I'd like to keep detailed information about each type of interest so I can't just put everything in the interest table (the

[Rails] validation error messages in Form - how to disable the ActionView::Base.field_error_proc ?

2009-06-28 Thread Erwin
I wrote the following code in my form view : lilabel for=emailEmail/label %= form.text_field :email, :size = 30 % span id='email_error' class=\'warning-text warning-text-indent\'%= @user.errors.on(:email) %/span/li the generated html code is the following : span class=field-with-errorsinput

[Rails] Re: validation error messages in Form - how to disable the ActionView::Base.field_error_proc ?

2009-06-28 Thread Frederick Cheung
On Jun 28, 11:55 am, Erwin yves_duf...@mac.com wrote: is there any way to disable the ActionView::Base.field_error_proc  in the config file ? You could set ActionView::Base.field_error_proc to a proc that is just a no-op. Fred --~--~-~--~~~---~--~~ You

[Rails] Re: Complicated polymorphic relation

2009-06-28 Thread Adrien Coquio
this solution doesn't fit with my project i have to explain : the table MANDATES contain the list of possible mandates like : (0,mayor,city) (1,deputy mayor,city) (2,minister,state) (3,king,state) this list use by me to make a form where the user of my program can select the mandate related by

[Rails] Re: First application: Alternatives to creating a database?

2009-06-28 Thread Eric Vernon
Many thanks, that did it for me! Cheers. On Jun 27, 7:19 am, Simon Macneall macne...@gmail.com wrote: Hi, I assume you have set up your database.yml file correctly, then just   create the db manually using using the webpanel, and then run rake   db:migrate to create all your tables.

[Rails] Re: flog problem when run rake metrics:all

2009-06-28 Thread Matt Jones
In the flog gem directory, in bin/flog, change the offending line to just 'flog' rather than 'flog_files'. Looks like the problem was induced by a commit back at the beginning of June; no idea why it's been broken for this long. --Matt Jones On Jun 27, 11:57 am, huang zhimin flyer...@gmail.com

[Rails] Re: validation error messages in Form - how to disable the ActionView::Base.field_error_proc ?

2009-06-28 Thread erwin
Thanks Fred I'll try additional Q: when multiple errors on the same field, writing : span id='email_error' class=\'warning-text warning-text-indent\'%= @user.errors.on(:email) %/span produce a concatenated string like : is too short (minimum is 6 characters)should look like an email

[Rails] Invalid source reflection macro?

2009-06-28 Thread John Woods
I'm trying to model a somewhat complicated genetic relationship in Rails. class Gene ActiveRecord::Base belongs_to :species, :foreign_key = species_id, :class_name = Species has_many :genes_orthogroups, :class_name = 'GenesOrthogroups' # join table model has_many :orthogroups, :through =

[Rails] Imagebundle port

2009-06-28 Thread nextpulse
Hi - not sure if this is the place to post this. I need someone to port the Ruby rails imagebundle plugin to use imagescience: http://github.com/bartt/image_bundle/tree/master Currently it uses Rmagick. Its should be fairly easy(?) - since only about 3 lines of code actually uses rmagick. PM

[Rails] Re: User has many topics or subtopics

2009-06-28 Thread AD
yes sorry, a topic can belong to many users. For subtopics we had went the subtopics_users approach, but now that a new requirement came in to support a user having either a topic with no subtopic as well as a subtopic directly (impying topic). Thanks On Sat, Jun 27, 2009 at 3:29 PM, Colin

[Rails] Re: Missing C-based MySQL library for Mac OS X?

2009-06-28 Thread Morgan Morgan
Peter De Berdt wrote: On 10 Feb 2008, at 20:24, Frederick Lee wrote: Building native extensions. This could take a while... ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError) ERROR: Failed to build gem native extension. If you have an Intel Mac, just run the

[Rails] Re: User has many topics or subtopics

2009-06-28 Thread Phlip
AD wrote: yes sorry, a topic can belong to many users. For subtopics we had went the subtopics_users approach, but now that a new requirement came in to support a user having either a topic with no subtopic as well as a subtopic directly (impying topic). If I were to jump in late, and only

[Rails] Re: Problem with rake gems:install

2009-06-28 Thread Ari Maniatis
On Jun 29, 4:03 am, Matt Jones al2o...@gmail.com wrote: You shouldn't be seeing this problem with 2.3.2 - I just tried it in a fresh Rails app using the 2.3.2 gem. Something weird's going on in your version, as the install task sets $gems_rake_task which *should* prevent the display of the

[Rails] About rubygems

2009-06-28 Thread HeChian
Hi all. My host install ruby in /usr/local/ but install rubygems in /home/user/ ruby/. so, when I startup my rails project it always return error to me said that it couldn't find any rubygems lib. anybody knows how to solve it? thanks! --~--~-~--~~~---~--~~

[Rails] Looking for Ideas on Scheduling + Day by Day View of Week

2009-06-28 Thread sir ziggles
Hi All, Fishing for ideas here and would love to hear what you have to say. I have a Course model that, as you may have guessed, manages my Courses. A course has: - A start time (with minutes in 15 minute intervals aka 8:15am, 8:30am, etc) - An ending time (with minutes in 15 minute intervals

[Rails] Re: About rubygems

2009-06-28 Thread Älphä Blüë
HeChian wrote: Hi all. My host install ruby in /usr/local/ but install rubygems in /home/user/ ruby/. so, when I startup my rails project it always return error to me said that it couldn't find any rubygems lib. anybody knows how to solve it? thanks! Type whereis gem and see if your

[Rails] Re: About rubygems

2009-06-28 Thread HeChian
Thanks for reply but I can't use sudo command :( 在 2009/6/29 下午 12:09 時, Älphä Blüë 寫到: HeChian wrote: Hi all. My host install ruby in /usr/local/ but install rubygems in /home/ user/ ruby/. so, when I startup my rails project it always return error to me said that it couldn't find any

[Rails] receiving email in production

2009-06-28 Thread Richard Schneeman
Question: Is there a way to make rails show the same information about received emails in production environment as in development? Reason: I'm using mailer fetcher daemon to get email into my app, everything works fine in development environment on my local machine, i get my mail, everything

[Rails] Re: Looking for Ideas on Scheduling + Day by Day View of Week

2009-06-28 Thread Richard Schneeman
Looks like this question is more of an html/presentation question, you may get more help on a different forum. If you're looking for an application like google calender, I would recommend javascript, its a hair difficult to debug, but it will render the same in every browser, be quick, and