# Rails

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

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

---

## [(Dreaded) STI, belongs\_to](https://www.ruby-forum.com/t/dreaded-sti-belongs-to/193077)

<div class="topic-metadata">

**Author:** [@gaudimila](https://www.ruby-forum.com/u/gaudimila)\
**Replies:** 4\
**Last updated:** [August 11, 2010, 6:25pm UTC](https://www.ruby-forum.com/t/dreaded-sti-belongs-to/193077 "2010-08-11T18:25:39Z")

</div>

Having problems with STI. Names below have been changed to protect the innocent. Imagine a system that allows someone to apply for one of two different types of school scholarships. Each scholarship goes through a …

---

## [Reload is using a cache and i dont want it to be](https://www.ruby-forum.com/t/reload-is-using-a-cache-and-i-dont-want-it-to-be/193083)

<div class="topic-metadata">

**Author:** [@joshs](https://www.ruby-forum.com/u/joshs)\
**Replies:** 4\
**Last updated:** [August 11, 2010, 5:20pm UTC](https://www.ruby-forum.com/t/reload-is-using-a-cache-and-i-dont-want-it-to-be/193083 "2010-08-11T17:20:39Z")

</div>

class PendingOrder \< ActiveRecord::Base def sleep\_until\_processed sleep 0.5 while !processed? reload sleep 0.25 end end end Aug 10 19:43:38 prod-app1 foo\[31608\]: PendingOrder Load (0.6ms) SELECT \* FROM pending\_…

---

## [Redirect loop](https://www.ruby-forum.com/t/redirect-loop/193106)

<div class="topic-metadata">

**Author:** [@mercurius](https://www.ruby-forum.com/u/mercurius)\
**Replies:** 4\
**Last updated:** [August 11, 2010, 4:11pm UTC](https://www.ruby-forum.com/t/redirect-loop/193106 "2010-08-11T16:11:31Z")

</div>

I have one record in a database that is encountering a redirect loop. When I point my browser to “www.sitenamehere.co.uk/case\_studies/1”, it displays a redirect loop error message. When I point my browser to “www.site…

---

## [Names and stuff](https://www.ruby-forum.com/t/names-and-stuff/193107)

<div class="topic-metadata">

**Author:** [@bingobob](https://www.ruby-forum.com/u/bingobob)\
**Replies:** 1\
**Last updated:** [August 11, 2010, 4:00pm UTC](https://www.ruby-forum.com/t/names-and-stuff/193107 "2010-08-11T16:00:25Z")

</div>

I’m trying to stuff like this in my BabyName model… before\_save :capitalize def capitalize self.title = title.capitalize self.forename = forename.capitalize self.surname = surname.capitalize self.mi…

---

## [An implementation level question](https://www.ruby-forum.com/t/an-implementation-level-question/193110)

<div class="topic-metadata">

**Author:** [@tom-mac](https://www.ruby-forum.com/u/tom-mac)\
**Replies:** 1\
**Last updated:** [August 11, 2010, 3:58pm UTC](https://www.ruby-forum.com/t/an-implementation-level-question/193110 "2010-08-11T15:58:48Z")

</div>

Hi I have a message model and message\_participants table. message\_participants table because same message goes to various recipients. Messaging between either company to users OR user to company. So an initial desi…

---

## [Paperclip Trouble - Not Writing to the Database](https://www.ruby-forum.com/t/paperclip-trouble-not-writing-to-the-database/192859)

<div class="topic-metadata">

**Author:** [@marsdragon](https://www.ruby-forum.com/u/marsdragon)\
**Replies:** 12\
**Last updated:** [August 11, 2010, 2:05pm UTC](https://www.ruby-forum.com/t/paperclip-trouble-not-writing-to-the-database/192859 "2010-08-11T14:05:26Z")

</div>

Hello all, I’m a Rails newbie trying to get a basic implementation of Paperclip up but it’s giving me problems. I’m developing on Windows XP (I know…) with WEBrick and MySQL. In my model I have: class User \< ActiveR…

---

## [Keeping file field if error](https://www.ruby-forum.com/t/keeping-file-field-if-error/193111)

<div class="topic-metadata">

**Author:** [@maese](https://www.ruby-forum.com/u/maese)\
**Replies:** 0\
**Last updated:** [August 11, 2010, 1:57pm UTC](https://www.ruby-forum.com/t/keeping-file-field-if-error/193111 "2010-08-11T13:57:28Z")

</div>

hi, i’m doing a plugin for upload files, but after upload i have to validate some fields and if don’t pass de validation come back to the create page keeping the introduced dates, so the user can change the wrongs dat…

---

## [Script/console history](https://www.ruby-forum.com/t/script-console-history/193105)

<div class="topic-metadata">

**Author:** [@Third\_Replicator](https://www.ruby-forum.com/u/Third_Replicator)\
**Replies:** 2\
**Last updated:** [August 11, 2010, 1:03pm UTC](https://www.ruby-forum.com/t/script-console-history/193105 "2010-08-11T13:03:37Z")

</div>

When you quit script/console you lose your command history. What would it take to get get that command history to persist? I wouldn’t mind working on it if somebody had a good suggestion as to how to achieve that an…

---

## [Rails 3.0 and counter\_cache error](https://www.ruby-forum.com/t/rails-3-0-and-counter-cache-error/193104)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [August 11, 2010, 11:26am UTC](https://www.ruby-forum.com/t/rails-3-0-and-counter-cache-error/193104 "2010-08-11T11:26:26Z")

</div>

Hello, I’m working on a rails 3.0 project and today I tried to add a counter cache column, but I keep getting this error: ArgumentError: Unknown key(s): counter\_cache This happens with any combinations of rails 3.0 b…

---

## [How do I optimize this query?](https://www.ruby-forum.com/t/how-do-i-optimize-this-query/193042)

<div class="topic-metadata">

**Author:** [@sprite](https://www.ruby-forum.com/u/sprite)\
**Replies:** 5\
**Last updated:** [August 11, 2010, 10:27am UTC](https://www.ruby-forum.com/t/how-do-i-optimize-this-query/193042 "2010-08-11T10:27:54Z")

</div>

Right now I am wasting a query and also losing the order of Users. Was wondering what t he proper way to do this query is? @top\_tipper\_ids = Tip.find\_by\_sql(“SELECT SUM(tips.amount\_cents) total\_tip, tips.client\_id FRO…

---

## [Error in Rails 3 Release notes](https://www.ruby-forum.com/t/error-in-rails-3-release-notes/193091)

<div class="topic-metadata">

**Author:** [@Dorian](https://www.ruby-forum.com/u/Dorian)\
**Replies:** 1\
**Last updated:** [August 11, 2010, 9:24am UTC](https://www.ruby-forum.com/t/error-in-rails-3-release-notes/193091 "2010-08-11T09:24:06Z")

</div>

Hello, There is : “filter\_parameter\_logging is deprecated in favour of config.filter\_parameters \<\< :password.” but this don’t work : and “config.filter\_parameters \<\< :password” work, so there is an error ? Thanks.

---

## [Help on Route](https://www.ruby-forum.com/t/help-on-route/193098)

<div class="topic-metadata">

**Author:** [@railsfan](https://www.ruby-forum.com/u/railsfan)\
**Replies:** 3\
**Last updated:** [August 11, 2010, 8:08am UTC](https://www.ruby-forum.com/t/help-on-route/193098 "2010-08-11T08:08:28Z")

</div>

hi, I’m new to rails, trying to setup a simple site, in my routes.rb I have map.root :controller =\> ‘site’ , and in my app/controller I have defined site\_controller.rb with action index and about. When I start up the…

---

## [Use of :include option in find query](https://www.ruby-forum.com/t/use-of-include-option-in-find-query/193053)

<div class="topic-metadata">

**Author:** [@miked](https://www.ruby-forum.com/u/miked)\
**Replies:** 3\
**Last updated:** [August 11, 2010, 8:04am UTC](https://www.ruby-forum.com/t/use-of-include-option-in-find-query/193053 "2010-08-11T08:04:30Z")

</div>

Hi, I have a Person model and Company model like as follows:- Person.rb class Person \<ActiveRecord::Base has\_one :company end Company.rb class Company \< ActiveRecord::Base end I have a function def person\_detai…

---

## [OT: Software fulfillment service?](https://www.ruby-forum.com/t/ot-software-fulfillment-service/193094)

<div class="topic-metadata">

**Author:** [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Replies:** 0\
**Last updated:** [August 11, 2010, 5:14am UTC](https://www.ruby-forum.com/t/ot-software-fulfillment-service/193094 "2010-08-11T05:14:45Z")

</div>

Some of us have software we’d like to sell. I looked at www.swreg.org/pricing/2\_9\_percent.htm and then googled the company … many people were not happy. Can anyone recommend a software fulfillment service or RoR code…

---

## [JOBS Ruby on Rails (RoR) technical lead needed in Minneapolis, MN long term contract](https://www.ruby-forum.com/t/jobs-ruby-on-rails-ror-technical-lead-needed-in-minneapolis-mn-long-term-contract/193092)

<div class="topic-metadata">

**Author:** [@abork](https://www.ruby-forum.com/u/abork)\
**Replies:** 0\
**Last updated:** [August 11, 2010, 4:16am UTC](https://www.ruby-forum.com/t/jobs-ruby-on-rails-ror-technical-lead-needed-in-minneapolis-mn-long-term-contract/193092 "2010-08-11T04:16:48Z")

</div>

We are looking for a senior Web App developer who can mentor other senior (JAVA) developers on using RoR for the first time as part of an on-going integration project. Ruby on Rails (RoR) technical lead with extensive…

---

## [\[Jobs\] Sr. Software Engineer-Cloud Infrastructure](https://www.ruby-forum.com/t/jobs-sr-software-engineer-cloud-infrastructure/193090)

<div class="topic-metadata">

**Author:** [@CC\_Pace](https://www.ruby-forum.com/u/CC_Pace)\
**Replies:** 0\
**Last updated:** [August 11, 2010, 4:16am UTC](https://www.ruby-forum.com/t/jobs-sr-software-engineer-cloud-infrastructure/193090 "2010-08-11T04:16:48Z")

</div>

Hello All, CC Pace is an IT Consulting Firm located in Fairfax, Va. We have been in business for 30 years providing different companies with IT solutions/SME in business and systems analysis, software development, pr…

---

## [Habtm gets foreign key from wrong column](https://www.ruby-forum.com/t/habtm-gets-foreign-key-from-wrong-column/193069)

<div class="topic-metadata">

**Author:** [@fritza](https://www.ruby-forum.com/u/fritza)\
**Replies:** 3\
**Last updated:** [August 11, 2010, 12:14am UTC](https://www.ruby-forum.com/t/habtm-gets-foreign-key-from-wrong-column/193069 "2010-08-11T00:14:28Z")

</div>

I have two tables, media and tour\_locations, related through a join table. It’s not a pure join, because I need a sequence number on the relationship, so the join also has an id. When I access “aMedium.tour\_locations”…

---

## [ActiveRecord::UnknownAttributeError: unknown attribute: \<script type](https://www.ruby-forum.com/t/activerecord-unknown-attribute-script-type/193073)

<div class="topic-metadata">

**Author:** [@jemminger](https://www.ruby-forum.com/u/jemminger)\
**Replies:** 3\
**Last updated:** [August 10, 2010, 10:49pm UTC](https://www.ruby-forum.com/t/activerecord-unknown-attribute-script-type/193073 "2010-08-10T22:49:36Z")

</div>

Has anyone seen this happening to their apps? I’m starting to get errors like this come across from one of my apps: ActiveRecord::UnknownAttributeError: unknown attribute: \<script type The parameters being sent are: {…

---

## [Facebooker and Ruby on Rails on Facebook: Sessions problem](https://www.ruby-forum.com/t/facebooker-and-ruby-on-rails-on-facebook-sessions-problem/193084)

<div class="topic-metadata">

**Author:** [@noloman](https://www.ruby-forum.com/u/noloman)\
**Replies:** 0\
**Last updated:** [August 10, 2010, 10:41pm UTC](https://www.ruby-forum.com/t/facebooker-and-ruby-on-rails-on-facebook-sessions-problem/193084 "2010-08-10T22:41:05Z")

</div>

Hello everybody, I am reading the book Facebook Platform Development in order to try to code a small game for Facebook, and I have come across a “little” problem: I am trying to insert a user every time this is logged…

---

## [Paperclip, id partition, and renaming images](https://www.ruby-forum.com/t/paperclip-id-partition-and-renaming-images/197146)

<div class="topic-metadata">

**Author:** [@nuby2ruby](https://www.ruby-forum.com/u/nuby2ruby)\
**Replies:** 3\
**Last updated:** [August 10, 2010, 10:23pm UTC](https://www.ruby-forum.com/t/paperclip-id-partition-and-renaming-images/197146 "2010-08-10T22:23:01Z")

</div>

I’m using paperclip in this Rails 2.3.8 project. What I’m looking to do is rename all the images so they fit the :url =\> “/assets/:class/:id\_partition/:attachment/:style.:extension” from my model. I had about 30,000 r…

---

## [Get integers for all months between two dates](https://www.ruby-forum.com/t/get-integers-for-all-months-between-two-dates/192995)

<div class="topic-metadata">

**Author:** [@tbobker](https://www.ruby-forum.com/u/tbobker)\
**Replies:** 5\
**Last updated:** [August 10, 2010, 9:39pm UTC](https://www.ruby-forum.com/t/get-integers-for-all-months-between-two-dates/192995 "2010-08-10T21:39:56Z")

</div>

I have the following method which should work in Rails, but I am not sure if this is the best implementation. It looks a little clumsy, given all the good helpers in rails. Am I missing a much better way to do this? d…

---

## [Faking an ActiveRecord Model](https://www.ruby-forum.com/t/faking-an-activerecord-model/193068)

<div class="topic-metadata">

**Author:** [@yankees26](https://www.ruby-forum.com/u/yankees26)\
**Replies:** 2\
**Last updated:** [August 10, 2010, 9:17pm UTC](https://www.ruby-forum.com/t/faking-an-activerecord-model/193068 "2010-08-10T21:17:53Z")

</div>

I want to fake an ActiveRecord model like so… instead of having a Plan table in my database, I’d like to just have a variable somewhere (shallow example): Plans = \[{ :id =\> 1, :price =\> 9.99, { :id =\> 2, :price =\> 14…

---

## [Deployment: adding git tag as HTML meta tag](https://www.ruby-forum.com/t/deployment-adding-git-tag-as-html-meta-tag/193055)

<div class="topic-metadata">

**Author:** [@wickie](https://www.ruby-forum.com/u/wickie)\
**Replies:** 15\
**Last updated:** [August 10, 2010, 8:50pm UTC](https://www.ruby-forum.com/t/deployment-adding-git-tag-as-html-meta-tag/193055 "2010-08-10T20:50:09Z")

</div>

I’d like to be able to see from generated pages which version of the app has generated it. As we’re using git and always deploy a specific tag, having that tag in the HTML head as a meta tag would be suitable. My curr…

---

## [Filtering results based on multiple criteria](https://www.ruby-forum.com/t/filtering-results-based-on-multiple-criteria/193076)

<div class="topic-metadata">

**Author:** [@richardsugg](https://www.ruby-forum.com/u/richardsugg)\
**Replies:** 0\
**Last updated:** [August 10, 2010, 8:02pm UTC](https://www.ruby-forum.com/t/filtering-results-based-on-multiple-criteria/193076 "2010-08-10T20:02:43Z")

</div>

What’s the paradigm for providing a set of filters for search results? Here’s my example: I have a list of projects, and projects can be filtered by manager, status (open, closed, in progress), start date, etc. The…

---

## [Error: cross-thread violation on rb\_gc()](https://www.ruby-forum.com/t/error-cross-thread-violation-on-rb-gc/192968)

<div class="topic-metadata">

**Author:** [@Spong](https://www.ruby-forum.com/u/Spong)\
**Replies:** 10\
**Last updated:** [August 10, 2010, 6:19pm UTC](https://www.ruby-forum.com/t/error-cross-thread-violation-on-rb-gc/192968 "2010-08-10T18:19:18Z")

</div>

I don’t like cross-posting, but there doesn’t seem to be much activity/ response to my question on StackOverflow. Link to SO: Question: I’m new to Ruby on Rails. I ran the following in a terminal when I was going t…

---

## [Rails best practice to check an objectâ€™s e xistence before displaying an attribute in a layout](https://www.ruby-forum.com/t/rails-best-practice-to-check-an-objecta-s-e-xistence-before-displaying-an-attribute-in-a-layout/193028)

<div class="topic-metadata">

**Author:** [@wtb](https://www.ruby-forum.com/u/wtb)\
**Replies:** 2\
**Last updated:** [August 10, 2010, 5:09pm UTC](https://www.ruby-forum.com/t/rails-best-practice-to-check-an-objecta-s-e-xistence-before-displaying-an-attribute-in-a-layout/193028 "2010-08-10T17:09:24Z")

</div>

I have the following code in a layout: Posted \<%=time\_ago\_in\_words post.created\_at %\> ago \<% if post.has\_tag != nil %\> in the \<%= post.get\_first\_tag.name %\> category \<% end %\> And the following code in the post mode…

---

## [I18n translators tools](https://www.ruby-forum.com/t/i18n-translators-tools/193058)

<div class="topic-metadata">

**Author:** [@pejuko](https://www.ruby-forum.com/u/pejuko)\
**Replies:** 3\
**Last updated:** [August 10, 2010, 4:27pm UTC](https://www.ruby-forum.com/t/i18n-translators-tools/193058 "2010-08-10T16:27:48Z")

</div>

Hi, there is new tool for handling translation files. You can install it using command gem install i18n-translators-tools This package brings you useful utility and library which can help you to handle locale files…

---

## [I18n translators tools](https://www.ruby-forum.com/t/i18n-translators-tools/193057)

<div class="topic-metadata">

**Author:** [@pejuko](https://www.ruby-forum.com/u/pejuko)\
**Replies:** 1\
**Last updated:** [August 10, 2010, 3:32pm UTC](https://www.ruby-forum.com/t/i18n-translators-tools/193057 "2010-08-10T15:32:44Z")

</div>

Hi, there is new tool for handling translation files. You can install it using command gem install i18n-translators-tools This package brings you useful utility and library which can help you to handle locale files…

---

## [Install\_theme](https://www.ruby-forum.com/t/install-theme/193054)

<div class="topic-metadata">

**Author:** [@swengineer](https://www.ruby-forum.com/u/swengineer)\
**Replies:** 0\
**Last updated:** [August 10, 2010, 3:21pm UTC](https://www.ruby-forum.com/t/install-theme/193054 "2010-08-10T15:21:07Z")

</div>

In following this tutorial in the “install\_theme” plugin: http://drnicwilliams.com/2009/10/06/install-any-html-themetemplate-into-your-rails-app/ When I run the following: (Provided I’m using Rails3.0.0.rc) $ install\_…

---

## [Routing, need fast help](https://www.ruby-forum.com/t/routing-need-fast-help/193048)

<div class="topic-metadata">

**Author:** [@Ainar\_A](https://www.ruby-forum.com/u/Ainar_A)\
**Replies:** 3\
**Last updated:** [August 10, 2010, 3:08pm UTC](https://www.ruby-forum.com/t/routing-need-fast-help/193048 "2010-08-10T15:08:08Z")

</div>

Hi, I try to do with my app something like twitter.com has, when you are NOT logged in it shows twitter.com, when you are logged in it keeps the same domain name in browser, but all page has been changed(it’s full wit…

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

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