# Rails

**URL:** https://www.ruby-forum.com/c/ruby-on-rails/6.md?page=1227

[Latest](https://www.ruby-forum.com/latest.md) · [Categories](https://www.ruby-forum.com/categories.md) · [Tags](https://www.ruby-forum.com/tags.md)

**Page:** 1228

---

## [How to retry ftp.new?](https://www.ruby-forum.com/t/how-to-retry-ftp-new/146008)

<div class="topic-metadata">

**Author:** [@sumei](https://www.ruby-forum.com/u/sumei)\
**Replies:** 0\
**Last updated:** [August 16, 2008, 1:47am UTC](https://www.ruby-forum.com/t/how-to-retry-ftp-new/146008 "2008-08-16T01:47:23Z")

</div>

Intermitently, we caught the ‘No route to host’ exception thrown by FTP.new with these lines of codes. I wonder if rety would help continue the work. ftp = Net::FTP.new(server) ftp.login(@user, @passwd) ftp.getbinar…

---

## [Tricky metaprogramming](https://www.ruby-forum.com/t/tricky-metaprogramming/145985)

<div class="topic-metadata">

**Author:** [@makire](https://www.ruby-forum.com/u/makire)\
**Replies:** 4\
**Last updated:** [August 16, 2008, 12:29am UTC](https://www.ruby-forum.com/t/tricky-metaprogramming/145985 "2008-08-16T00:29:36Z")

</div>

Hi This is a tricky one I think.I have a Rails plugin that handles collections. For example I want to be able to write the following in a model: class User \< ActiveRecord::Base my\_class\_method :collections =\> \[:page…

---

## [String date comparison](https://www.ruby-forum.com/t/string-date-comparison/145994)

<div class="topic-metadata">

**Author:** [@jared](https://www.ruby-forum.com/u/jared)\
**Replies:** 4\
**Last updated:** [August 15, 2008, 11:21pm UTC](https://www.ruby-forum.com/t/string-date-comparison/145994 "2008-08-15T23:21:44Z")

</div>

I am trying to compare dates that I have to the current day’s date so i can know if something is over due. this is my code: \<% if assignment\[:due\_date\] \< Date.today %\> \<%= flash\[:notice\]=“OVERDUE” %\> the error I kee…

---

## [Showing data from a join table ( HABTM )](https://www.ruby-forum.com/t/showing-data-from-a-join-table-habtm/145992)

<div class="topic-metadata">

**Author:** [@gwendydd](https://www.ruby-forum.com/u/gwendydd)\
**Replies:** 3\
**Last updated:** [August 15, 2008, 10:42pm UTC](https://www.ruby-forum.com/t/showing-data-from-a-join-table-habtm/145992 "2008-08-15T22:42:42Z")

</div>

I have two tables with a simple has\_and\_belongs\_to\_many relationship. class Author \< ActiveRecord::Base has\_and\_belongs\_to\_many :sources end class Source \< ActiveRecord::Base has\_and\_belongs\_to\_many :authors end N…

---

## [Executing an ERB snippet in an array (?)](https://www.ruby-forum.com/t/executing-an-erb-snippet-in-an-array/145991)

<div class="topic-metadata">

**Author:** [@paco.onrails](https://www.ruby-forum.com/u/paco.onrails)\
**Replies:** 0\
**Last updated:** [August 15, 2008, 9:52pm UTC](https://www.ruby-forum.com/t/executing-an-erb-snippet-in-an-array/145991 "2008-08-15T21:52:08Z")

</div>

Hi again, I have a problem attempting to execute a ERB snippet saved in an array. In the controller I have an array like this one: @my\_objects=\[ \[‘Name Object 1’,’\<%=another\_array\_iterator.name%\>’\], \[‘Name Object 1’,…

---

## [Migration for change or remove table column](https://www.ruby-forum.com/t/migration-for-change-or-remove-table-column/145885)

<div class="topic-metadata">

**Author:** [@txapelgorri](https://www.ruby-forum.com/u/txapelgorri)\
**Replies:** 3\
**Last updated:** [August 15, 2008, 9:05pm UTC](https://www.ruby-forum.com/t/migration-for-change-or-remove-table-column/145885 "2008-08-15T21:05:48Z")

</div>

Hi: I made a migration to create a table and all the columns. Going ahead with the development, I realize that I need to change the type of one column from binary to string (to storage photos paths, instead of photos…

---

## [Nested routes don't work for me?](https://www.ruby-forum.com/t/nested-routes-dont-work-for-me/145964)

<div class="topic-metadata">

**Author:** [@josh](https://www.ruby-forum.com/u/josh)\
**Replies:** 5\
**Last updated:** [August 15, 2008, 8:45pm UTC](https://www.ruby-forum.com/t/nested-routes-dont-work-for-me/145964 "2008-08-15T20:45:20Z")

</div>

Hi all I’m quite new to RESTful Rails and tried a bit with a new app, but it seems I don’t comprehend something yet. I have the following two models: class CompactDisc \< ActiveRecord::Base belongs\_to :genre validat…

---

## [Peter Dierx of railstation.eu](https://www.ruby-forum.com/t/peter-dierx-of-railstation-eu/144454)

<div class="topic-metadata">

**Author:** [@pie-r-squared](https://www.ruby-forum.com/u/pie-r-squared)\
**Replies:** 18\
**Last updated:** [August 15, 2008, 8:42pm UTC](https://www.ruby-forum.com/t/peter-dierx-of-railstation-eu/144454 "2008-08-15T20:42:26Z")

</div>

The beginning of this sad tale starts here: http://groups.google.com/group/rubyonrails-talk/browse\_thread/thread/691e3749406d0317/364f12541252216b I wound up with other accommodations for RailsConf this year, so I off…

---

## [Plugins versus Gems](https://www.ruby-forum.com/t/plugins-versus-gems/145902)

<div class="topic-metadata">

**Author:** [@jeff](https://www.ruby-forum.com/u/jeff)\
**Replies:** 4\
**Last updated:** [August 15, 2008, 7:58pm UTC](https://www.ruby-forum.com/t/plugins-versus-gems/145902 "2008-08-15T19:58:22Z")

</div>

Rails 2.1 introduced some nifty ways to manage gems that your Rails application depends upon. However, using gems instead of plugins seems to a growing practice as well. I’m just wondering why this is? Installing a …

---

## [Day of week but stored as number in the DB](https://www.ruby-forum.com/t/day-of-week-but-stored-as-number-in-the-db/145947)

<div class="topic-metadata">

**Author:** [@ratcheer](https://www.ruby-forum.com/u/ratcheer)\
**Replies:** 3\
**Last updated:** [August 15, 2008, 7:06pm UTC](https://www.ruby-forum.com/t/day-of-week-but-stored-as-number-in-the-db/145947 "2008-08-15T19:06:53Z")

</div>

Hi, I have a ‘day’ column in one of my models. This is stored in the DB as an integer value 1…7. I want this field to appear as a string whenever it appears in a view e.g. if the DB has stored 1 I want the view to …

---

## [More trouble connecting Rails to Oracle](https://www.ruby-forum.com/t/more-trouble-connecting-rails-to-oracle/143379)

<div class="topic-metadata">

**Author:** [@christina](https://www.ruby-forum.com/u/christina)\
**Replies:** 1\
**Last updated:** [August 15, 2008, 6:56pm UTC](https://www.ruby-forum.com/t/more-trouble-connecting-rails-to-oracle/143379 "2008-08-15T18:56:51Z")

</div>

Hi, I have an application under development that I have been working on with a PC. I have just checked out the code on a Mac, and I cannot get my server to start. I am using Rails 2.0.2. Below is the error: wirele…

---

## [Custom method routes in a nested has\_one resource?](https://www.ruby-forum.com/t/custom-method-routes-in-a-nested-has-one-resource/145978)

<div class="topic-metadata">

**Author:** [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Replies:** 1\
**Last updated:** [August 15, 2008, 6:52pm UTC](https://www.ruby-forum.com/t/custom-method-routes-in-a-nested-has-one-resource/145978 "2008-08-15T18:52:21Z")

</div>

I’m struggling with the syntax for some routes - can anyone set me straight? a lesson has\_one plan. lesson has a bunch of custom methods (this is all fine) plan needs some custom methods as well - i have these set up…

---

## [Collection\_select](https://www.ruby-forum.com/t/collection-select/145802)

<div class="topic-metadata">

**Author:** [@jturney](https://www.ruby-forum.com/u/jturney)\
**Replies:** 1\
**Last updated:** [August 15, 2008, 6:45pm UTC](https://www.ruby-forum.com/t/collection-select/145802 "2008-08-15T18:45:12Z")

</div>

Hey! Anybody know how to preselect multiple items in a collection\_select? \<%= collection\_select(:category, :id, @categories, :id, :name, options ={:prompt=\>"-Hold Ctrl for many-"}, :multiple=\>“multiple”, :class=\>“tag…

---

## [Is there have any way can build one-to-many relationship without primary key](https://www.ruby-forum.com/t/is-there-have-any-way-can-build-one-to-many-relationship-without-primary-key/145943)

<div class="topic-metadata">

**Author:** [@vince](https://www.ruby-forum.com/u/vince)\
**Replies:** 2\
**Last updated:** [August 15, 2008, 6:38pm UTC](https://www.ruby-forum.com/t/is-there-have-any-way-can-build-one-to-many-relationship-without-primary-key/145943 "2008-08-15T18:38:45Z")

</div>

I have two models,Book and Picture,one book can have many pictures. In database,I contact them by uuid column which is not a primary key,roughly like this: Books Pictures |--------------------------------- |-------…

---

## [What's the preferred way to get your bug (with patch and in one case tests even) looked at by Rails](https://www.ruby-forum.com/t/whats-the-preferred-way-to-get-your-bug-with-patch-and-in-one-case-tests-even-looked-at-by-rails/145933)

<div class="topic-metadata">

**Author:** [@phallstrom](https://www.ruby-forum.com/u/phallstrom)\
**Replies:** 3\
**Last updated:** [August 15, 2008, 6:34pm UTC](https://www.ruby-forum.com/t/whats-the-preferred-way-to-get-your-bug-with-patch-and-in-one-case-tests-even-looked-at-by-rails/145933 "2008-08-15T18:34:39Z")

</div>

Hi all - Used to be bug/patches would get a certain number of +1’s. There was even a site designed to help with it (http://www.patchreview.org/) but it seems out of date… I’ve fixed one ugly bug and made a decent en…

---

## [Max length for params?](https://www.ruby-forum.com/t/max-length-for-params/145894)

<div class="topic-metadata">

**Author:** [@jturney](https://www.ruby-forum.com/u/jturney)\
**Replies:** 3\
**Last updated:** [August 15, 2008, 5:57pm UTC](https://www.ruby-forum.com/t/max-length-for-params/145894 "2008-08-15T17:57:37Z")

</div>

\<%= link\_to “Edit”, :controller=\>“new”, :action=\>“index”, :edit=\>true, :req\_id=\>"#{@posts.first.requirement\_id}", :title=\>"#{@posts.first.title}", :tags=\>"#{@posts.first.tags}", :description=\>"#{@posts.first.descripti…

---

## [I don't understand the way Rails know the good table for my model class](https://www.ruby-forum.com/t/i-dont-understand-the-way-rails-know-the-good-table-for-my-model-class/145969)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 7\
**Last updated:** [August 15, 2008, 5:50pm UTC](https://www.ruby-forum.com/t/i-dont-understand-the-way-rails-know-the-good-table-for-my-model-class/145969 "2008-08-15T17:50:04Z")

</div>

Hi, I have the following migration file : class Personne \< ActiveRecord::Migration def self.up create\_table( :personnes ) { |p| p.string :prenom p.string :nom p.string :telephone p.text :adresse } end def sel…

---

## [Populate fckeditor using form\_for and fields\_for with 2 models and namespace](https://www.ruby-forum.com/t/populate-fckeditor-using-form-for-and-fields-for-with-2-models-and-namespace/145961)

<div class="topic-metadata">

**Author:** [@mikej](https://www.ruby-forum.com/u/mikej)\
**Replies:** 1\
**Last updated:** [August 15, 2008, 5:42pm UTC](https://www.ruby-forum.com/t/populate-fckeditor-using-form-for-and-fields-for-with-2-models-and-namespace/145961 "2008-08-15T17:42:27Z")

</div>

I am using the form below. text\_html in the form defaults to the value of @text\_html.text.html defined in the action. The textarea does not. How do I populate the text area with @text\_html.text.html? Note I am usin…

---

## [Problem using rails 2.1.0 and gettext](https://www.ruby-forum.com/t/problem-using-rails-2-1-0-and-gettext/145971)

<div class="topic-metadata">

**Author:** [@nelson](https://www.ruby-forum.com/u/nelson)\
**Replies:** 0\
**Last updated:** [August 15, 2008, 5:41pm UTC](https://www.ruby-forum.com/t/problem-using-rails-2-1-0-and-gettext/145971 "2008-08-15T17:41:17Z")

</div>

Hi all, i’m traing to localize in italian my rails app using gettext. All goes ok until i implement validations. Using for example validates\_presence\_of to validate an associations, on errors the application blow up …

---

## [Querying a large data set](https://www.ruby-forum.com/t/querying-a-large-data-set/145962)

<div class="topic-metadata">

**Author:** [@macfizz](https://www.ruby-forum.com/u/macfizz)\
**Replies:** 2\
**Last updated:** [August 15, 2008, 4:51pm UTC](https://www.ruby-forum.com/t/querying-a-large-data-set/145962 "2008-08-15T16:51:29Z")

</div>

Hi all, I hope someone might have some sage words about the right approach here. I have a database application that works OK locally but is reporting an error on my host provider. The error comes up when I try to bri…

---

## [Firefox3 identification](https://www.ruby-forum.com/t/firefox3-identification/144932)

<div class="topic-metadata">

**Author:** [@vamsi](https://www.ruby-forum.com/u/vamsi)\
**Replies:** 5\
**Last updated:** [August 15, 2008, 4:40pm UTC](https://www.ruby-forum.com/t/firefox3-identification/144932 "2008-08-15T16:40:54Z")

</div>

Hi all, case request.user\_agent when /(MSIE|Opera)/ ‘ie’ when /(Firefox|GranParadiso)/ ‘firefox’ else ‘safari’ end this code works fine for me and due to alignment problems i created another css file firefox3. …

---

## [Newbie, needs help, can someone explain](https://www.ruby-forum.com/t/newbie-needs-help-can-someone-explain/145963)

<div class="topic-metadata">

**Author:** [@brads](https://www.ruby-forum.com/u/brads)\
**Replies:** 7\
**Last updated:** [August 15, 2008, 4:24pm UTC](https://www.ruby-forum.com/t/newbie-needs-help-can-someone-explain/145963 "2008-08-15T16:24:28Z")

</div>

Sometimes when i am trying to use an instance variable in my view, which is created in my controller, the value for the :id when passing as part of the URL, just appears as an obscure number 23743276 is there a standa…

---

## [. (DOT) appended to image\_tag? Double-U TF!](https://www.ruby-forum.com/t/dot-appended-to-image-tag-double-u-tf/145892)

<div class="topic-metadata">

**Author:** [@stefan](https://www.ruby-forum.com/u/stefan)\
**Replies:** 12\
**Last updated:** [August 15, 2008, 3:11pm UTC](https://www.ruby-forum.com/t/dot-appended-to-image-tag-double-u-tf/145892 "2008-08-15T15:11:05Z")

</div>

Hey guys, some funny stuff is going on. image\_tag ‘items/1.png’ # =\> \<-- Note the . (DOT) ! image\_tag ‘items/1.jpg’ # =\> \<-- no Dot Does anyone have an idea whats going on here? Uuuuhhmm… Help please :slight\_smi…

---

## [Worth a read - more ignorant RonR Head Bashing!](https://www.ruby-forum.com/t/worth-a-read-more-ignorant-ronr-head-bashing/145860)

<div class="topic-metadata">

**Author:** [@Davo](https://www.ruby-forum.com/u/Davo)\
**Replies:** 4\
**Last updated:** [August 15, 2008, 2:51pm UTC](https://www.ruby-forum.com/t/worth-a-read-more-ignorant-ronr-head-bashing/145860 "2008-08-15T14:51:48Z")

</div>

Dave

---

## [Problem with Ajax Live Search and Update](https://www.ruby-forum.com/t/problem-with-ajax-live-search-and-update/145953)

<div class="topic-metadata">

**Author:** [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Replies:** 0\
**Last updated:** [August 15, 2008, 2:20pm UTC](https://www.ruby-forum.com/t/problem-with-ajax-live-search-and-update/145953 "2008-08-15T14:20:15Z")

</div>

http://www.jumbabox.com/2008/06/ajax-search-in-rails/ Should the above example at the url work? I’ve copied this exactly. I see in the log that it makes the search. But I don’t get any results. The :update div just ge…

---

## [Legacy join table with extra attributes and Rails 2.0 (please ignore previous post with this subjec](https://www.ruby-forum.com/t/legacy-join-table-with-extra-attributes-and-rails-2-0-please-ignore-previous-post-with-this-subjec/145940)

<div class="topic-metadata">

**Author:** [@RoRdeveloper](https://www.ruby-forum.com/u/RoRdeveloper)\
**Replies:** 1\
**Last updated:** [August 15, 2008, 1:41pm UTC](https://www.ruby-forum.com/t/legacy-join-table-with-extra-attributes-and-rails-2-0-please-ignore-previous-post-with-this-subjec/145940 "2008-08-15T13:41:55Z")

</div>

I am a fresh RoR developer and I am facing difficulty in getting a legacy join table (with extra attributes) to work with Rails 2.0. I wanted to apologize for the repeat post ( i accidentally pressed the wrong keys pr…

---

## [How to check if number is in x..y?](https://www.ruby-forum.com/t/how-to-check-if-number-is-in-x-y/145951)

<div class="topic-metadata">

**Author:** [@josh](https://www.ruby-forum.com/u/josh)\
**Replies:** 3\
**Last updated:** [August 15, 2008, 1:39pm UTC](https://www.ruby-forum.com/t/how-to-check-if-number-is-in-x-y/145951 "2008-08-15T13:39:34Z")

</div>

Hi all I’m still quite new to Ruby, and I wonder what’s the easiest way to check if a number is in the range x…y? E.g. Is 10 in the range 5…123? Thanks for help, Josh

---

## [Comparing Datetime to datetime in mysql](https://www.ruby-forum.com/t/comparing-datetime-to-datetime-in-mysql/145903)

<div class="topic-metadata">

**Author:** [@morgan](https://www.ruby-forum.com/u/morgan)\
**Replies:** 1\
**Last updated:** [August 15, 2008, 1:37pm UTC](https://www.ruby-forum.com/t/comparing-datetime-to-datetime-in-mysql/145903 "2008-08-15T13:37:48Z")

</div>

i have a field in an mysql database that has a mysql date and time. i would like to be able to get a date range and a time range is possible… say i just want to get the records that are january 14th from 4:00 to 18:0…

---

## [Attachement\_fu does not upload images](https://www.ruby-forum.com/t/attachement-fu-does-not-upload-images/145952)

<div class="topic-metadata">

**Author:** [@shuaib85](https://www.ruby-forum.com/u/shuaib85)\
**Replies:** 0\
**Last updated:** [August 15, 2008, 1:02pm UTC](https://www.ruby-forum.com/t/attachement-fu-does-not-upload-images/145952 "2008-08-15T13:02:00Z")

</div>

dear all I followed http://clarkware.com/cgi/blosxom/2007/02/24 i installed ImageScience and FreeImage. whenever I create an entry it does not get to the database and it does not upload the file I am not sure what i…

---

## [Adding error with array of checkbox](https://www.ruby-forum.com/t/adding-error-with-array-of-checkbox/145948)

<div class="topic-metadata">

**Author:** [@khim](https://www.ruby-forum.com/u/khim)\
**Replies:** 1\
**Last updated:** [August 15, 2008, 12:29pm UTC](https://www.ruby-forum.com/t/adding-error-with-array-of-checkbox/145948 "2008-08-15T12:29:10Z")

</div>

def group\_permission @role\_combo = Role.find(:all, :select =\> ‘id, role\_name’).collect { |r| \[r.role\_name, r.id\] } @roles = Role.find(:all, :select =\> ‘id, role\_name’) @pages = Page.find(:all) #@page\_roles = PagesRo…

[Previous page](https://www.ruby-forum.com/c/ruby-on-rails/6.md?page=1226)

[Next page](https://www.ruby-forum.com/c/ruby-on-rails/6.md?page=1228)
