# Rails

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

[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:** 1618

---

## [Old file\_column Causing Load Errors?](https://www.ruby-forum.com/t/old-file-column-causing-load-errors/120731)

<div class="topic-metadata">

**Author:** [@hunter\_h](https://www.ruby-forum.com/u/hunter_h)\
**Replies:** 2\
**Last updated:** [November 20, 2007, 10:12pm UTC](https://www.ruby-forum.com/t/old-file-column-causing-load-errors/120731 "2007-11-20T22:12:04Z")

</div>

Hello, I have an older production site that uses the file\_column 0.3.1 plug- in for file attachment management. When I try to run it under a new version of Mongrel, any model that includes file\_column shows this in t…

---

## [Validates\_length\_of for NUMBER data type](https://www.ruby-forum.com/t/validates-length-of-for-number-data-type/120820)

<div class="topic-metadata">

**Author:** [@backz](https://www.ruby-forum.com/u/backz)\
**Replies:** 2\
**Last updated:** [November 20, 2007, 10:06pm UTC](https://www.ruby-forum.com/t/validates-length-of-for-number-data-type/120820 "2007-11-20T22:06:10Z")

</div>

Hi, When column’s data type is NUMBER (oracle) validates\_length\_of doesn’t seem to work. validates\_length\_of :bsa, :maximum=\>3 I get error message even though I didn’t put anything and if I enter something, I get ‘…

---

## [How to rename image file before saving it using file\_column?](https://www.ruby-forum.com/t/how-to-rename-image-file-before-saving-it-using-file-column/120822)

<div class="topic-metadata">

**Author:** [@erikgj](https://www.ruby-forum.com/u/erikgj)\
**Replies:** 3\
**Last updated:** [November 20, 2007, 9:52pm UTC](https://www.ruby-forum.com/t/how-to-rename-image-file-before-saving-it-using-file-column/120822 "2007-11-20T21:52:07Z")

</div>

Hello, I’m playing with the file\_column plugin and I would like to rename the file when uploading it and before saving it to DB. I’ve tried it with before\_create method in my model and also in the controller with the …

---

## [Environment variables unknown in Model with Namespace](https://www.ruby-forum.com/t/environment-variables-unknown-in-model-with-namespace/120557)

<div class="topic-metadata">

**Author:** [@Bas\_van\_Westing](https://www.ruby-forum.com/u/Bas_van_Westing)\
**Replies:** 2\
**Last updated:** [November 20, 2007, 9:42pm UTC](https://www.ruby-forum.com/t/environment-variables-unknown-in-model-with-namespace/120557 "2007-11-20T21:42:42Z")

</div>

Hi, I have a problem with a model which is defined within a namespace. It does not seem to find another namespace that was defined in the environment. #config/initializers.rb module X class Exception \< Exception ……

---

## [:allow\_nil validation vs. blank?](https://www.ruby-forum.com/t/allow-nil-validation-vs-blank/120817)

<div class="topic-metadata">

**Author:** [@mike](https://www.ruby-forum.com/u/mike)\
**Replies:** 1\
**Last updated:** [November 20, 2007, 9:20pm UTC](https://www.ruby-forum.com/t/allow-nil-validation-vs-blank/120817 "2007-11-20T21:20:54Z")

</div>

I think I must be doing something wrong… when a form returns params to the controller, empty fields appear to be returned as blank, not nil. so what’s the point of an :allow\_nil=\>true setting on a validation? it fail…

---

## [Help with controller and view](https://www.ruby-forum.com/t/help-with-controller-and-view/120704)

<div class="topic-metadata">

**Author:** [@martinevans](https://www.ruby-forum.com/u/martinevans)\
**Replies:** 2\
**Last updated:** [November 20, 2007, 8:58pm UTC](https://www.ruby-forum.com/t/help-with-controller-and-view/120704 "2007-11-20T20:58:42Z")

</div>

I have the following models class Recipe \< ActiveRecord::Base has\_many :ingredient\_recipes has\_many :ingredients, :through =\> :ingredient\_recipes end class IngredientRecipe \< ActiveRecord::Base belongs\_to :ingre…

---

## [Image upload example?](https://www.ruby-forum.com/t/image-upload-example/120696)

<div class="topic-metadata">

**Author:** [@chovy](https://www.ruby-forum.com/u/chovy)\
**Replies:** 9\
**Last updated:** [November 20, 2007, 7:57pm UTC](https://www.ruby-forum.com/t/image-upload-example/120696 "2007-11-20T19:57:03Z")

</div>

I need a simple image upload template for uploading a jpeg to the server… – Anthony E. Ph: 408-656-2473 var (bonita, farley) = new Dog; farley.barks(“very loud”); bonita.barks (“at strangers”); http://chovy.dyndn…

---

## [Filtering routes?](https://www.ruby-forum.com/t/filtering-routes/120807)

<div class="topic-metadata">

**Author:** [@benjohnson](https://www.ruby-forum.com/u/benjohnson)\
**Replies:** 0\
**Last updated:** [November 20, 2007, 7:27pm UTC](https://www.ruby-forum.com/t/filtering-routes/120807 "2007-11-20T19:27:18Z")

</div>

I have a route like this: map.tickets\_landing\_page ‘:name-tickets’, :controller =\> “tickets”, :action =\> “landing\_page” I want name to replace all spaces with dashes. So if I do tickets\_landing\_page\_path(:name =\> “Ne…

---

## [Drag and Drop dont work on IE7](https://www.ruby-forum.com/t/drag-and-drop-dont-work-on-ie7/120712)

<div class="topic-metadata">

**Author:** [@vasure](https://www.ruby-forum.com/u/vasure)\
**Replies:** 3\
**Last updated:** [November 20, 2007, 7:23pm UTC](https://www.ruby-forum.com/t/drag-and-drop-dont-work-on-ie7/120712 "2007-11-20T19:23:13Z")

</div>

hi guys i had been trying to achieve drag and drop,it works fine on FIREFOX but on IE7 it doesnt fire action using AJAX call,do we need to change dragdrop.cs for it to work in IE7 Thanks

---

## [Plugin: can't call before\_filter in ApplicationController](https://www.ruby-forum.com/t/plugin-cant-call-before-filter-in-applicationcontroller/120780)

<div class="topic-metadata">

**Author:** [@josh](https://www.ruby-forum.com/u/josh)\
**Replies:** 3\
**Last updated:** [November 20, 2007, 6:54pm UTC](https://www.ruby-forum.com/t/plugin-cant-call-before-filter-in-applicationcontroller/120780 "2007-11-20T18:54:23Z")

</div>

Hi all I want to outsource an extension for ApplicationController, that I had in application.rb so far, into a plugin. I have created this plugin, and in init.rb I load require File.dirname(FILE) + ‘/lib/application\_…

---

## [Lighttpd+dispatch.fcgi \*very\* slow, even before app gets control](https://www.ruby-forum.com/t/lighttpd-dispatch-fcgi-very-slow-even-before-app-gets-control/120801)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [November 20, 2007, 6:25pm UTC](https://www.ruby-forum.com/t/lighttpd-dispatch-fcgi-very-slow-even-before-app-gets-control/120801 "2007-11-20T18:25:35Z")

</div>

Hi, We are running Rails + lighttpd + fastcgi (dispatch.fcgi). At a customer site, we are seeing very slow responses. I have turned on Rails debug logs to see where the bottleneck is. From watching the system, I ca…

---

## [Question about routes and generated methods](https://www.ruby-forum.com/t/question-about-routes-and-generated-methods/120799)

<div class="topic-metadata">

**Author:** [@katsnelson](https://www.ruby-forum.com/u/katsnelson)\
**Replies:** 0\
**Last updated:** [November 20, 2007, 6:21pm UTC](https://www.ruby-forum.com/t/question-about-routes-and-generated-methods/120799 "2007-11-20T18:21:39Z")

</div>

Hi all, I have a trouble with generated methods “\_url" and "\_path”. in the routes.rb I have - map.namespace(:admin) do |admin| admin.resources :categories end and “categories” controller in the “controllers/admin/” …

---

## [Problems with find](https://www.ruby-forum.com/t/problems-with-find/120788)

<div class="topic-metadata">

**Author:** [@rmunoz](https://www.ruby-forum.com/u/rmunoz)\
**Replies:** 2\
**Last updated:** [November 20, 2007, 6:07pm UTC](https://www.ruby-forum.com/t/problems-with-find/120788 "2007-11-20T18:07:17Z")

</div>

Hi guys, I’m with a problem trying to use find\_\* check example code here: http://rafb.net/p/1sZSvM83.html So, the problem is, if I try to do Task.find\_all\_by\_project\_id(u.projects) it doesnt work, but this Task.find…

---

## [Initialization at app's start up](https://www.ruby-forum.com/t/initialization-at-apps-start-up/120794)

<div class="topic-metadata">

**Author:** [@Dmitry\_Beransky](https://www.ruby-forum.com/u/Dmitry_Beransky)\
**Replies:** 0\
**Last updated:** [November 20, 2007, 5:49pm UTC](https://www.ruby-forum.com/t/initialization-at-apps-start-up/120794 "2007-11-20T17:49:43Z")

</div>

Hi, I’d like to kick off a background thread responsible for monitoring the application’s vitals when the application starts. What’s the best approach to implement this with RoR running on a Windows box? Thanks Dmi…

---

## [Images don't display](https://www.ruby-forum.com/t/images-dont-display/120724)

<div class="topic-metadata">

**Author:** [@altrugon](https://www.ruby-forum.com/u/altrugon)\
**Replies:** 2\
**Last updated:** [November 20, 2007, 5:46pm UTC](https://www.ruby-forum.com/t/images-dont-display/120724 "2007-11-20T17:46:23Z")

</div>

Hi everyone, I’m following the book “Agile web development with rails” and I hitted my first problem. I can’t see any image in my list of products. What I’m doing wrong? html code html code generated URL http:…

---

## [A bout Search engine friendly URL](https://www.ruby-forum.com/t/a-bout-search-engine-friendly-url/120749)

<div class="topic-metadata">

**Author:** [@infinit](https://www.ruby-forum.com/u/infinit)\
**Replies:** 5\
**Last updated:** [November 20, 2007, 5:32pm UTC](https://www.ruby-forum.com/t/a-bout-search-engine-friendly-url/120749 "2007-11-20T17:32:09Z")

</div>

Hi All, Can anyone talk about how to generate url like : http://blogs.tech-recipes.com/johnny/2006/08/27/ruby-on-rails-using-full-text-search-with-tagging Is the title string “ruby-on-rails-using-full-text-search-with…

---

## [Link\_to and GET parameters](https://www.ruby-forum.com/t/link-to-and-get-parameters/120702)

<div class="topic-metadata">

**Author:** [@glenn](https://www.ruby-forum.com/u/glenn)\
**Replies:** 3\
**Last updated:** [November 20, 2007, 5:15pm UTC](https://www.ruby-forum.com/t/link-to-and-get-parameters/120702 "2007-11-20T17:15:41Z")

</div>

Hi, I am trying to generate a link to external site with GET parameters ( in new window). I tried following code, but it does not produce any parameters. \<%=link\_to “Open New Page”, “https://www.foo.com/page/”, {:pop…

---

## [Requirement - Ruby on Rails](https://www.ruby-forum.com/t/requirement-ruby-on-rails/120787)

<div class="topic-metadata">

**Author:** [@WinITxplorer](https://www.ruby-forum.com/u/WinITxplorer)\
**Replies:** 0\
**Last updated:** [November 20, 2007, 5:15pm UTC](https://www.ruby-forum.com/t/requirement-ruby-on-rails/120787 "2007-11-20T17:15:41Z")

</div>

Hi All, We are looking for ROR consultant for our direct client. Kindly send me your updated resume if available and interested. Skill: Ruby on Rails Project Duration: 1+year Location: LA, CA Start Date: ASAP. I w…

---

## [Nothing rendered, but dispatch.rb returns the page](https://www.ruby-forum.com/t/nothing-rendered-but-dispatch-rb-returns-the-page/120786)

<div class="topic-metadata">

**Author:** [@ahab](https://www.ruby-forum.com/u/ahab)\
**Replies:** 0\
**Last updated:** [November 20, 2007, 5:10pm UTC](https://www.ruby-forum.com/t/nothing-rendered-but-dispatch-rb-returns-the-page/120786 "2007-11-20T17:10:59Z")

</div>

Browsing to my apps home page times out, and nothing is rendered. However, running the dispatch.rb file via ssh does correctly return the code for the home page. The log file is updated when I hit dispatch, but not wh…

---

## [Validations](https://www.ruby-forum.com/t/validations/120781)

<div class="topic-metadata">

**Author:** [@Sameer\_I](https://www.ruby-forum.com/u/Sameer_I)\
**Replies:** 0\
**Last updated:** [November 20, 2007, 4:16pm UTC](https://www.ruby-forum.com/t/validations/120781 "2007-11-20T16:16:47Z")

</div>

Hi, I have a question related to validations. My user table has a password field. I have some validations related to password field in my model file for this table (user.rb). I have a typical form to change password …

---

## [Multiple categories for a product](https://www.ruby-forum.com/t/multiple-categories-for-a-product/120761)

<div class="topic-metadata">

**Author:** [@chovy](https://www.ruby-forum.com/u/chovy)\
**Replies:** 1\
**Last updated:** [November 20, 2007, 4:12pm UTC](https://www.ruby-forum.com/t/multiple-categories-for-a-product/120761 "2007-11-20T16:12:54Z")

</div>

I’m currently using acts\_as\_tree to handle my categories hierarchy. Animals Birds Dogs Themes Farm City My product model currently just has a “product\_id” column, with an acts\_as\_tree object and belongs\_to :categ…

---

## [{HTML options} in collection\_select that show pre-selected options?](https://www.ruby-forum.com/t/html-options-in-collection-select-that-show-pre-selected-options/120779)

<div class="topic-metadata">

**Author:** [@yachtman](https://www.ruby-forum.com/u/yachtman)\
**Replies:** 0\
**Last updated:** [November 20, 2007, 3:55pm UTC](https://www.ruby-forum.com/t/html-options-in-collection-select-that-show-pre-selected-options/120779 "2007-11-20T15:55:38Z")

</div>

Seeking rails help… On a form that is being edited (data is pre-filled), I am trying to show a collection\_select with already selected options that are drawn from my database. I think that my code is nearly correct, b…

---

## [Model problem](https://www.ruby-forum.com/t/model-problem/120776)

<div class="topic-metadata">

**Author:** [@rodchile](https://www.ruby-forum.com/u/rodchile)\
**Replies:** 0\
**Last updated:** [November 20, 2007, 3:37pm UTC](https://www.ruby-forum.com/t/model-problem/120776 "2007-11-20T15:37:33Z")

</div>

Hi Friends! I’m triying since a few days a go build a model for a group select. I can’t find where is my error … so, if anyone can help I’ll appreciate!!! Here is my code: class Vicaria VicariaOption = Struct.new(:…

---

## [Add a template besides destroy.js.rjs](https://www.ruby-forum.com/t/add-a-template-besides-destroy-js-rjs/120773)

<div class="topic-metadata">

**Author:** [@martijn](https://www.ruby-forum.com/u/martijn)\
**Replies:** 0\
**Last updated:** [November 20, 2007, 3:16pm UTC](https://www.ruby-forum.com/t/add-a-template-besides-destroy-js-rjs/120773 "2007-11-20T15:16:52Z")

</div>

Hi there, I have an rjs template to display status messages, and I want to load this template in my destroy function. It automatically loads destroy.js.rjs, but i want to load shared/ message.js.rjs as well. How can …

---

## [Some architecture questions - need help](https://www.ruby-forum.com/t/some-architecture-questions-need-help/120764)

<div class="topic-metadata">

**Author:** [@garfild](https://www.ruby-forum.com/u/garfild)\
**Replies:** 1\
**Last updated:** [November 20, 2007, 2:13pm UTC](https://www.ruby-forum.com/t/some-architecture-questions-need-help/120764 "2007-11-20T14:13:24Z")

</div>

Hi guys, I am a Java/J2ee programmer and just came across ruby & ruby on rails, played with it a bit and found it great. A new client/server project I need to be responsible of, contains the following: MVC architect…

---

## [Difference between has\_one and belongs\_to](https://www.ruby-forum.com/t/difference-between-has-one-and-belongs-to/120692)

<div class="topic-metadata">

**Author:** [@snantz](https://www.ruby-forum.com/u/snantz)\
**Replies:** 2\
**Last updated:** [November 20, 2007, 1:51pm UTC](https://www.ruby-forum.com/t/difference-between-has-one-and-belongs-to/120692 "2007-11-20T13:51:43Z")

</div>

Is the difference between has\_one and \_belongs\_to that with has\_one you can use the additional parameters such as :dependent and :order? Or is there more to it then that? Thanks, -S

---

## [Belongs\_to into a list](https://www.ruby-forum.com/t/belongs-to-into-a-list/120767)

<div class="topic-metadata">

**Author:** [@gorter9](https://www.ruby-forum.com/u/gorter9)\
**Replies:** 0\
**Last updated:** [November 20, 2007, 1:36pm UTC](https://www.ruby-forum.com/t/belongs-to-into-a-list/120767 "2007-11-20T13:36:12Z")

</div>

I have list of blogs with usernames \<% for @blogs in @blogs.reverse %\> \<% @user = @blogs.user %\> \<%= @user.login %\> but the user.login is a no method error. when i in a view of a specific blog the user.login is ret…

---

## [Indentifier needs to be constant error when calling Struct.n](https://www.ruby-forum.com/t/indentifier-needs-to-be-constant-error-when-calling-struct-n/91099)

<div class="topic-metadata">

**Author:** [@bluetrust](https://www.ruby-forum.com/u/bluetrust)\
**Replies:** 2\
**Last updated:** [November 20, 2007, 1:17pm UTC](https://www.ruby-forum.com/t/indentifier-needs-to-be-constant-error-when-calling-struct-n/91099 "2007-11-20T13:17:20Z")

</div>

In my current rails application, I now have the following issue: script/console Loading development environment. bob = Struct.new(:anysymbol) NameError: identifier anysymbol needs to be constant from (irb):1:in \`n…

---

## [Strange error with script/console](https://www.ruby-forum.com/t/strange-error-with-script-console/196519)

<div class="topic-metadata">

**Author:** [@paul](https://www.ruby-forum.com/u/paul)\
**Replies:** 4\
**Last updated:** [November 20, 2007, 1:14pm UTC](https://www.ruby-forum.com/t/strange-error-with-script-console/196519 "2007-11-20T13:14:13Z")

</div>

Hello, I get this: $ ./script/console Loading development environment. /usr/local/lib/ruby/1.8/irb/completion.rb:10:in \`require’: no such file to load – readline (LoadError) … found a LOT of solutions via google, …

---

## [Remove from cart functionality](https://www.ruby-forum.com/t/remove-from-cart-functionality/120730)

<div class="topic-metadata">

**Author:** [@ruchita](https://www.ruby-forum.com/u/ruchita)\
**Replies:** 5\
**Last updated:** [November 20, 2007, 12:59pm UTC](https://www.ruby-forum.com/t/remove-from-cart-functionality/120730 "2007-11-20T12:59:49Z")

</div>

hi all, I am getting a problem when I am trying to remove an item from the cart using Ajax. I have a view named display\_cart.rhtml, a controller store\_controller.rb and a model cart.rb. I have written a method named …

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

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