# Rails

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

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

---

## [Strange routing error in production logs](https://www.ruby-forum.com/t/strange-routing-error-in-production-logs/129770)

<div class="topic-metadata">

**Author:** [@Wildtangent](https://www.ruby-forum.com/u/Wildtangent)\
**Replies:** 0\
**Last updated:** [February 21, 2008, 12:13pm UTC](https://www.ruby-forum.com/t/strange-routing-error-in-production-logs/129770 "2008-02-21T12:13:34Z")

</div>

I just changed info-level logging to warn level in my production log and it was quite enlightening! I found there were a lot of weirdly formed requests and in particular a lot of requests like this: ActionController::…

---

## [File\_column](https://www.ruby-forum.com/t/file-column/129747)

<div class="topic-metadata">

**Author:** [@koli](https://www.ruby-forum.com/u/koli)\
**Replies:** 1\
**Last updated:** [February 21, 2008, 11:52am UTC](https://www.ruby-forum.com/t/file-column/129747 "2008-02-21T11:52:59Z")

</div>

hi , I’m using file\_column. i want users to submit data even when a image is not uploaded. Right now that happens but when i try to view the post it says something abt split method called something something… pleas…

---

## [Rails 2 without a database?](https://www.ruby-forum.com/t/rails-2-without-a-database/129701)

<div class="topic-metadata">

**Author:** [@atraeyu](https://www.ruby-forum.com/u/atraeyu)\
**Replies:** 1\
**Last updated:** [February 21, 2008, 11:29am UTC](https://www.ruby-forum.com/t/rails-2-without-a-database/129701 "2008-02-21T11:29:07Z")

</div>

I’ve written a RESTful web service using Rails 1.2 and now I’m trying to upgrade to Rails 2.0, but it seems to insist that I have a database configured. Previously I had the following code in config/environment.rb and…

---

## [Print a PDF file](https://www.ruby-forum.com/t/print-a-pdf-file/129764)

<div class="topic-metadata">

**Author:** [@crazybass](https://www.ruby-forum.com/u/crazybass)\
**Replies:** 0\
**Last updated:** [February 21, 2008, 11:09am UTC](https://www.ruby-forum.com/t/print-a-pdf-file/129764 "2008-02-21T11:09:05Z")

</div>

Hello I have a PDF file and I want to print it when I click on a button of my rails application. I also want, if it is possible, to be possible the user choose the printer to be used. How can I do that? thanks rega…

---

## [Multiple :through](https://www.ruby-forum.com/t/multiple-through/129743)

<div class="topic-metadata">

**Author:** [@mokkai](https://www.ruby-forum.com/u/mokkai)\
**Replies:** 1\
**Last updated:** [February 21, 2008, 10:53am UTC](https://www.ruby-forum.com/t/multiple-through/129743 "2008-02-21T10:53:11Z")

</div>

we can connect 3 tables using through how to connect 4 tables using :through=\> ? for example Country -----has\_many— State State -----has\_many— City City -----has\_many—Street here we can connect Country-City using …

---

## [Scotland on Rails Conference - April 3/4/5](https://www.ruby-forum.com/t/scotland-on-rails-conference-april-3-4-5/196599)

<div class="topic-metadata">

**Author:** [@snowbug](https://www.ruby-forum.com/u/snowbug)\
**Replies:** 0\
**Last updated:** [February 21, 2008, 10:51am UTC](https://www.ruby-forum.com/t/scotland-on-rails-conference-april-3-4-5/196599 "2008-02-21T10:51:12Z")

</div>

\*\*\* Registration now open \*\*\* Scotland on Rails is pleased to announce that conference2008 is open for registration. There is a limit to the number of registrations we’re able to accept so we’d advise you to get in q…

---

## [Geokit](https://www.ruby-forum.com/t/geokit/129758)

<div class="topic-metadata">

**Author:** [@dhaval\_parikh33](https://www.ruby-forum.com/u/dhaval_parikh33)\
**Replies:** 0\
**Last updated:** [February 21, 2008, 10:26am UTC](https://www.ruby-forum.com/t/geokit/129758 "2008-02-21T10:26:30Z")

</div>

geokit is one plugin on which i m working and i want that the values of add marker facility in it should go in my db how can i do that? currently i m getting latitude and longitude values in a text box which is provid…

---

## [Parsing yml file](https://www.ruby-forum.com/t/parsing-yml-file/129752)

<div class="topic-metadata">

**Author:** [@casid](https://www.ruby-forum.com/u/casid)\
**Replies:** 0\
**Last updated:** [February 21, 2008, 9:53am UTC](https://www.ruby-forum.com/t/parsing-yml-file/129752 "2008-02-21T09:53:23Z")

</div>

Hello RoR developers I have a .yml file like template: templatename1: template\_of\_roster.xml templatename2: template\_of\_roster1.xml templatename3: template\_of\_roster2.xml templatename3: template\_of\_roster3.xml how…

---

## [Rails Doc - Where can I find a list of exceptions raised by ActiveRecord?](https://www.ruby-forum.com/t/rails-doc-where-can-i-find-a-list-of-exceptions-raised-by-activerecord/129749)

<div class="topic-metadata">

**Author:** [@Erwin](https://www.ruby-forum.com/u/Erwin)\
**Replies:** 0\
**Last updated:** [February 21, 2008, 9:45am UTC](https://www.ruby-forum.com/t/rails-doc-where-can-i-find-a-list-of-exceptions-raised-by-activerecord/129749 "2008-02-21T09:45:26Z")

</div>

I cannot find a complete exception list… I am searching at the right place sure, but even googling it, I cannot find a complete list thanks for your help erwin

---

## [Creation of Bookmark](https://www.ruby-forum.com/t/creation-of-bookmark/129738)

<div class="topic-metadata">

**Author:** [@kirankinuforu](https://www.ruby-forum.com/u/kirankinuforu)\
**Replies:** 2\
**Last updated:** [February 21, 2008, 8:07am UTC](https://www.ruby-forum.com/t/creation-of-bookmark/129738 "2008-02-21T08:07:53Z")

</div>

Dear friends, I want create one button in my app which can be placed on browsers bookmark toolbar and can be used to bookmark websites, when we click on it, it will take title and domain name of that page (website) an…

---

## [Creating incorrect plurals when generating scaffold](https://www.ruby-forum.com/t/creating-incorrect-plurals-when-generating-scaffold/129741)

<div class="topic-metadata">

**Author:** [@ocelotspot](https://www.ruby-forum.com/u/ocelotspot)\
**Replies:** 1\
**Last updated:** [February 21, 2008, 7:44am UTC](https://www.ruby-forum.com/t/creating-incorrect-plurals-when-generating-scaffold/129741 "2008-02-21T07:44:04Z")

</div>

Preface: I’m trying to find my way through the “Build Your Own Ruby on Rails Web Application” book. I’m completely new to programming and am having a hard time figuring out the differences between rails 2.0.2 and what…

---

## [Capistrano and mongrel not deploying latest revision from SVN](https://www.ruby-forum.com/t/capistrano-and-mongrel-not-deploying-latest-revision-from-svn/129740)

<div class="topic-metadata">

**Author:** [@MJAZ](https://www.ruby-forum.com/u/MJAZ)\
**Replies:** 0\
**Last updated:** [February 21, 2008, 6:04am UTC](https://www.ruby-forum.com/t/capistrano-and-mongrel-not-deploying-latest-revision-from-svn/129740 "2008-02-21T06:04:23Z")

</div>

Hello. I recently deployed my new rails application. Everything went fine, except for the fast that my mongrel cluster managed by Capistrano is only serving up the first revision. For instance, i one of my revisions …

---

## [Find for multiple tables & updates](https://www.ruby-forum.com/t/find-for-multiple-tables-updates/129610)

<div class="topic-metadata">

**Author:** [@kenwei](https://www.ruby-forum.com/u/kenwei)\
**Replies:** 3\
**Last updated:** [February 21, 2008, 5:20am UTC](https://www.ruby-forum.com/t/find-for-multiple-tables-updates/129610 "2008-02-21T05:20:42Z")

</div>

Would like to use ActiveRecord find for multiple table lookups with sort order on parent table. Example: Item table belongs to Category and Section tables. Category and Section tables have only 2 attributes: id, text …

---

## [Conditon for button](https://www.ruby-forum.com/t/conditon-for-button/129635)

<div class="topic-metadata">

**Author:** [@casid](https://www.ruby-forum.com/u/casid)\
**Replies:** 5\
**Last updated:** [February 21, 2008, 4:17am UTC](https://www.ruby-forum.com/t/conditon-for-button/129635 "2008-02-21T04:17:25Z")

</div>

hi everyone I have two url\_to action, like this converter: ‘\<%= url\_for :controller =\> ‘/project/report’, :action =\> ‘converter’ %\>’, work\_sheet\_csv: ‘\<%= url\_for :controller =\> ‘/project/report’, :action =\>…

---

## [Undefined method \`require\_gem'](https://www.ruby-forum.com/t/undefined-method-require-gem/125634)

<div class="topic-metadata">

**Author:** [@blinking\_bear](https://www.ruby-forum.com/u/blinking_bear)\
**Replies:** 6\
**Last updated:** [February 21, 2008, 4:13am UTC](https://www.ruby-forum.com/t/undefined-method-require-gem/125634 "2008-02-21T04:13:39Z")

</div>

When I run rake i get ’ undefined method \`require\_gem’’ Here’s my setup: ruby:ruby 1.8.6 (2007-09-24 patchlevel 111) \[i386-freebsd6\] rails: 2.0.2 gem:1.0.1

---

## [Anyone here familiar with white\_list plugin?](https://www.ruby-forum.com/t/anyone-here-familiar-with-white-list-plugin/129729)

<div class="topic-metadata">

**Author:** [@bbqplate](https://www.ruby-forum.com/u/bbqplate)\
**Replies:** 0\
**Last updated:** [February 21, 2008, 3:33am UTC](https://www.ruby-forum.com/t/anyone-here-familiar-with-white-list-plugin/129729 "2008-02-21T03:33:47Z")

</div>

hi, i am not sure if i understand white\_list plugin. i am building an app where users can post messages. i would like to use white\_list to remove html markup and any javascripts. however when i do the WhiteListHelp…

---

## [A lot of records running slow on Dreamhost - any suggestions](https://www.ruby-forum.com/t/a-lot-of-records-running-slow-on-dreamhost-any-suggestions/129674)

<div class="topic-metadata">

**Author:** [@fonziguy](https://www.ruby-forum.com/u/fonziguy)\
**Replies:** 9\
**Last updated:** [February 21, 2008, 3:06am UTC](https://www.ruby-forum.com/t/a-lot-of-records-running-slow-on-dreamhost-any-suggestions/129674 "2008-02-21T03:06:12Z")

</div>

Hi guys, I’m quite new to Ruby on Rails and I am deploying my first app. I have over 50,000 records and each record has a true or false active state. On the homepage I find 50 of the active records and order them ran…

---

## [Validation of image type](https://www.ruby-forum.com/t/validation-of-image-type/129636)

<div class="topic-metadata">

**Author:** [@koli](https://www.ruby-forum.com/u/koli)\
**Replies:** 8\
**Last updated:** [February 21, 2008, 2:03am UTC](https://www.ruby-forum.com/t/validation-of-image-type/129636 "2008-02-21T02:03:06Z")

</div>

Hi, I’m using file\_column to do the image uploads .i want to know how to do the validation to upload only jpg or png or gif images. RIght now the user can upload any type of file.I want to restrict it only image type…

---

## [Sum the Product of Two Fields](https://www.ruby-forum.com/t/sum-the-product-of-two-fields/129505)

<div class="topic-metadata">

**Author:** [@rwkreutzer](https://www.ruby-forum.com/u/rwkreutzer)\
**Replies:** 7\
**Last updated:** [February 21, 2008, 1:58am UTC](https://www.ruby-forum.com/t/sum-the-product-of-two-fields/129505 "2008-02-21T01:58:07Z")

</div>

I have two MySQL tables, Orders and Line\_items. Orders has many line\_items. The line\_item table has a quantity field and an item\_price field. In order.rb, I want to get the total price of the order. I try def tota…

---

## [Array or Hash in collection\_select?](https://www.ruby-forum.com/t/array-or-hash-in-collection-select/129668)

<div class="topic-metadata">

**Author:** [@Cassiano\_R](https://www.ruby-forum.com/u/Cassiano_R)\
**Replies:** 1\
**Last updated:** [February 21, 2008, 1:52am UTC](https://www.ruby-forum.com/t/array-or-hash-in-collection-select/129668 "2008-02-21T01:52:04Z")

</div>

Hi I have an array of string and I want to use it in collection\_select rails function… \[‘cassiano’, ‘roloff’\] to use in… \<%= collection\_select ‘form’, ‘field’, @my\_array? %\> Thanks for help

---

## [Trouble adding new view to rails project](https://www.ruby-forum.com/t/trouble-adding-new-view-to-rails-project/129722)

<div class="topic-metadata">

**Author:** [@loominator1970](https://www.ruby-forum.com/u/loominator1970)\
**Replies:** 2\
**Last updated:** [February 21, 2008, 1:09am UTC](https://www.ruby-forum.com/t/trouble-adding-new-view-to-rails-project/129722 "2008-02-21T01:09:35Z")

</div>

Hey all, I’m rather new to rails, but I do have a Rails 2.0 project up and running. Now I want to add a new view, let’s call it “newpage” and it has a link from my main page called “index.html.erb” \<%= link\_to ‘New …

---

## [Mysql adapter : "as" in the query](https://www.ruby-forum.com/t/mysql-adapter-as-in-the-query/129726)

<div class="topic-metadata">

**Author:** [@stephanwehner](https://www.ruby-forum.com/u/stephanwehner)\
**Replies:** 0\
**Last updated:** [February 21, 2008, 1:07am UTC](https://www.ruby-forum.com/t/mysql-adapter-as-in-the-query/129726 "2008-02-21T01:07:51Z")

</div>

Migrating here from SQL Server to mysql; found something that “worked” under SQL Server (with freetds / odbc) but not mysql. cat db/migrate/005\_create\_noodles.rb class CreateNoodles \< ActiveRecord::Migration def self.…

---

## [Database.yml question](https://www.ruby-forum.com/t/database-yml-question/129714)

<div class="topic-metadata">

**Author:** [@lmetcalfe](https://www.ruby-forum.com/u/lmetcalfe)\
**Replies:** 3\
**Last updated:** [February 21, 2008, 1:04am UTC](https://www.ruby-forum.com/t/database-yml-question/129714 "2008-02-21T01:04:11Z")

</div>

I’m working on my first RoR app and have run into an issue with database.yml. Originally I had two schemas defined in this file. Now I need to add a third schema and RoR is not recognizing that it’s been added. I’v…

---

## [Caching computations on ActiveRecords](https://www.ruby-forum.com/t/caching-computations-on-activerecords/129723)

<div class="topic-metadata">

**Author:** [@kevin\_cline](https://www.ruby-forum.com/u/kevin_cline)\
**Replies:** 0\
**Last updated:** [February 21, 2008, 12:54am UTC](https://www.ruby-forum.com/t/caching-computations-on-activerecords/129723 "2008-02-21T00:54:52Z")

</div>

I have arrived at the following idiom for caching certain expensive computations on ActiveRecord subclasses: def expensive @expensive = hairy\_database\_query\_or\_something end def reload @expensive = nil super end …

---

## [Unicode Support for MS SQL Server](https://www.ruby-forum.com/t/unicode-support-for-ms-sql-server/129721)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [February 21, 2008, 12:32am UTC](https://www.ruby-forum.com/t/unicode-support-for-ms-sql-server/129721 "2008-02-21T00:32:35Z")

</div>

In order to coerce Rails 1.2.x into supporting Unicode values for an attribute in a model, I found I had to do the following: Change the underlying column type from varchar to nvarchar. Prepend any quoted values g…

---

## [Calling model methods even when the param is a not set](https://www.ruby-forum.com/t/calling-model-methods-even-when-the-param-is-a-not-set/129488)

<div class="topic-metadata">

**Author:** [@clemrock](https://www.ruby-forum.com/u/clemrock)\
**Replies:** 3\
**Last updated:** [February 21, 2008, 12:28am UTC](https://www.ruby-forum.com/t/calling-model-methods-even-when-the-param-is-a-not-set/129488 "2008-02-21T00:28:13Z")

</div>

Hello, I’m setting a checkbox values based on the return of a model field method. The way the method is set up - it only gets called when a checkbox value is set. Here’s the model code: def within=(new\_within…

---

## [Acts\_as\_ferret: using an index outside of the application](https://www.ruby-forum.com/t/acts-as-ferret-using-an-index-outside-of-the-application/129717)

<div class="topic-metadata">

**Author:** [@walksalong](https://www.ruby-forum.com/u/walksalong)\
**Replies:** 0\
**Last updated:** [February 20, 2008, 11:17pm UTC](https://www.ruby-forum.com/t/acts-as-ferret-using-an-index-outside-of-the-application/129717 "2008-02-20T23:17:41Z")

</div>

Hello, Does anyone who has worked with acts\_as\_ferret know how to point the search to an index outside of the application? I’ve tried changing the environment.rb: module FerretConfig include Ferret INDEX = Index::I…

---

## [Ssl\_requirement does not redirect to https](https://www.ruby-forum.com/t/ssl-requirement-does-not-redirect-to-https/129619)

<div class="topic-metadata">

**Author:** [@bobbysantiago](https://www.ruby-forum.com/u/bobbysantiago)\
**Replies:** 2\
**Last updated:** [February 20, 2008, 11:17pm UTC](https://www.ruby-forum.com/t/ssl-requirement-does-not-redirect-to-https/129619 "2008-02-20T23:17:41Z")

</div>

I’m trying to get SSL working on my app, using ssl\_requirement. SSL is working, but ssl\_requirement doesn’t seem to be handling the request properly- it doesn’t redirect to https. Relevant files: application.rb: cla…

---

## [Migration Error](https://www.ruby-forum.com/t/migration-error/129689)

<div class="topic-metadata">

**Author:** [@wickie](https://www.ruby-forum.com/u/wickie)\
**Replies:** 3\
**Last updated:** [February 20, 2008, 10:02pm UTC](https://www.ruby-forum.com/t/migration-error/129689 "2008-02-20T22:02:49Z")

</div>

I started following the instructions on RailsRocket to migrate to Rails 2.0. I entered the following commands (as root): gem install rails -y gem update --system The two commands seemed to work correctly, but for all…

---

## [Link\_to\_remote loadind indicator problem](https://www.ruby-forum.com/t/link-to-remote-loadind-indicator-problem/129704)

<div class="topic-metadata">

**Author:** [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Replies:** 0\
**Last updated:** [February 20, 2008, 9:04pm UTC](https://www.ruby-forum.com/t/link-to-remote-loadind-indicator-problem/129704 "2008-02-20T21:04:10Z")

</div>

Hi, This is a bit of a strange one but i basically i have a link\_to\_remote which takes the value from an autocomplete field and puts it in a table by rendering a partial via ajax. I have a before and success to displ…

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

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