# Rails

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

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

---

## [How would you refactor this to make it more DRY](https://www.ruby-forum.com/t/how-would-you-refactor-this-to-make-it-more-dry/153458)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [November 17, 2008, 3:20pm UTC](https://www.ruby-forum.com/t/how-would-you-refactor-this-to-make-it-more-dry/153458 "2008-11-17T15:20:19Z")

</div>

i have your typical nested resource pattern, and at most any resource is one level deep… so for a model PurchaseOrder which is optionally nested under Customer ive worked up this before\_filter… but the problem is, i h…

---

## [Active\_record: wrong number of arguments (1 for 0)](https://www.ruby-forum.com/t/active-record-wrong-number-of-arguments-1-for-0/153455)

<div class="topic-metadata">

**Author:** [@josh](https://www.ruby-forum.com/u/josh)\
**Replies:** 0\
**Last updated:** [November 17, 2008, 2:45pm UTC](https://www.ruby-forum.com/t/active-record-wrong-number-of-arguments-1-for-0/153455 "2008-11-17T14:45:24Z")

</div>

Hi all I’m trying to deploy an older Rails app to a new hoster. I uploaded everything, specified the db connection data and started the app. Sadly I’m getting the following error: ArgumentError: wrong number of argum…

---

## [Can't convert String into Integer error on updating](https://www.ruby-forum.com/t/cant-convert-string-into-integer-error-on-updating/153443)

<div class="topic-metadata">

**Author:** [@raji](https://www.ruby-forum.com/u/raji)\
**Replies:** 1\
**Last updated:** [November 17, 2008, 1:43pm UTC](https://www.ruby-forum.com/t/cant-convert-string-into-integer-error-on-updating/153443 "2008-11-17T13:43:11Z")

</div>

\<% form\_for (:contact,:url=\>{:controller=\>‘contact’,:action =\> ‘update’,:id =\> @contact},:html=\> {:onSubmit =\> ‘return validate()’, :id =\> ‘savecontact’} ) do -%\> . . . . Email Addresses \<% for email in …

---

## [ERROR: could not find gem rmagick locally or in a repository](https://www.ruby-forum.com/t/error-could-not-find-gem-rmagick-locally-or-in-a-repository/153436)

<div class="topic-metadata">

**Author:** [@adammontgomery](https://www.ruby-forum.com/u/adammontgomery)\
**Replies:** 4\
**Last updated:** [November 17, 2008, 1:21pm UTC](https://www.ruby-forum.com/t/error-could-not-find-gem-rmagick-locally-or-in-a-repository/153436 "2008-11-17T13:21:14Z")

</div>

Hi, I’m trying to install the RMagick 2.7.1 (ImageMagick 6.4.5-3) Win32 Installation got here http://rubyforge.org/frs/?group\_id=12&a â€¦ e\_id=27880 I’m following the steps but can’t find the gem rmagick locally. I …

---

## [Models, find not from database? really need help :(](https://www.ruby-forum.com/t/models-find-not-from-database-really-need-help/153434)

<div class="topic-metadata">

**Author:** [@abusiek](https://www.ruby-forum.com/u/abusiek)\
**Replies:** 4\
**Last updated:** [November 17, 2008, 1:07pm UTC](https://www.ruby-forum.com/t/models-find-not-from-database-really-need-help/153434 "2008-11-17T13:07:42Z")

</div>

Hi! I’m struggling with this for a while and i’m new to rails so it’s quite frustrating :wink: I need to create new model object based on old one with only few changes. I have desings -\> has many -\> lines -\> has\_man…

---

## [Migration with data](https://www.ruby-forum.com/t/migration-with-data/153266)

<div class="topic-metadata">

**Author:** [@sijo](https://www.ruby-forum.com/u/sijo)\
**Replies:** 3\
**Last updated:** [November 17, 2008, 11:50am UTC](https://www.ruby-forum.com/t/migration-with-data/153266 "2008-11-17T11:50:19Z")

</div>

Hi I am using postgres and have two migration files like 001\_create\_categories.rb as class CreateCategories \< ActiveRecord::Migration def self.up create\_table :categories do |t| t.column :name, :string, :limit=\>80 …

---

## [Developed my personal website in Rails](https://www.ruby-forum.com/t/developed-my-personal-website-in-rails/153447)

<div class="topic-metadata">

**Author:** [@arun](https://www.ruby-forum.com/u/arun)\
**Replies:** 0\
**Last updated:** [November 17, 2008, 11:00am UTC](https://www.ruby-forum.com/t/developed-my-personal-website-in-rails/153447 "2008-11-17T11:00:23Z")

</div>

Hi Friends, I wanted to take this opportunity to share with you some exciting news! I developed my personal website in Ruby on Rails. Thanks to mephisto URL: http://www.arunkarthick.info Enjoy browsing my website a…

---

## [Heroku invitaion](https://www.ruby-forum.com/t/heroku-invitaion/153444)

<div class="topic-metadata">

**Author:** [@sepehr](https://www.ruby-forum.com/u/sepehr)\
**Replies:** 0\
**Last updated:** [November 17, 2008, 10:51am UTC](https://www.ruby-forum.com/t/heroku-invitaion/153444 "2008-11-17T10:51:35Z")

</div>

could someone send me an heroku invitaion? sepehr.online \[at\] gmail.com thanks in advance

---

## [Solved: plugin models unloading after first request](https://www.ruby-forum.com/t/solved-plugin-models-unloading-after-first-request/149383)

<div class="topic-metadata">

**Author:** [@elijah](https://www.ruby-forum.com/u/elijah)\
**Replies:** 1\
**Last updated:** [November 17, 2008, 9:22am UTC](https://www.ruby-forum.com/t/solved-plugin-models-unloading-after-first-request/149383 "2008-11-17T09:22:39Z")

</div>

I haven’t been able to find this advice anywhere else, so I am posting here so that it may help another lost soul. Some plugins have a problem: if a plugin applies a mixin directly to a model in app/models, this mixin…

---

## [Pagination in Ruport](https://www.ruby-forum.com/t/pagination-in-ruport/153435)

<div class="topic-metadata">

**Author:** [@brijesh](https://www.ruby-forum.com/u/brijesh)\
**Replies:** 0\
**Last updated:** [November 17, 2008, 8:17am UTC](https://www.ruby-forum.com/t/pagination-in-ruport/153435 "2008-11-17T08:17:03Z")

</div>

Hi All, How can I put pagination in HTML report which is generated by Ruport controller.

---

## [64Bit MySQL and Rails on Windows](https://www.ruby-forum.com/t/64bit-mysql-and-rails-on-windows/153423)

<div class="topic-metadata">

**Author:** [@iplat](https://www.ruby-forum.com/u/iplat)\
**Replies:** 1\
**Last updated:** [November 17, 2008, 7:16am UTC](https://www.ruby-forum.com/t/64bit-mysql-and-rails-on-windows/153423 "2008-11-17T07:16:06Z")

</div>

Any ideas how to get 64bit MySQL to work with Rails on Windows? I feel like I’m not using the computer to its full potential if I revert back to 32bit MySQL.

---

## [Newbie Blues](https://www.ruby-forum.com/t/newbie-blues/153429)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 4\
**Last updated:** [November 17, 2008, 7:13am UTC](https://www.ruby-forum.com/t/newbie-blues/153429 "2008-11-17T07:13:45Z")

</div>

Q) Why did the dinosaurs really become extinct? A) They ate their young… It is such a pity that the BEGINNING learning resources for RoR are now out of sync with the Applications… Trying to follow the Linda.com tutor…

---

## [Geting error while running functional test](https://www.ruby-forum.com/t/geting-error-while-running-functional-test/153279)

<div class="topic-metadata">

**Author:** [@sunfish](https://www.ruby-forum.com/u/sunfish)\
**Replies:** 2\
**Last updated:** [November 17, 2008, 6:48am UTC](https://www.ruby-forum.com/t/geting-error-while-running-functional-test/153279 "2008-11-17T06:48:47Z")

</div>

Hi in my application i had some fixtures. and when i give command for running functional test i will get following error E:/projects/sprint\_035/vendor/rails/activerecord/lib/…/…/activesupport/lib/act ive\_support/depe…

---

## [Problem With IE 7](https://www.ruby-forum.com/t/problem-with-ie-7/153353)

<div class="topic-metadata">

**Author:** [@newb](https://www.ruby-forum.com/u/newb)\
**Replies:** 5\
**Last updated:** [November 17, 2008, 4:15am UTC](https://www.ruby-forum.com/t/problem-with-ie-7/153353 "2008-11-17T04:15:37Z")

</div>

I have done this code to give my form Fade effect. It works in Mozila FireFox. But Doesn’t Work in IE 7 Browser. shade.setStyle({ MozOpacity: ‘.15’, filer: ‘alpha(opacity=15)’, opacity: ‘.15’ …

---

## [Simple rails example fails](https://www.ruby-forum.com/t/simple-rails-example-fails/153418)

<div class="topic-metadata">

**Author:** [@Doctuh](https://www.ruby-forum.com/u/Doctuh)\
**Replies:** 1\
**Last updated:** [November 17, 2008, 2:37am UTC](https://www.ruby-forum.com/t/simple-rails-example-fails/153418 "2008-11-17T02:37:13Z")

</div>

Hi, I am a Rails newb. Am using an online tutorial to learn the rails. http://www.visionmasterdesigns.com/2008/08/tutorial-create-blog-using-ruby-on-rails-2-relationship/2/ It is about creating a simple blog. I have g…

---

## [Fragment caching not expiring the correct fragment cache](https://www.ruby-forum.com/t/fragment-caching-not-expiring-the-correct-fragment-cache/153417)

<div class="topic-metadata">

**Author:** [@fipa](https://www.ruby-forum.com/u/fipa)\
**Replies:** 1\
**Last updated:** [November 16, 2008, 11:18pm UTC](https://www.ruby-forum.com/t/fragment-caching-not-expiring-the-correct-fragment-cache/153417 "2008-11-16T23:18:05Z")

</div>

Hi, I have a Product model. My app creates a fragment cache for mysite.com/products, which triggers the index action (my app is RESTful). Only admins can edit products, therefore, when adding a new product, the mysit…

---

## [non-RESTful action or nested routes?](https://www.ruby-forum.com/t/non-restful-action-or-nested-routes/153415)

<div class="topic-metadata">

**Author:** [@davetron5000](https://www.ruby-forum.com/u/davetron5000)\
**Replies:** 0\
**Last updated:** [November 16, 2008, 10:27pm UTC](https://www.ruby-forum.com/t/non-restful-action-or-nested-routes/153415 "2008-11-16T22:27:58Z")

</div>

I’m creating a simple task management system to learn Rails. I have a “task” which is part of a “project”, as so: /projects/5/tasks for project with id 5’s tasks My task has a concept of being started, completed and…

---

## [ActiveRecord Migration question](https://www.ruby-forum.com/t/activerecord-migration-question/153412)

<div class="topic-metadata">

**Author:** [@mlb5000](https://www.ruby-forum.com/u/mlb5000)\
**Replies:** 5\
**Last updated:** [November 16, 2008, 9:47pm UTC](https://www.ruby-forum.com/t/activerecord-migration-question/153412 "2008-11-16T21:47:30Z")

</div>

I have a database table, users, which has a referrer\_id column. This column maps back to the users table to denote the user who referred this record. How can I accomplish this type of reference with the t.references…

---

## [Send a file then redirect to another page](https://www.ruby-forum.com/t/send-a-file-then-redirect-to-another-page/153410)

<div class="topic-metadata">

**Author:** [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Replies:** 1\
**Last updated:** [November 16, 2008, 8:23pm UTC](https://www.ruby-forum.com/t/send-a-file-then-redirect-to-another-page/153410 "2008-11-16T20:23:34Z")

</div>

I’m editing a controller action that previously used “send\_file” to send a file and then just returned, like send\_file(some\_params) and return Now, though, the downloading has been moved into a different controller a…

---

## [Controller DRYness question](https://www.ruby-forum.com/t/controller-dryness-question/152873)

<div class="topic-metadata">

**Author:** [@jhernandez](https://www.ruby-forum.com/u/jhernandez)\
**Replies:** 6\
**Last updated:** [November 16, 2008, 7:07pm UTC](https://www.ruby-forum.com/t/controller-dryness-question/152873 "2008-11-16T19:07:19Z")

</div>

I have some questions regarding how to avoid having to duplicate code in the controller between certain actions such as “new”, “create”, “edit”, “update”, etc. Currently, my “new” and “update” actions both load a coup…

---

## [Tracing an error](https://www.ruby-forum.com/t/tracing-an-error/153242)

<div class="topic-metadata">

**Author:** [@bert\_a](https://www.ruby-forum.com/u/bert_a)\
**Replies:** 10\
**Last updated:** [November 16, 2008, 6:46pm UTC](https://www.ruby-forum.com/t/tracing-an-error/153242 "2008-11-16T18:46:40Z")

</div>

When trying to view my application index page on the web browser in development at link http://www.localhost:3000 the following message appears: Connection Interrupted The connection to the server was reset while the…

---

## [Rake Error](https://www.ruby-forum.com/t/rake-error/153404)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 9\
**Last updated:** [November 16, 2008, 6:09pm UTC](https://www.ruby-forum.com/t/rake-error/153404 "2008-11-16T18:09:51Z")

</div>

First time trying to learn Ruby on Rails from the (it would seem now badly out of date) Linda.com tutorials… I was trying to rake db:migrate and received this error “/usr/bin/rake: 27:in \`require’: no such file to loa…

---

## [Where to call a global variable?](https://www.ruby-forum.com/t/where-to-call-a-global-variable/153350)

<div class="topic-metadata">

**Author:** [@panatura](https://www.ruby-forum.com/u/panatura)\
**Replies:** 6\
**Last updated:** [November 16, 2008, 4:25pm UTC](https://www.ruby-forum.com/t/where-to-call-a-global-variable/153350 "2008-11-16T16:25:40Z")

</div>

Hi guys, I my application has to be all the “recent news, recent users, recent pictures”-stuff. This is shown in a rendered view. Right now I’m using a site controller getting data from different models like @news = …

---

## [Session arrays, vectors and matrices in Rails... and even ruby](https://www.ruby-forum.com/t/session-arrays-vectors-and-matrices-in-rails-and-even-ruby/153390)

<div class="topic-metadata">

**Author:** [@The\_N](https://www.ruby-forum.com/u/The_N)\
**Replies:** 3\
**Last updated:** [November 16, 2008, 4:15pm UTC](https://www.ruby-forum.com/t/session-arrays-vectors-and-matrices-in-rails-and-even-ruby/153390 "2008-11-16T16:15:31Z")

</div>

Hello… I just want to make a simple question: is there a way to make arrays, vectors and matrices with SESSION VARIABLES on Ruby and Rails? I’m making a Rails app and I need to save all the data in session variables …

---

## [Passing object parameters to urls in tests](https://www.ruby-forum.com/t/passing-object-parameters-to-urls-in-tests/153401)

<div class="topic-metadata">

**Author:** [@vahagn](https://www.ruby-forum.com/u/vahagn)\
**Replies:** 0\
**Last updated:** [November 16, 2008, 2:29pm UTC](https://www.ruby-forum.com/t/passing-object-parameters-to-urls-in-tests/153401 "2008-11-16T14:29:47Z")

</div>

I am wondering how to pass parameters to route declarations. I have an app where one project belongs to a user. In one of my integration tests, I want to check that the template being rendered is the one where the “lo…

---

## [Error when run rails project](https://www.ruby-forum.com/t/error-when-run-rails-project/153398)

<div class="topic-metadata">

**Author:** [@em\_lanh](https://www.ruby-forum.com/u/em_lanh)\
**Replies:** 1\
**Last updated:** [November 16, 2008, 2:09pm UTC](https://www.ruby-forum.com/t/error-when-run-rails-project/153398 "2008-11-16T14:09:44Z")

</div>

Hi everyone, I’m new in rails. After I ran “gem update --system”, I had a lot of problems when running rails projects. I tried to fix from error to error and now when I run rails project, it occurs error like this: A…

---

## [Routing problem?](https://www.ruby-forum.com/t/routing-problem/153400)

<div class="topic-metadata">

**Author:** [@isabisa](https://www.ruby-forum.com/u/isabisa)\
**Replies:** 0\
**Last updated:** [November 16, 2008, 1:34pm UTC](https://www.ruby-forum.com/t/routing-problem/153400 "2008-11-16T13:34:12Z")

</div>

Hi everyone, Please have patience with me if this is a stupid question, but I’m new to Ruby and very new to RoR. Basically, I have created a simple scaffold for recipes. It worked just fine on my local computer, I u…

---

## [Farming off zipping task to backgroundrb - advice requested!](https://www.ruby-forum.com/t/farming-off-zipping-task-to-backgroundrb-advice-requested/153399)

<div class="topic-metadata">

**Author:** [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Replies:** 0\
**Last updated:** [November 16, 2008, 11:46am UTC](https://www.ruby-forum.com/t/farming-off-zipping-task-to-backgroundrb-advice-requested/153399 "2008-11-16T11:46:19Z")

</div>

We have a problem at the moment: users build up lessons, which are then zipped up with the lesson player into a standalone executable. This has always been ok for us but the lessons and the player just got a lot big…

---

## [About private method test](https://www.ruby-forum.com/t/about-private-method-test/153297)

<div class="topic-metadata">

**Author:** [@daociyiyou](https://www.ruby-forum.com/u/daociyiyou)\
**Replies:** 6\
**Last updated:** [November 16, 2008, 10:55am UTC](https://www.ruby-forum.com/t/about-private-method-test/153297 "2008-11-16T10:55:32Z")

</div>

For the methods defined as private,we need to test it? For the reason that the private methods are used within the public methods,so we need not to test the private methods as long as the public methods are tested?

---

## [:only and :except not working for map.resources](https://www.ruby-forum.com/t/only-and-except-not-working-for-map-resources/153372)

<div class="topic-metadata">

**Author:** [@nickh](https://www.ruby-forum.com/u/nickh)\
**Replies:** 3\
**Last updated:** [November 16, 2008, 4:36am UTC](https://www.ruby-forum.com/t/only-and-except-not-working-for-map-resources/153372 "2008-11-16T04:36:11Z")

</div>

Hi guys. I’m trying to get rid of some non-existing routes. My UserSessionsController has three methods: new, create, and destroy. However, in routes.rb , I’m generating the 7 RESTful routes: map.resource :user\_sessio…

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

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