# Rails

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

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

---

## [Polymorphic advice for this design](https://www.ruby-forum.com/t/polymorphic-advice-for-this-design/194574)

<div class="topic-metadata">

**Author:** [@zurich\_by\_night](https://www.ruby-forum.com/u/zurich_by_night)\
**Replies:** 26\
**Last updated:** [September 11, 2010, 4:34am UTC](https://www.ruby-forum.com/t/polymorphic-advice-for-this-design/194574 "2010-09-11T04:34:49Z")

</div>

With this ER diagram. should the suggestions table be polymorphic? Or OPTION 2: should i just have two separate tables called business\_suggestion and city\_suggestion? I was thinking polymorphic since the columns first…

---

## [When is it okay to resort to find\_by\_sql?](https://www.ruby-forum.com/t/when-is-it-okay-to-resort-to-find-by-sql/194680)

<div class="topic-metadata">

**Author:** [@fearless\_fool](https://www.ruby-forum.com/u/fearless_fool)\
**Replies:** 5\
**Last updated:** [September 11, 2010, 3:22am UTC](https://www.ruby-forum.com/t/when-is-it-okay-to-resort-to-find-by-sql/194680 "2010-09-11T03:22:41Z")

</div>

When is it appropriate to resort to find\_by\_sql? I’m all for portable, easily maintained code. I’m a HUGE fan the new ActiveRecord::Relation model in Rails 3.0 I keenly feel the peril of dropping into find\_by\_sql(). …

---

## [Rails3 routes.rb DSL deprecation warning](https://www.ruby-forum.com/t/rails3-routes-rb-dsl-deprecation-warning/194661)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 3\
**Last updated:** [September 11, 2010, 1:41am UTC](https://www.ruby-forum.com/t/rails3-routes-rb-dsl-deprecation-warning/194661 "2010-09-11T01:41:45Z")

</div>

During testing with Rails3 I am seeing this warning: DEPRECATION WARNING: You are using the old router DSL which will be removed in Rails 3.1. Please check how to update your routes file at: http://www.engineyard.com/…

---

## [Schedule to run a method?](https://www.ruby-forum.com/t/schedule-to-run-a-method/194793)

<div class="topic-metadata">

**Author:** [@bluegreen](https://www.ruby-forum.com/u/bluegreen)\
**Replies:** 1\
**Last updated:** [September 11, 2010, 12:40am UTC](https://www.ruby-forum.com/t/schedule-to-run-a-method/194793 "2010-09-11T00:40:46Z")

</div>

Hi, everyone. I wrote a ror app. One of the methods in controller extracts data from files and saves it to database. Because there are many new files every night, is it possible to run this method only every night …

---

## [Protect\_from\_forgery](https://www.ruby-forum.com/t/protect-from-forgery/194799)

<div class="topic-metadata">

**Author:** [@dennismajor1](https://www.ruby-forum.com/u/dennismajor1)\
**Replies:** 0\
**Last updated:** [September 10, 2010, 9:24pm UTC](https://www.ruby-forum.com/t/protect-from-forgery/194799 "2010-09-10T21:24:09Z")

</div>

I am a newbie to Rails, coming from a PHP shop, so please excuse my ignorance. I have to applications. A Codeigniter PHP app and a Rails 3.0 app. The rails app makes paypal api calls and the php app makes curl post ca…

---

## [Problem with unexpected nil in assert\_select](https://www.ruby-forum.com/t/problem-with-unexpected-nil-in-assert-select/194738)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 3\
**Last updated:** [September 10, 2010, 8:55pm UTC](https://www.ruby-forum.com/t/problem-with-unexpected-nil-in-assert-select/194738 "2010-09-10T20:55:06Z")

</div>

I am running cucumber features against a Rails 3 branch and I have this step definition (which works fine in Rails-2.3.8): When /should see (?:an|the) authentication request message/ do puts(“This is the response: #{r…

---

## [Is it possible to do date arithmetic in an active record query without using custom sql?](https://www.ruby-forum.com/t/is-it-possible-to-do-date-arithmetic-in-an-active-record-query-without-using-custom-sql/194743)

<div class="topic-metadata">

**Author:** [@voidstar](https://www.ruby-forum.com/u/voidstar)\
**Replies:** 9\
**Last updated:** [September 10, 2010, 7:54pm UTC](https://www.ruby-forum.com/t/is-it-possible-to-do-date-arithmetic-in-an-active-record-query-without-using-custom-sql/194743 "2010-09-10T19:54:32Z")

</div>

Hi, I currently have a large array of model objects (around 5000 this could grow to be in the 100k range) which have a date attribute. I want to filter this objects if one of their date attribute falls into an array…

---

## [Re: Unexpected behavior with respond\_to](https://www.ruby-forum.com/t/re-unexpected-behavior-with-respond-to/194792)

<div class="topic-metadata">

**Author:** [@Erik\_Hetzner](https://www.ruby-forum.com/u/Erik_Hetzner)\
**Replies:** 0\
**Last updated:** [September 10, 2010, 7:21pm UTC](https://www.ruby-forum.com/t/re-unexpected-behavior-with-respond-to/194792 "2010-09-10T19:21:45Z")

</div>

At Mon, 6 Sep 2010 04:05:17 +0300, Svilen Vassilev wrote: Really stuck on this issue. In 2.3.8 the code worked perfectly fine. Hi Svilen, FYI: https://rails.lighthouseapp.com/projects/8994/tickets/5277-rails-300rc…

---

## [Trying to do a report with a list of zip codes and getting stuck](https://www.ruby-forum.com/t/trying-to-do-a-report-with-a-list-of-zip-codes-and-getting-stuck/194766)

<div class="topic-metadata">

**Author:** [@adistarmid](https://www.ruby-forum.com/u/adistarmid)\
**Replies:** 4\
**Last updated:** [September 10, 2010, 5:59pm UTC](https://www.ruby-forum.com/t/trying-to-do-a-report-with-a-list-of-zip-codes-and-getting-stuck/194766 "2010-09-10T17:59:47Z")

</div>

I’m trying to get a list of zip codes in my database with zipstring = sprintf("select distinct zip from visits,households where " + "households.id=visits.household\_id and visits.month=‘%2d’ and visits.year = ‘%4d’ " …

---

## [Install rails 3 fedora 13 issues](https://www.ruby-forum.com/t/install-rails-3-fedora-13-issues/193658)

<div class="topic-metadata">

**Author:** [@ashu](https://www.ruby-forum.com/u/ashu)\
**Replies:** 2\
**Last updated:** [September 10, 2010, 5:47pm UTC](https://www.ruby-forum.com/t/install-rails-3-fedora-13-issues/193658 "2010-09-10T17:47:29Z")

</div>

i am in trouble i am new on fedora want to install rails 3 only how can i please help me if any one did that then please send me the tutorial link issue i am facing is ruby version 1.8.6 is installed here and on using …

---

## [(JOB) Ruby on Rails Programmer](https://www.ruby-forum.com/t/job-ruby-on-rails-programmer/194748)

<div class="topic-metadata">

**Author:** [@rick](https://www.ruby-forum.com/u/rick)\
**Replies:** 2\
**Last updated:** [September 10, 2010, 5:47pm UTC](https://www.ruby-forum.com/t/job-ruby-on-rails-programmer/194748 "2010-09-10T17:47:29Z")

</div>

I am looking for someone to work on a project I have that was developed in Ruby On Rails. Can you give me some guidance on hiring some one I would like for them to be located in the St. Louis Missouri area. Any sugge…

---

## [Anyone writing a Rails backend to elFinder?](https://www.ruby-forum.com/t/anyone-writing-a-rails-backend-to-elfinder/194261)

<div class="topic-metadata">

**Author:** [@phallstrom](https://www.ruby-forum.com/u/phallstrom)\
**Replies:** 1\
**Last updated:** [September 10, 2010, 5:46pm UTC](https://www.ruby-forum.com/t/anyone-writing-a-rails-backend-to-elfinder/194261 "2010-09-10T17:46:54Z")

</div>

Hi all - There’s a new WYSIWYG editor out (http://elrte.org/) that has a file manager component. There are backends for PHP and Python at the moment. Wondering if anyone has begun work on a Rails backend? I don’t wa…

---

## [How to implement a sandbox](https://www.ruby-forum.com/t/how-to-implement-a-sandbox/194772)

<div class="topic-metadata">

**Author:** [@trapper](https://www.ruby-forum.com/u/trapper)\
**Replies:** 9\
**Last updated:** [September 10, 2010, 4:22pm UTC](https://www.ruby-forum.com/t/how-to-implement-a-sandbox/194772 "2010-09-10T16:22:46Z")

</div>

I would like to give my users an opportunity to switch the application into a sandboxmode, where it is possible to play with it without the danger to insert junk into the database. I guess, setting RAILS\_ENV = ‘develo…

---

## [RMagick to\_blob display via AJAX call](https://www.ruby-forum.com/t/rmagick-to-blob-display-via-ajax-call/194702)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 10\
**Last updated:** [September 10, 2010, 3:17pm UTC](https://www.ruby-forum.com/t/rmagick-to-blob-display-via-ajax-call/194702 "2010-09-10T15:17:48Z")

</div>

Hi, HELP! This seems too simple - I MUST be overlooking something… I can create an rmagick image in my controller and display it fine. When I create a second image and try to refresh via observe\_form, it shows garbl…

---

## [Simple\_captcha issue](https://www.ruby-forum.com/t/simple-captcha-issue/194780)

<div class="topic-metadata">

**Author:** [@sam](https://www.ruby-forum.com/u/sam)\
**Replies:** 2\
**Last updated:** [September 10, 2010, 2:03pm UTC](https://www.ruby-forum.com/t/simple-captcha-issue/194780 "2010-09-10T14:03:50Z")

</div>

I have a weird issue .I am using simple captcha in forms in my rails applications. If I am using one captcha in a web page I don’t have any problem. But I have a scenario of using three(3) forms in one page in which …

---

## [Rails update fails](https://www.ruby-forum.com/t/rails-update-fails/194770)

<div class="topic-metadata">

**Author:** [@robin](https://www.ruby-forum.com/u/robin)\
**Replies:** 2\
**Last updated:** [September 10, 2010, 12:51pm UTC](https://www.ruby-forum.com/t/rails-update-fails/194770 "2010-09-10T12:51:58Z")

</div>

I’m doing a manual (initial) installation of ruby 1.8.7, rubygems 1.3.7 and rails. I’m pretty new at this. This is a windows installation. I started by installing ruby-1.8.7, then downloaded rubygems-1.3.7 and ran ru…

---

## [Translating NO (norway)](https://www.ruby-forum.com/t/translating-no-norway/194734)

<div class="topic-metadata">

**Author:** [@joahking](https://www.ruby-forum.com/u/joahking)\
**Replies:** 5\
**Last updated:** [September 10, 2010, 11:38am UTC](https://www.ruby-forum.com/t/translating-no-norway/194734 "2010-09-10T11:38:37Z")

</div>

hi there I have an app that keeps country codes to translate the country names, but Norway does not works, mainly because its country\_code is NO and that is reserved I guess. how can I fix that? thanks in advance g…

---

## [Safe nil in rails views](https://www.ruby-forum.com/t/safe-nil-in-rails-views/194771)

<div class="topic-metadata">

**Author:** [@msan](https://www.ruby-forum.com/u/msan)\
**Replies:** 5\
**Last updated:** [September 10, 2010, 10:47am UTC](https://www.ruby-forum.com/t/safe-nil-in-rails-views/194771 "2010-09-10T10:47:07Z")

</div>

If you know grails, there is a feature like this: \<% user.name? %\> that prevents to chek if the value is null or not. In rails view I have to do \<% if user.name %\> \<%= user.name %\> \<% end %\> to display user.name if…

---

## [Freeze an attribute?](https://www.ruby-forum.com/t/freeze-an-attribute/194683)

<div class="topic-metadata">

**Author:** [@Jeffrey\_LSTaylor](https://www.ruby-forum.com/u/Jeffrey_LSTaylor)\
**Replies:** 5\
**Last updated:** [September 10, 2010, 10:23am UTC](https://www.ruby-forum.com/t/freeze-an-attribute/194683 "2010-09-10T10:23:06Z")

</div>

Is it possible to to freeze a single attribute of an ActiveRecord (Rails 2.3.5). Hopefully in a way that isn’t deprecated in 2.3.8 or 3.0. TIA, Jeffrey

---

## [Text\_field and :onchange](https://www.ruby-forum.com/t/text-field-and-onchange/194756)

<div class="topic-metadata">

**Author:** [@snantz](https://www.ruby-forum.com/u/snantz)\
**Replies:** 2\
**Last updated:** [September 10, 2010, 3:01am UTC](https://www.ruby-forum.com/t/text-field-and-onchange/194756 "2010-09-10T03:01:48Z")

</div>

Hi all, I have this text\_field that needs to be filled out before a form can be submitted. To do this I added an :onchange attribute that basically checks to see if the value of the field is blank, if it is then the …

---

## [Simple Captcha - files still in "/tmp" directory and not displaying](https://www.ruby-forum.com/t/simple-captcha-files-still-in-tmp-directory-and-not-displaying/194755)

<div class="topic-metadata">

**Author:** [@andy](https://www.ruby-forum.com/u/andy)\
**Replies:** 2\
**Last updated:** [September 10, 2010, 1:09am UTC](https://www.ruby-forum.com/t/simple-captcha-files-still-in-tmp-directory-and-not-displaying/194755 "2010-09-10T01:09:57Z")

</div>

I’m trying to use the Rails3 Simple Captcha version from here: It’s working 100% fine on my local environment. In Production, I had to point the “convert” command to the correct directory and then reinstall ImageMagi…

---

## [I18n assets management / translation UI](https://www.ruby-forum.com/t/i18n-assets-management-translation-ui/194534)

<div class="topic-metadata">

**Author:** [@andras](https://www.ruby-forum.com/u/andras)\
**Replies:** 8\
**Last updated:** [September 10, 2010, 12:14am UTC](https://www.ruby-forum.com/t/i18n-assets-management-translation-ui/194534 "2010-09-10T00:14:20Z")

</div>

Hello everyone, i’m building a multi-lingual webapp with i18n from the ground up, and while i myself can deal with an army of yml files, the languages i speak are ( very ) limited, and would eventually like to ask for …

---

## [Multiple Routes](https://www.ruby-forum.com/t/multiple-routes/194712)

<div class="topic-metadata">

**Author:** [@Creative\_Technologi](https://www.ruby-forum.com/u/Creative_Technologi)\
**Replies:** 2\
**Last updated:** [September 9, 2010, 11:40pm UTC](https://www.ruby-forum.com/t/multiple-routes/194712 "2010-09-09T23:40:23Z")

</div>

Hi, Could anyone help with this one. I want to have two routes into my news stories for the show view, one by ID and the other by the URL of the story which is stored in the db. I have two routes setup … map.connect…

---

## [406 Not Acceptable with swfupload](https://www.ruby-forum.com/t/406-not-acceptable-with-swfupload/194744)

<div class="topic-metadata">

**Author:** [@df-sean](https://www.ruby-forum.com/u/df-sean)\
**Replies:** 1\
**Last updated:** [September 9, 2010, 11:29pm UTC](https://www.ruby-forum.com/t/406-not-acceptable-with-swfupload/194744 "2010-09-09T23:29:21Z")

</div>

\---------flash\_session\_cookie\_middleware.rb require ‘rack/utils’ class FlashSessionCookieMiddleware def initialize(app, session\_key = ‘\_session\_id’) @app = app @session\_key = session\_key end def call(env) if env\[…

---

## [NoMethodError in User sessionsController#create](https://www.ruby-forum.com/t/nomethoderror-in-user-sessionscontroller-create/194754)

<div class="topic-metadata">

**Author:** [@learningruby](https://www.ruby-forum.com/u/learningruby)\
**Replies:** 0\
**Last updated:** [September 9, 2010, 11:28pm UTC](https://www.ruby-forum.com/t/nomethoderror-in-user-sessionscontroller-create/194754 "2010-09-09T23:28:23Z")

</div>

Having a frustrating go at authenticating a user, pretty sure it must have something to do with gem version conflicts, but I can’t seem to find a solution that works. No matter what username & password that is entered…

---

## [Integration tests failing with restful\_authentication](https://www.ruby-forum.com/t/integration-tests-failing-with-restful-authentication/194751)

<div class="topic-metadata">

**Author:** [@smithy](https://www.ruby-forum.com/u/smithy)\
**Replies:** 1\
**Last updated:** [September 9, 2010, 11:27pm UTC](https://www.ruby-forum.com/t/integration-tests-failing-with-restful-authentication/194751 "2010-09-09T23:27:25Z")

</div>

I recently upgraded to Rails 2.3.8 from 2.1.0 (not sure if that has anything to do with it though), and my integration tests are no longer able to do anything requiring the user to be logged in. The tests can log in s…

---

## [Hello](https://www.ruby-forum.com/t/hello/194703)

<div class="topic-metadata">

**Author:** [@galharth](https://www.ruby-forum.com/u/galharth)\
**Replies:** 3\
**Last updated:** [September 9, 2010, 11:09pm UTC](https://www.ruby-forum.com/t/hello/194703 "2010-09-09T23:09:55Z")

</div>

I need help, please help me. i dont know how to install ruby on rails… and how i write a code in the text editor and then save it… please send me a link to a very good tutorial with full explanetion and with photos. …

---

## [Rails3 form\_for adding element class...because...?](https://www.ruby-forum.com/t/rails3-form-for-adding-element-class-because/194750)

<div class="topic-metadata">

**Author:** [@wbharding](https://www.ruby-forum.com/u/wbharding)\
**Replies:** 0\
**Last updated:** [September 9, 2010, 10:53pm UTC](https://www.ruby-forum.com/t/rails3-form-for-adding-element-class-because/194750 "2010-09-09T22:53:32Z")

</div>

When I use a form\_for, it’s adding an element class attribute on the form, which is mucking up the design. After some digging, I came upon this thread: http://www.mail-archive.com/removed\_email\_address@domain.invalid/…

---

## [NameError: uninitialized constant Vimeo](https://www.ruby-forum.com/t/nameerror-uninitialized-constant-vimeo/194589)

<div class="topic-metadata">

**Author:** [@rubyisking](https://www.ruby-forum.com/u/rubyisking)\
**Replies:** 2\
**Last updated:** [September 9, 2010, 10:18pm UTC](https://www.ruby-forum.com/t/nameerror-uninitialized-constant-vimeo/194589 "2010-09-09T22:18:57Z")

</div>

Hello, I installed a gem to make a new function in system, the gem is: Vimeo. (GitHub - matthooks/vimeo: A full featured Ruby implementation of the Vimeo API) I’m using bundler to install gem s and make them up to dat…

---

## [Rails3: jquery-rails gem sets 'config.action\_view.javascript\_expansions' but cannot be overriden in](https://www.ruby-forum.com/t/rails3-jquery-rails-gem-sets-config-action-view-javascript-expansions-but-cannot-be-overriden-in/194747)

<div class="topic-metadata">

**Author:** [@Christiaan\_Van\_den\_S](https://www.ruby-forum.com/u/Christiaan_Van_den_S)\
**Replies:** 0\
**Last updated:** [September 9, 2010, 9:17pm UTC](https://www.ruby-forum.com/t/rails3-jquery-rails-gem-sets-config-action-view-javascript-expansions-but-cannot-be-overriden-in/194747 "2010-09-09T21:17:31Z")

</div>

Hello, I’ve created a new Rails3 app and I’m using jQuery instead of prototype. Gemfile: gem ‘jquery-rails’ in my config/application.rb I want do the following: config/application.rb if Rails.env.production? confi…

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

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