# Rails

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

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

---

## [Autoloading not working when using rake task](https://www.ruby-forum.com/t/autoloading-not-working-when-using-rake-task/187334)

<div class="topic-metadata">

**Author:** [@dimkaspb](https://www.ruby-forum.com/u/dimkaspb)\
**Replies:** 1\
**Last updated:** [April 22, 2010, 4:22pm UTC](https://www.ruby-forum.com/t/autoloading-not-working-when-using-rake-task/187334 "2010-04-22T16:22:38Z")

</div>

Hi, I have a problem when I’m doing rake tasks. This behavior happens only on one machine, on another three ones all works fine (three is on ubuntu, problem one is under debian); totally identical environment (I gues…

---

## [Calling destroy on a model that has no id column](https://www.ruby-forum.com/t/calling-destroy-on-a-model-that-has-no-id-column/187356)

<div class="topic-metadata">

**Author:** [@coolmenu](https://www.ruby-forum.com/u/coolmenu)\
**Replies:** 11\
**Last updated:** [April 22, 2010, 4:10pm UTC](https://www.ruby-forum.com/t/calling-destroy-on-a-model-that-has-no-id-column/187356 "2010-04-22T16:10:55Z")

</div>

I’ve got a model, Favorite, that I’m trying to remove from the database by calling the destroy method on it. What’s noteworthy about this model is that it doesn’t have an id column. The unique index on the Favorites…

---

## [Why is ActiveRecord tying to select nonex ID column?](https://www.ruby-forum.com/t/why-is-activerecord-tying-to-select-nonex-id-column/187218)

<div class="topic-metadata">

**Author:** [@fearless\_fool](https://www.ruby-forum.com/u/fearless_fool)\
**Replies:** 13\
**Last updated:** [April 22, 2010, 3:29pm UTC](https://www.ruby-forum.com/t/why-is-activerecord-tying-to-select-nonex-id-column/187218 "2010-04-22T15:29:20Z")

</div>

I’ve loaded (and updated) thousands of these MeteredUsage records. In the middle of a run, I suddenly get: ActiveRecord::StatementInvalid: Mysql::Error: Unknown column ‘id’ in ‘where clause’: UPDATE metered\_usages SE…

---

## [Upload file and display thumbnail immediately on form](https://www.ruby-forum.com/t/upload-file-and-display-thumbnail-immediately-on-form/187380)

<div class="topic-metadata">

**Author:** [@ESESES](https://www.ruby-forum.com/u/ESESES)\
**Replies:** 1\
**Last updated:** [April 22, 2010, 3:25pm UTC](https://www.ruby-forum.com/t/upload-file-and-display-thumbnail-immediately-on-form/187380 "2010-04-22T15:25:13Z")

</div>

Does anyone know how to upload a photo and display the thumbnail in the form before submitting with Paperclip?

---

## ["private method \`gsub'" error caused by addition of a line](https://www.ruby-forum.com/t/private-method-gsub-error-caused-by-addition-of-a-line/187237)

<div class="topic-metadata">

**Author:** [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Replies:** 26\
**Last updated:** [April 22, 2010, 2:17pm UTC](https://www.ruby-forum.com/t/private-method-gsub-error-caused-by-addition-of-a-line/187237 "2010-04-22T14:17:53Z")

</div>

hi all. I just added this line to my config/locals/en.yml file and now rails is blowing up when i try to start mongrel/console. old version: title: main: Who Wants To Be A Millionaire? For Schools flashes: quiz: …

---

## [Problem with partial rendering for groups of objects](https://www.ruby-forum.com/t/problem-with-partial-rendering-for-groups-of-objects/187299)

<div class="topic-metadata">

**Author:** [@Adler\_Santos](https://www.ruby-forum.com/u/Adler_Santos)\
**Replies:** 4\
**Last updated:** [April 22, 2010, 2:13pm UTC](https://www.ruby-forum.com/t/problem-with-partial-rendering-for-groups-of-objects/187299 "2010-04-22T14:13:37Z")

</div>

I have a total of 30 Project thumbnails that I’m planning to render in groups of 8 in my index page. I’m going to put a “next” button that will replace the present group with the next 8 thumbnails, and so on until one…

---

## [Forcing partial type to rxml but Rails still looks for erb](https://www.ruby-forum.com/t/forcing-partial-type-to-rxml-but-rails-still-looks-for-erb/187391)

<div class="topic-metadata">

**Author:** [@fipa](https://www.ruby-forum.com/u/fipa)\
**Replies:** 1\
**Last updated:** [April 22, 2010, 2:09pm UTC](https://www.ruby-forum.com/t/forcing-partial-type-to-rxml-but-rails-still-looks-for-erb/187391 "2010-04-22T14:09:20Z")

</div>

Hi, I am using rxml to render the response of a request and I’d like to use rxml partials to dry things out. The problem is that in the parent rxml view, Rails expects the partial to be an erb file which is incorrect…

---

## [How to create Voronoi diagrams](https://www.ruby-forum.com/t/how-to-create-voronoi-diagrams/197131)

<div class="topic-metadata">

**Author:** [@jorgez](https://www.ruby-forum.com/u/jorgez)\
**Replies:** 1\
**Last updated:** [April 22, 2010, 12:08pm UTC](https://www.ruby-forum.com/t/how-to-create-voronoi-diagrams/197131 "2010-04-22T12:08:28Z")

</div>

Anyone know how to generate Voronoi diagrams with rubyvor library? … It would be helpful …

---

## [Server error](https://www.ruby-forum.com/t/server-error/187376)

<div class="topic-metadata">

**Author:** [@tom](https://www.ruby-forum.com/u/tom)\
**Replies:** 2\
**Last updated:** [April 22, 2010, 11:54am UTC](https://www.ruby-forum.com/t/server-error/187376 "2010-04-22T11:54:25Z")

</div>

Hi, I’m new to rails. I installed it according to “getting started”, created new application, run the server… and got an error :frowning: C:\\Temp\\RailsApplication1\>ruby script/server =\> Booting WEBrick =\> Rails 2.3.5…

---

## [\[JOBS\] Ruby on Rails Developer @ SideReel.com](https://www.ruby-forum.com/t/jobs-ruby-on-rails-developer-sidereel-com/187374)

<div class="topic-metadata">

**Author:** [@Rob\_Morgan](https://www.ruby-forum.com/u/Rob_Morgan)\
**Replies:** 0\
**Last updated:** [April 22, 2010, 10:16am UTC](https://www.ruby-forum.com/t/jobs-ruby-on-rails-developer-sidereel-com/187374 "2010-04-22T10:16:03Z")

</div>

Hi there, We’re looking to add an experienced Ruby/Rails developer to our team here at SideReel in San Francisco. SideReel.com is a fast-growing web site with millions of users that aims to be the center of the online …

---

## [ActionController::RoutingError after using scaffold](https://www.ruby-forum.com/t/actioncontroller-routingerror-after-using-scaffold/187371)

<div class="topic-metadata">

**Author:** [@wlefevre](https://www.ruby-forum.com/u/wlefevre)\
**Replies:** 2\
**Last updated:** [April 22, 2010, 10:11am UTC](https://www.ruby-forum.com/t/actioncontroller-routingerror-after-using-scaffold/187371 "2010-04-22T10:11:06Z")

</div>

Hey there, I’m new to Ruby and was following a tutorial found here: Anyway, I already had my own MySQL database from PHP development so I decided to try to create a scaffold off of a table ‘users’. I get the follow…

---

## [Parameters passing of select\_tag](https://www.ruby-forum.com/t/parameters-passing-of-select-tag/187364)

<div class="topic-metadata">

**Author:** [@tiwaripk](https://www.ruby-forum.com/u/tiwaripk)\
**Replies:** 2\
**Last updated:** [April 22, 2010, 7:36am UTC](https://www.ruby-forum.com/t/parameters-passing-of-select-tag/187364 "2010-04-22T07:36:15Z")

</div>

I wish to have an option in my application where user can select a value from Combo Box shown in a page and on clicking of button this is passed as parameters to another controller. There will be 4 combo boxes on the …

---

## [Database error](https://www.ruby-forum.com/t/database-error/187363)

<div class="topic-metadata">

**Author:** [@smit\_shah](https://www.ruby-forum.com/u/smit_shah)\
**Replies:** 1\
**Last updated:** [April 22, 2010, 7:10am UTC](https://www.ruby-forum.com/t/database-error/187363 "2010-04-22T07:10:24Z")

</div>

Hi All, I am trying to save my form data in to table. I am able to add the data successfully but it creates the 2 record for the single time of form submission. Let me explain in detail. My flow is like following: F…

---

## [Content displaying below posts in "\[ \]"](https://www.ruby-forum.com/t/content-displaying-below-posts-in/187357)

<div class="topic-metadata">

**Author:** [@mike343](https://www.ruby-forum.com/u/mike343)\
**Replies:** 4\
**Last updated:** [April 22, 2010, 6:10am UTC](https://www.ruby-forum.com/t/content-displaying-below-posts-in/187357 "2010-04-22T06:10:13Z")

</div>

I am running into this issue, I am a super newbie when it comes to ruby on rails, mysql. I am a front-end developer trying to get into more of a MVC type structured language, and ruby on rails seemed like the one. Her…

---

## [Using AR.connection.execute(sql) -- messing with my string?](https://www.ruby-forum.com/t/using-ar-connection-execute-sql-messing-with-my-string/187332)

<div class="topic-metadata">

**Author:** [@fearless\_fool](https://www.ruby-forum.com/u/fearless_fool)\
**Replies:** 12\
**Last updated:** [April 22, 2010, 1:52am UTC](https://www.ruby-forum.com/t/using-ar-connection-execute-sql-messing-with-my-string/187332 "2010-04-22T01:52:16Z")

</div>

Does ActiveRecord.connection.execute(string) perform any modifications on the given string? If so, what quoting do I need to add? Here’s why: I’m trying to use execute(string) to load a stored procedure. I can hand-…

---

## [Multiple associations with to\_json](https://www.ruby-forum.com/t/multiple-associations-with-to-json/120715)

<div class="topic-metadata">

**Author:** [@menator](https://www.ruby-forum.com/u/menator)\
**Replies:** 7\
**Last updated:** [April 22, 2010, 1:45am UTC](https://www.ruby-forum.com/t/multiple-associations-with-to-json/120715 "2010-04-22T01:45:56Z")

</div>

How does the to\_json :include option work with multiple associations with multiple levels of associations? I’m using edge rails and found this in the docs: 2nd level and higher order associations work as well: konata…

---

## [\[windows\] AAF Ferret-server can't get runnin'](https://www.ruby-forum.com/t/windows-aaf-ferret-server-cant-get-runnin/187349)

<div class="topic-metadata">

**Author:** [@cube36](https://www.ruby-forum.com/u/cube36)\
**Replies:** 0\
**Last updated:** [April 22, 2010, 1:30am UTC](https://www.ruby-forum.com/t/windows-aaf-ferret-server-cant-get-runnin/187349 "2010-04-22T01:30:08Z")

</div>

I’m trying to run AFF’s Ferret-server @ windows environment. I’d modified ferret\_daemon.rb(\*) so I can get DRb server starts and listening to provided port. Than I’m trying to build index for any model I’m getting tha…

---

## [.each do iteration question](https://www.ruby-forum.com/t/each-do-iteration-question/187316)

<div class="topic-metadata">

**Author:** [@catalin](https://www.ruby-forum.com/u/catalin)\
**Replies:** 4\
**Last updated:** [April 22, 2010, 12:18am UTC](https://www.ruby-forum.com/t/each-do-iteration-question/187316 "2010-04-22T00:18:17Z")

</div>

I got a simple iteration going on \<% @user.sender.each do |sender| %\> … \<% end %\> Can I fetch and display for example only 2 items from my database insted of all 4 of them ? Is there a better way to do this ? I c…

---

## [Can't seem to install bleak house](https://www.ruby-forum.com/t/cant-seem-to-install-bleak-house/187343)

<div class="topic-metadata">

**Author:** [@ct9a](https://www.ruby-forum.com/u/ct9a)\
**Replies:** 0\
**Last updated:** [April 22, 2010, 12:11am UTC](https://www.ruby-forum.com/t/cant-seem-to-install-bleak-house/187343 "2010-04-22T00:11:17Z")

</div>

hi, guys I looked at and figured I give bleak house a try. I ran into a problem during installation of the gem. Here’s an extract: --------------------------------- Extract start Makefile:671: warning: overriding …

---

## [Accessing the router from a helper](https://www.ruby-forum.com/t/accessing-the-router-from-a-helper/187338)

<div class="topic-metadata">

**Author:** [@tomuhs](https://www.ruby-forum.com/u/tomuhs)\
**Replies:** 4\
**Last updated:** [April 21, 2010, 11:13pm UTC](https://www.ruby-forum.com/t/accessing-the-router-from-a-helper/187338 "2010-04-21T23:13:56Z")

</div>

I find manually accessing the router to be quite ugly below. Is there a more direct way to access it? module ApplicationHelper def menu\_item text, url = nil routes = ActionController::Routing::Routes url = if url …

---

## [Want to override ruby\_site oci8 library](https://www.ruby-forum.com/t/want-to-override-ruby-site-oci8-library/187340)

<div class="topic-metadata">

**Author:** [@dmcclean](https://www.ruby-forum.com/u/dmcclean)\
**Replies:** 0\
**Last updated:** [April 21, 2010, 11:12pm UTC](https://www.ruby-forum.com/t/want-to-override-ruby-site-oci8-library/187340 "2010-04-21T23:12:46Z")

</div>

Our network installation of ruby has an old oci8 library in it’s ruby\_site directory. My rails program is finding this instead of my up to date oci8 gem in my own gems library. How can I force the rails program to lo…

---

## [Dynamic :conditions for has\_many?](https://www.ruby-forum.com/t/dynamic-conditions-for-has-many/187337)

<div class="topic-metadata">

**Author:** [@djconcepcion](https://www.ruby-forum.com/u/djconcepcion)\
**Replies:** 0\
**Last updated:** [April 21, 2010, 9:34pm UTC](https://www.ruby-forum.com/t/dynamic-conditions-for-has-many/187337 "2010-04-21T21:34:13Z")

</div>

In the setup of class Group \< ActiveRecord::Base has\_many users :through =\>user\_groups end class User … … end for “admin” like behavior (i.e. we want to see any/all users associated with this group), this is enou…

---

## [Ruby existing database](https://www.ruby-forum.com/t/ruby-existing-database/187265)

<div class="topic-metadata">

**Author:** [@wjrogers](https://www.ruby-forum.com/u/wjrogers)\
**Replies:** 3\
**Last updated:** [April 21, 2010, 9:06pm UTC](https://www.ruby-forum.com/t/ruby-existing-database/187265 "2010-04-21T21:06:08Z")

</div>

Hello all from Ruby newbie, I’m sure this has been asked many times, but I can’t find the answer. I would like to use Ruby for an existing database. It does not use id for the primary key, and the table name are not …

---

## [Refactoring question](https://www.ruby-forum.com/t/refactoring-question/187327)

<div class="topic-metadata">

**Author:** [@bluegreen](https://www.ruby-forum.com/u/bluegreen)\
**Replies:** 3\
**Last updated:** [April 21, 2010, 9:03pm UTC](https://www.ruby-forum.com/t/refactoring-question/187327 "2010-04-21T21:03:39Z")

</div>

Hi, guys. I changed some columns types to decimal in database, but the code is not DIY. Any thoughts on refactoring the following code? change\_table :accounts do |t| t.change :check\_amount, :decimal, :precision=\>6, …

---

## [Flattening 1:1 models](https://www.ruby-forum.com/t/flattening-1-1-models/187323)

<div class="topic-metadata">

**Author:** [@tomuhs](https://www.ruby-forum.com/u/tomuhs)\
**Replies:** 1\
**Last updated:** [April 21, 2010, 8:27pm UTC](https://www.ruby-forum.com/t/flattening-1-1-models/187323 "2010-04-21T20:27:54Z")

</div>

Is there a simple way to flatten 1:1 models so that the methods in one are accessible from another? This attempt results in a stack depth exception for any call to one of the explicitly defined methods: class User \< A…

---

## [Radio buttons and :onchange](https://www.ruby-forum.com/t/radio-buttons-and-onchange/187325)

<div class="topic-metadata">

**Author:** [@snantz](https://www.ruby-forum.com/u/snantz)\
**Replies:** 2\
**Last updated:** [April 21, 2010, 7:33pm UTC](https://www.ruby-forum.com/t/radio-buttons-and-onchange/187325 "2010-04-21T19:33:17Z")

</div>

Hi all, I have three radio buttons that when clicked are supposed to show a particular div and hide other divs, pretty straight forward. But what I have noticed is that while the code works perfectly in Chrome and Fi…

---

## [Tips on how to write a controller test for models associated with currently logged in user](https://www.ruby-forum.com/t/tips-on-how-to-write-a-controller-test-for-models-associated-with-currently-logged-in-user/181534)

<div class="topic-metadata">

**Author:** [@ksader](https://www.ruby-forum.com/u/ksader)\
**Replies:** 8\
**Last updated:** [April 21, 2010, 7:26pm UTC](https://www.ruby-forum.com/t/tips-on-how-to-write-a-controller-test-for-models-associated-with-currently-logged-in-user/181534 "2010-04-21T19:26:36Z")

</div>

I have a controller test here: gist:275616 · GitHub, which works fine when account is an independent model, however I want: an account to be a property of user, ( and created and associated when a user is) when the …

---

## [Anyone know of a Rails POS (point-of-sale) app?](https://www.ruby-forum.com/t/anyone-know-of-a-rails-pos-point-of-sale-app/183328)

<div class="topic-metadata">

**Author:** [@jko170](https://www.ruby-forum.com/u/jko170)\
**Replies:** 6\
**Last updated:** [April 21, 2010, 7:05pm UTC](https://www.ruby-forum.com/t/anyone-know-of-a-rails-pos-point-of-sale-app/183328 "2010-04-21T19:05:05Z")

</div>

Open-source or commercial.

---

## [This works, but it can't be best practice. Advice?](https://www.ruby-forum.com/t/this-works-but-it-cant-be-best-practice-advice/187309)

<div class="topic-metadata">

**Author:** [@paron](https://www.ruby-forum.com/u/paron)\
**Replies:** 2\
**Last updated:** [April 21, 2010, 5:19pm UTC](https://www.ruby-forum.com/t/this-works-but-it-cant-be-best-practice-advice/187309 "2010-04-21T17:19:07Z")

</div>

I want to display all the projects in which a given team has a product. The following code works, but isn’t there a better way? Railsier? Better Practice? #Models# class Team \< ActiveRecord::Base has\_many :products …

---

## [A way to build \<title\>](https://www.ruby-forum.com/t/a-way-to-build-title/187274)

<div class="topic-metadata">

**Author:** [@tomuhs](https://www.ruby-forum.com/u/tomuhs)\
**Replies:** 2\
**Last updated:** [April 21, 2010, 5:13pm UTC](https://www.ruby-forum.com/t/a-way-to-build-title/187274 "2010-04-21T17:13:51Z")

</div>

I would like to be able to easily build a string. Here is how I am doing it right now (I have omitted parts not relevant): In the layout: \<%= title %\> Which calls: module ApplicationHelper def title @title\_part…

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

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