# Rails

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

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

---

## [Nested has\_many :through relations fixed in 2.1.0?](https://www.ruby-forum.com/t/nested-has-many-through-relations-fixed-in-2-1-0/147458)

<div class="topic-metadata">

**Author:** [@c\_dekker](https://www.ruby-forum.com/u/c_dekker)\
**Replies:** 1\
**Last updated:** [September 2, 2008, 9:17am UTC](https://www.ruby-forum.com/t/nested-has-many-through-relations-fixed-in-2-1-0/147458 "2008-09-02T09:17:30Z")

</div>

Searching on google yields quite a lot of results describing the following problems: class Person \< ActiveRecord::Base belongs\_to :house end class House \< ActiveRecord::Base has\_many :people belongs\_to :city end …

---

## [SQL - Merging fields from two tables into one, including dup](https://www.ruby-forum.com/t/sql-merging-fields-from-two-tables-into-one-including-dup/147476)

<div class="topic-metadata">

**Author:** [@srinathbtech](https://www.ruby-forum.com/u/srinathbtech)\
**Replies:** 0\
**Last updated:** [September 2, 2008, 9:17am UTC](https://www.ruby-forum.com/t/sql-merging-fields-from-two-tables-into-one-including-dup/147476 "2008-09-02T09:17:15Z")

</div>

Hi, I have two tables, nutritions and food\_options. nutritions has two fields, fooditem\_id, taken and . food\_options has two fields, fooditem\_id and taken. fooditem\_id in nutritions and food\_options will point to id …

---

## [Deploying Rails patches (diff)](https://www.ruby-forum.com/t/deploying-rails-patches-diff/147459)

<div class="topic-metadata">

**Author:** [@c\_dekker](https://www.ruby-forum.com/u/c_dekker)\
**Replies:** 1\
**Last updated:** [September 2, 2008, 9:04am UTC](https://www.ruby-forum.com/t/deploying-rails-patches-diff/147459 "2008-09-02T09:04:02Z")

</div>

I am having a problem with a belongs\_to and a has\_one :through relation which I found is a known bug in Ruby on Rails: http://rails.lighthouseapp.com/projects/8994/tickets/323-has\_many-through-belongs\_to\_association-bu…

---

## [From Router To Controller](https://www.ruby-forum.com/t/from-router-to-controller/147474)

<div class="topic-metadata">

**Author:** [@Gary\_Taylor](https://www.ruby-forum.com/u/Gary_Taylor)\
**Replies:** 0\
**Last updated:** [September 2, 2008, 8:57am UTC](https://www.ruby-forum.com/t/from-router-to-controller/147474 "2008-09-02T08:57:33Z")

</div>

Hi, I have an application which I am currently writing that I am dividing up into re useable plugins. Each plugin needs to know as little as possible about its surroundings. So, for example - I have a forum plugin a…

---

## [Problem using GeoKit plugin from rake task](https://www.ruby-forum.com/t/problem-using-geokit-plugin-from-rake-task/147471)

<div class="topic-metadata">

**Author:** [@cheeseprophet](https://www.ruby-forum.com/u/cheeseprophet)\
**Replies:** 0\
**Last updated:** [September 2, 2008, 8:57am UTC](https://www.ruby-forum.com/t/problem-using-geokit-plugin-from-rake-task/147471 "2008-09-02T08:57:33Z")

</div>

I’m still learning rails and I’ve run into a problem that has me baffled and google hasn’t been able to help. I’m using the GeoKit plugin to handle the geocoding of one of my models. The model has a method called do\_…

---

## [Finding: Want closest match, not exact (complex LIKE)](https://www.ruby-forum.com/t/finding-want-closest-match-not-exact-complex-like/147457)

<div class="topic-metadata">

**Author:** [@c\_dekker](https://www.ruby-forum.com/u/c_dekker)\
**Replies:** 2\
**Last updated:** [September 2, 2008, 8:57am UTC](https://www.ruby-forum.com/t/finding-want-closest-match-not-exact-complex-like/147457 "2008-09-02T08:57:32Z")

</div>

Currently I am working on a game scoring system. This system has team names with scores attached. These scores are going to be entered by copy and pasting a CSV sheet in an input field. I am currently working on the p…

---

## [About ready to ditch rails](https://www.ruby-forum.com/t/about-ready-to-ditch-rails/147464)

<div class="topic-metadata">

**Author:** [@ron](https://www.ruby-forum.com/u/ron)\
**Replies:** 1\
**Last updated:** [September 2, 2008, 5:21am UTC](https://www.ruby-forum.com/t/about-ready-to-ditch-rails/147464 "2008-09-02T05:21:45Z")

</div>

I know all of you are really dedicated to rails. But the fact is I’ve become really exasperated with it lately. Ever since the move to Rails 2.1, I’ve had sooo many problems just getting a functioning Rails stack. I…

---

## [AJax.InPlaceEditor - Controlling initial text selection](https://www.ruby-forum.com/t/ajax-inplaceeditor-controlling-initial-text-selection/147460)

<div class="topic-metadata">

**Author:** [@annette](https://www.ruby-forum.com/u/annette)\
**Replies:** 1\
**Last updated:** [September 2, 2008, 4:31am UTC](https://www.ruby-forum.com/t/ajax-inplaceeditor-controlling-initial-text-selection/147460 "2008-09-02T04:31:44Z")

</div>

I want to use in-place editing, but do not want any text to be selected when the user invokes the in-place editor. I would like the cursor to be placed at the end of the text when the in-place editor appears instead …

---

## [Freezing blucloth gem into an app?](https://www.ruby-forum.com/t/freezing-blucloth-gem-into-an-app/147412)

<div class="topic-metadata">

**Author:** [@helix\_tp](https://www.ruby-forum.com/u/helix_tp)\
**Replies:** 2\
**Last updated:** [September 2, 2008, 3:16am UTC](https://www.ruby-forum.com/t/freezing-blucloth-gem-into-an-app/147412 "2008-09-02T03:16:00Z")

</div>

Any suggestions on freezing bluecloth \[1\] into an app? It has a non-standard install \[2\], and when I used http://gemsonrails.rubyforge.org/ to freeze it into a rails app, I get this on startup: ERROR: Please update …

---

## [Trying to fill in a couple of text fields based on user selection from a drop-down list](https://www.ruby-forum.com/t/trying-to-fill-in-a-couple-of-text-fields-based-on-user-selection-from-a-drop-down-list/147455)

<div class="topic-metadata">

**Author:** [@sharon](https://www.ruby-forum.com/u/sharon)\
**Replies:** 0\
**Last updated:** [September 2, 2008, 2:29am UTC](https://www.ruby-forum.com/t/trying-to-fill-in-a-couple-of-text-fields-based-on-user-selection-from-a-drop-down-list/147455 "2008-09-02T02:29:46Z")

</div>

I’m very new working with Ajax. In a data submission form, I’d like some data to be filled in automatically (from the database) if a user selects certain options from a drop-down list. I have an Event model, and an Ev…

---

## [Auto\_complete\_for not found?](https://www.ruby-forum.com/t/auto-complete-for-not-found/147386)

<div class="topic-metadata">

**Author:** [@tashfeen.ekram](https://www.ruby-forum.com/u/tashfeen.ekram)\
**Replies:** 3\
**Last updated:** [September 2, 2008, 1:58am UTC](https://www.ruby-forum.com/t/auto-complete-for-not-found/147386 "2008-09-02T01:58:12Z")

</div>

I tried installing the plugin and it told me it was already installed but when i go to use it it tells me: undefined method \`auto\_complete\_for’ for AdminController:Class Here is how i have added it: class AdminContro…

---

## [HABTM Question](https://www.ruby-forum.com/t/habtm-question/147450)

<div class="topic-metadata">

**Author:** [@starnix17](https://www.ruby-forum.com/u/starnix17)\
**Replies:** 2\
**Last updated:** [September 1, 2008, 11:59pm UTC](https://www.ruby-forum.com/t/habtm-question/147450 "2008-09-01T23:59:27Z")

</div>

OK, I’m working on a simple site to share music created by users from a forum I belong to. I’m trying to make it so users can follow other users to keep track of what they’re up to (sort of like Twitter if you know ho…

---

## [Use a Builder rxml template for more than one controller in Rails 1.2?](https://www.ruby-forum.com/t/use-a-builder-rxml-template-for-more-than-one-controller-in-rails-1-2/146334)

<div class="topic-metadata">

**Author:** [@sharon](https://www.ruby-forum.com/u/sharon)\
**Replies:** 3\
**Last updated:** [September 1, 2008, 11:26pm UTC](https://www.ruby-forum.com/t/use-a-builder-rxml-template-for-more-than-one-controller-in-rails-1-2/146334 "2008-09-01T23:26:06Z")

</div>

I’m trying to do the equivalent in Rails 1.2 of def method\_for\_controller\_one render(:controller =\> ‘controller\_two’, :action =\> ‘rss’) end but instead of using a view rss.rhtml, I want to use a Builder template rss…

---

## [Help with generating random item number](https://www.ruby-forum.com/t/help-with-generating-random-item-number/147432)

<div class="topic-metadata">

**Author:** [@CPerry](https://www.ruby-forum.com/u/CPerry)\
**Replies:** 6\
**Last updated:** [September 1, 2008, 9:34pm UTC](https://www.ruby-forum.com/t/help-with-generating-random-item-number/147432 "2008-09-01T21:34:42Z")

</div>

Hey all, when a user submits a new item in my app, I want to generate a random 7-digit number for that item. So far, I am a little unclear as to how this should work. Here is what I have in my item.rb model generate…

---

## [How to update parent of a belongs\_to association](https://www.ruby-forum.com/t/how-to-update-parent-of-a-belongs-to-association/141115)

<div class="topic-metadata">

**Author:** [@oldbug](https://www.ruby-forum.com/u/oldbug)\
**Replies:** 8\
**Last updated:** [September 1, 2008, 9:19pm UTC](https://www.ruby-forum.com/t/how-to-update-parent-of-a-belongs-to-association/141115 "2008-09-01T21:19:28Z")

</div>

I have a pair of models: class Document \< ActiveRecord::Base has\_many :revisions attributes: Title, Number, etc… end Class Revision \< ActiveRecord::Base belongs\_to :Document attributes: document\_id, revision, relea…

---

## [Why's my course\_duration being reset](https://www.ruby-forum.com/t/whys-my-course-duration-being-reset/147356)

<div class="topic-metadata">

**Author:** [@bingobob](https://www.ruby-forum.com/u/bingobob)\
**Replies:** 6\
**Last updated:** [September 1, 2008, 8:41pm UTC](https://www.ruby-forum.com/t/whys-my-course-duration-being-reset/147356 "2008-09-01T20:41:36Z")

</div>

Can’t get this?..I’m close I think, my calculation appears to be working, but… when i access duration = \<%= @enquiry.course\_duration %\> in my final view it’s blank… course\_duration is getting set to null but works fo…

---

## [Layout](https://www.ruby-forum.com/t/layout/147392)

<div class="topic-metadata">

**Author:** [@vanight](https://www.ruby-forum.com/u/vanight)\
**Replies:** 1\
**Last updated:** [September 1, 2008, 7:06pm UTC](https://www.ruby-forum.com/t/layout/147392 "2008-09-01T19:06:27Z")

</div>

Hi I have one main layout and I would like that the left menu change depending on the controller. How can I do it ? Thanks

---

## [STOP PRESS Ruby Tech Lead in London, Pioneering Media Co](https://www.ruby-forum.com/t/stop-press-ruby-tech-lead-in-london-pioneering-media-co/147425)

<div class="topic-metadata">

**Author:** [@klasseil](https://www.ruby-forum.com/u/klasseil)\
**Replies:** 0\
**Last updated:** [September 1, 2008, 6:43pm UTC](https://www.ruby-forum.com/t/stop-press-ruby-tech-lead-in-london-pioneering-media-co/147425 "2008-09-01T18:43:16Z")

</div>

ESP are looking for Ruby on Rails developers to join us in establishing and running the back-end software for a range of diverse new media formats. The first phase of these formats has been developed by ThoughtWorks, …

---

## [Apache configuration for using plugin Xsendfile](https://www.ruby-forum.com/t/apache-configuration-for-using-plugin-xsendfile/147424)

<div class="topic-metadata">

**Author:** [@divya](https://www.ruby-forum.com/u/divya)\
**Replies:** 0\
**Last updated:** [September 1, 2008, 6:41pm UTC](https://www.ruby-forum.com/t/apache-configuration-for-using-plugin-xsendfile/147424 "2008-09-01T18:41:18Z")

</div>

Hello I am facing some problem in using the plugin Xsendfile(http:// john.guen.in/rdoc/x\_send\_file/).Here in README for setting up web server , the author has given a link to .But when I try to Install mod\_xsend\_fi…

---

## [Attachement\_fu : resize\_to's not working](https://www.ruby-forum.com/t/attachement-fu-resize-tos-not-working/147338)

<div class="topic-metadata">

**Author:** [@bbnnt](https://www.ruby-forum.com/u/bbnnt)\
**Replies:** 4\
**Last updated:** [September 1, 2008, 6:22pm UTC](https://www.ruby-forum.com/t/attachement-fu-resize-tos-not-working/147338 "2008-09-01T18:22:26Z")

</div>

with the following asset.rb model : has\_attachment :content\_type =\> :image, :storage =\> :file\_system, :processor =\> ‘Rmagick’, :path\_prefix =\> ‘/public/assets/’, :size =\> 0.kilobytes…100000.kilobytes, :max\_size =\> …

---

## [Rails install failure on VPS host - suggestions?](https://www.ruby-forum.com/t/rails-install-failure-on-vps-host-suggestions/143387)

<div class="topic-metadata">

**Author:** [@wFredk](https://www.ruby-forum.com/u/wFredk)\
**Replies:** 9\
**Last updated:** [September 1, 2008, 6:01pm UTC](https://www.ruby-forum.com/t/rails-install-failure-on-vps-host-suggestions/143387 "2008-09-01T18:01:26Z")

</div>

I’ve installed Ruby 1.8.6 and Rubygems 1.1.1 in my VPS hosting account on eApps.com. I’ve tried to install Rails several times, without success. I then went through the following sequence: gem install rails --incl…

---

## [Trying to using if loop with session stored value but it won't fork](https://www.ruby-forum.com/t/trying-to-using-if-loop-with-session-stored-value-but-it-wont-fork/147403)

<div class="topic-metadata">

**Author:** [@Ruby\_on\_RailsS\_Talk](https://www.ruby-forum.com/u/Ruby_on_RailsS_Talk)\
**Replies:** 3\
**Last updated:** [September 1, 2008, 5:08pm UTC](https://www.ruby-forum.com/t/trying-to-using-if-loop-with-session-stored-value-but-it-wont-fork/147403 "2008-09-01T17:08:32Z")

</div>

Hi I’ve been trying to get the following code to work. I’m sure it must be something simple. As you can see, the session is forced to hold the value of ‘week’. I simply need to check if the value session\[:calview\] is…

---

## [Thin Controller Fat Model (and calculations)](https://www.ruby-forum.com/t/thin-controller-fat-model-and-calculations/147331)

<div class="topic-metadata">

**Author:** [@bingobob](https://www.ruby-forum.com/u/bingobob)\
**Replies:** 3\
**Last updated:** [September 1, 2008, 4:54pm UTC](https://www.ruby-forum.com/t/thin-controller-fat-model-and-calculations/147331 "2008-09-01T16:54:26Z")

</div>

I’m trying to elegantly add some functionality to my app. It’s a language school that has an enquiry form. the functionality I am trying to build is pricing. Basically I’d like to calculate a price for a student and s…

---

## [Multiple items in a single form - trying to get radio button](https://www.ruby-forum.com/t/multiple-items-in-a-single-form-trying-to-get-radio-button/90462)

<div class="topic-metadata">

**Author:** [@scott](https://www.ruby-forum.com/u/scott)\
**Replies:** 10\
**Last updated:** [September 1, 2008, 4:32pm UTC](https://www.ruby-forum.com/t/multiple-items-in-a-single-form-trying-to-get-radio-button/90462 "2008-09-01T16:32:46Z")

</div>

Here’s the setup, fairly standard. I have an order which has multiple order items associated with it. I have a page that displays all the order items associated with the order. There is a single radio button associate…

---

## [Named\_scope on has\_many relationship](https://www.ruby-forum.com/t/named-scope-on-has-many-relationship/147411)

<div class="topic-metadata">

**Author:** [@ratcheer](https://www.ruby-forum.com/u/ratcheer)\
**Replies:** 0\
**Last updated:** [September 1, 2008, 3:54pm UTC](https://www.ruby-forum.com/t/named-scope-on-has-many-relationship/147411 "2008-09-01T15:54:29Z")

</div>

Hi, I have three models: people, visit, place. Each time a person visits a place, then a visit is created. I have the relationships set up correctly with has\_many through. I want a simple way to find a list of all t…

---

## [Assigning collection values and exceptions](https://www.ruby-forum.com/t/assigning-collection-values-and-exceptions/147350)

<div class="topic-metadata">

**Author:** [@crossblaim](https://www.ruby-forum.com/u/crossblaim)\
**Replies:** 9\
**Last updated:** [September 1, 2008, 3:22pm UTC](https://www.ruby-forum.com/t/assigning-collection-values-and-exceptions/147350 "2008-09-01T15:22:57Z")

</div>

hi everyone, I’ve this code in my Report model: has\_many :report\_reasons, :validate =\> true has\_many :reasons, :through =\> :report\_reasons #, :uniq =\> true :accessible =\> true def reason\_attributes=(reason\_attributes…

---

## [How can I customize substruct](https://www.ruby-forum.com/t/how-can-i-customize-substruct/147404)

<div class="topic-metadata">

**Author:** [@bparanj](https://www.ruby-forum.com/u/bparanj)\
**Replies:** 0\
**Last updated:** [September 1, 2008, 2:54pm UTC](https://www.ruby-forum.com/t/how-can-i-customize-substruct/147404 "2008-09-01T14:54:12Z")

</div>

Is there any way to customize substruct so that the users can either pay using demand drafts.

---

## [Time.parse problem](https://www.ruby-forum.com/t/time-parse-problem/147361)

<div class="topic-metadata">

**Author:** [@giorgio](https://www.ruby-forum.com/u/giorgio)\
**Replies:** 1\
**Last updated:** [September 1, 2008, 2:17pm UTC](https://www.ruby-forum.com/t/time-parse-problem/147361 "2008-09-01T14:17:50Z")

</div>

Hi, I am getting a date back from PayPal and it is being processed by ActiveMerchant The date comes back as: “payment\_date”=\>“16:36:26 Aug 31, 2008 PDT” This throws an argument out of range when ActiveMerchant does …

---

## [Assigning a method argument to a model attribute](https://www.ruby-forum.com/t/assigning-a-method-argument-to-a-model-attribute/147398)

<div class="topic-metadata">

**Author:** [@tyliong](https://www.ruby-forum.com/u/tyliong)\
**Replies:** 3\
**Last updated:** [September 1, 2008, 1:11pm UTC](https://www.ruby-forum.com/t/assigning-a-method-argument-to-a-model-attribute/147398 "2008-09-01T13:11:59Z")

</div>

Hi, when i do this: \<%= method(x) %\> in the view and the method: is def method(x) model.x end rails give the error of no argument. how do i assign an argument to the model?

---

## [Problems with model inheritance in development](https://www.ruby-forum.com/t/problems-with-model-inheritance-in-development/147211)

<div class="topic-metadata">

**Author:** [@Antonio\_Tapiador\_de](https://www.ruby-forum.com/u/Antonio_Tapiador_de)\
**Replies:** 1\
**Last updated:** [September 1, 2008, 12:13pm UTC](https://www.ruby-forum.com/t/problems-with-model-inheritance-in-development/147211 "2008-09-01T12:13:51Z")

</div>

Hi! I have problems when a model inherits from another ActiveRecord model: class Space \< ActiveRecord::Base end class Project \< Space end This only happens in development environment. Not in production, neither in …

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

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