# Rails

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

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

---

## [A new model object associated with two parents](https://www.ruby-forum.com/t/a-new-model-object-associated-with-two-parents/122152)

<div class="topic-metadata">

**Author:** [@tomn](https://www.ruby-forum.com/u/tomn)\
**Replies:** 0\
**Last updated:** [December 5, 2007, 12:02am UTC](https://www.ruby-forum.com/t/a-new-model-object-associated-with-two-parents/122152 "2007-12-05T00:02:23Z")

</div>

Please excuse me if I am asking too many questions. I’ve been appreciating the help (and I have been learning from reading other peoples questions and answers too) Here is a cooked up example of a basic idea I am try…

---

## [What versions go where](https://www.ruby-forum.com/t/what-versions-go-where/122141)

<div class="topic-metadata">

**Author:** [@gemblon](https://www.ruby-forum.com/u/gemblon)\
**Replies:** 1\
**Last updated:** [December 4, 2007, 11:56pm UTC](https://www.ruby-forum.com/t/what-versions-go-where/122141 "2007-12-04T23:56:18Z")

</div>

I am trying to track, what gems go to what version of ruby to what rails. it is a bit of a chore. as i upgrade my ruby and rails, and then watch the gems break. for example, when it comes to authentication, restful …

---

## [How do you delete records in a Join Table](https://www.ruby-forum.com/t/how-do-you-delete-records-in-a-join-table/122016)

<div class="topic-metadata">

**Author:** [@robin2](https://www.ruby-forum.com/u/robin2)\
**Replies:** 6\
**Last updated:** [December 4, 2007, 10:41pm UTC](https://www.ruby-forum.com/t/how-do-you-delete-records-in-a-join-table/122016 "2007-12-04T22:41:46Z")

</div>

What is the correct way to delete the records in a Join Table (used to link two files using habtm). I have resorted to creating a model for the join table. The table is called boats\_members (as it links two tables cal…

---

## [Is there a way to display files for download?](https://www.ruby-forum.com/t/is-there-a-way-to-display-files-for-download/122074)

<div class="topic-metadata">

**Author:** [@TTDaVeTT](https://www.ruby-forum.com/u/TTDaVeTT)\
**Replies:** 1\
**Last updated:** [December 4, 2007, 10:37pm UTC](https://www.ruby-forum.com/t/is-there-a-way-to-display-files-for-download/122074 "2007-12-04T22:37:05Z")

</div>

Hey guys, I am using attachement\_fu to upload and store .pdf files on the file system. I was wondering if anyone knew how to display the files so that a user could click and download them. Any information is useful.…

---

## [Rerun an action if you refresh?](https://www.ruby-forum.com/t/rerun-an-action-if-you-refresh/122045)

<div class="topic-metadata">

**Author:** [@pood](https://www.ruby-forum.com/u/pood)\
**Replies:** 1\
**Last updated:** [December 4, 2007, 10:30pm UTC](https://www.ruby-forum.com/t/rerun-an-action-if-you-refresh/122045 "2007-12-04T22:30:30Z")

</div>

So i’m using the Scrubyt library to scrape some data off of google. The first time you run the action, it runs fine, but if you refresh, it would give me errors. How do I set it up so if I refreshed, it would rerun th…

---

## [Rails ActiveRecord find w/ conditions](https://www.ruby-forum.com/t/rails-activerecord-find-w-conditions/122140)

<div class="topic-metadata">

**Author:** [@nabeelz6](https://www.ruby-forum.com/u/nabeelz6)\
**Replies:** 3\
**Last updated:** [December 4, 2007, 10:23pm UTC](https://www.ruby-forum.com/t/rails-activerecord-find-w-conditions/122140 "2007-12-04T22:23:07Z")

</div>

Hey guys! First time posting so let see how this goes… got a question: I’m trying to find a record in a table minus any leading / trailing whitespaces. This code will find the record but it wont return anything if the …

---

## [Page loads very slowly on Dreamhost after some idle time](https://www.ruby-forum.com/t/page-loads-very-slowly-on-dreamhost-after-some-idle-time/121679)

<div class="topic-metadata">

**Author:** [@ssk](https://www.ruby-forum.com/u/ssk)\
**Replies:** 13\
**Last updated:** [December 4, 2007, 10:15pm UTC](https://www.ruby-forum.com/t/page-loads-very-slowly-on-dreamhost-after-some-idle-time/121679 "2007-12-04T22:15:46Z")

</div>

Hi, I set up my personal site (todo’s, contacts, etc.) on Dreamhost. I am the only one who accesses the site. It’s in production mode and it runs on dispatch.fcgi. The problem is… When I visit the site, the first pa…

---

## [Update a page from the database as changes happen](https://www.ruby-forum.com/t/update-a-page-from-the-database-as-changes-happen/122038)

<div class="topic-metadata">

**Author:** [@Henry\_Collingridge](https://www.ruby-forum.com/u/Henry_Collingridge)\
**Replies:** 2\
**Last updated:** [December 4, 2007, 9:59pm UTC](https://www.ruby-forum.com/t/update-a-page-from-the-database-as-changes-happen/122038 "2007-12-04T21:59:02Z")

</div>

Hello all, Could someone point me towards a recipe for getting the content of a page to update based on changes in the database (versus updates to controls on the page, for example), please? Ideally I’d like fields o…

---

## [Attachment\_fu 'replace' method?](https://www.ruby-forum.com/t/attachment-fu-replace-method/122034)

<div class="topic-metadata">

**Author:** [@nextpulse](https://www.ruby-forum.com/u/nextpulse)\
**Replies:** 2\
**Last updated:** [December 4, 2007, 9:51pm UTC](https://www.ruby-forum.com/t/attachment-fu-replace-method/122034 "2007-12-04T21:51:25Z")

</div>

Is there a ‘replace’ method or similar for attchment\_fu? For instance, I have an image that is uploaded and stored. Now I want to replace it with a different image. I do not want to do a delete and then new - since I …

---

## [Undefined method \`alias\_method\_chain'](https://www.ruby-forum.com/t/undefined-method-alias-method-chain/122033)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [December 4, 2007, 9:50pm UTC](https://www.ruby-forum.com/t/undefined-method-alias-method-chain/122033 "2007-12-04T21:50:15Z")

</div>

I installed the “will\_paginate” plugin and that’s the error I got. I was running rails 0.9, so I upgraded and now I have 1.2.6. However, I’m still getting the same error. What else can I do to fix this?

---

## [Updating your rails application?](https://www.ruby-forum.com/t/updating-your-rails-application/122037)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 3\
**Last updated:** [December 4, 2007, 9:42pm UTC](https://www.ruby-forum.com/t/updating-your-rails-application/122037 "2007-12-04T21:42:01Z")

</div>

How can I update my rails application to work with the current release of rails? For example, I had rails 0.9 and created an application. I installed the will paginate plugin and now the application can’t run. I upgra…

---

## [Freezing Rails 1.2.6 & rubygems 0.95 Problems](https://www.ruby-forum.com/t/freezing-rails-1-2-6-rubygems-0-95-problems/122129)

<div class="topic-metadata">

**Author:** [@dmack](https://www.ruby-forum.com/u/dmack)\
**Replies:** 0\
**Last updated:** [December 4, 2007, 8:51pm UTC](https://www.ruby-forum.com/t/freezing-rails-1-2-6-rubygems-0-95-problems/122129 "2007-12-04T20:51:26Z")

</div>

Freezing to 1.2.6 appears to be broken right now for two reasons. My environment is using rails 1.2.6 and rubygems 0.9.5 Attempting to freeze to 1.2.6 with this will result in this output & error: % rake rails:free…

---

## [Extending ActiveRecord::Base](https://www.ruby-forum.com/t/extending-activerecord-base/122118)

<div class="topic-metadata">

**Author:** [@krystal](https://www.ruby-forum.com/u/krystal)\
**Replies:** 1\
**Last updated:** [December 4, 2007, 8:42pm UTC](https://www.ruby-forum.com/t/extending-activerecord-base/122118 "2007-12-04T20:42:05Z")

</div>

So I have a function that I want all my models to have access to. I’ve done some reading and looked for pages and they all say you can extend ActiveRecord::Base, and then all your models will get the extra function. …

---

## [A couple of database design questions](https://www.ruby-forum.com/t/a-couple-of-database-design-questions/122039)

<div class="topic-metadata">

**Author:** [@brian](https://www.ruby-forum.com/u/brian)\
**Replies:** 4\
**Last updated:** [December 4, 2007, 8:18pm UTC](https://www.ruby-forum.com/t/a-couple-of-database-design-questions/122039 "2007-12-04T20:18:07Z")

</div>

I’m designing a db with several types of organization-type entities, e.g., company, school, etc… each one of which can have one or more addresses, phone numbers, fax numbers, etc. Therefore, wouldn’t it be best to giv…

---

## [Server side pdf viewer](https://www.ruby-forum.com/t/server-side-pdf-viewer/196534)

<div class="topic-metadata">

**Author:** [@snoop1990](https://www.ruby-forum.com/u/snoop1990)\
**Replies:** 0\
**Last updated:** [December 4, 2007, 8:04pm UTC](https://www.ruby-forum.com/t/server-side-pdf-viewer/196534 "2007-12-04T20:04:57Z")

</div>

Hey, I really like ruby on rails, but I do not know how to render a .pdf file on the server side. My aim is to publish .pdf files, but the reader should not feel the difference ! I do not want the .pdf files to be op…

---

## [Server side pdf viewer](https://www.ruby-forum.com/t/server-side-pdf-viewer/122122)

<div class="topic-metadata">

**Author:** [@snoop1990](https://www.ruby-forum.com/u/snoop1990)\
**Replies:** 0\
**Last updated:** [December 4, 2007, 8:04pm UTC](https://www.ruby-forum.com/t/server-side-pdf-viewer/122122 "2007-12-04T20:04:57Z")

</div>

Hey, I really like ruby on rails, but I do not know how to render a .pdf file on the server side. My aim is to publish .pdf files, but the reader should not feel the difference ! I do not want the .pdf files to be op…

---

## [Resource routing methods -- what am I missing?](https://www.ruby-forum.com/t/resource-routing-methods-what-am-i-missing/121935)

<div class="topic-metadata">

**Author:** [@enchanter](https://www.ruby-forum.com/u/enchanter)\
**Replies:** 4\
**Last updated:** [December 4, 2007, 7:46pm UTC](https://www.ruby-forum.com/t/resource-routing-methods-what-am-i-missing/121935 "2007-12-04T19:46:03Z")

</div>

Alright, I’ve been doing map.resources routing for a while now, so whatever I’m missing must be something stupid and obvious… Anyone care to help me out? – routes.rb: … map.resources :algorithms, :collection =\> { :s…

---

## [Problem preventing double click with ajax submit button](https://www.ruby-forum.com/t/problem-preventing-double-click-with-ajax-submit-button/122115)

<div class="topic-metadata">

**Author:** [@dracos](https://www.ruby-forum.com/u/dracos)\
**Replies:** 6\
**Last updated:** [December 4, 2007, 7:31pm UTC](https://www.ruby-forum.com/t/problem-preventing-double-click-with-ajax-submit-button/122115 "2007-12-04T19:31:46Z")

</div>

For a regular form I use the :onlick option to disable the submit button after the first click in order to prevent double clicks (leading to double entries): \<% form\_tag :action =\> ‘create’ do %\> \<%= submit\_tag “Crea…

---

## [Loading fixtures from different dir](https://www.ruby-forum.com/t/loading-fixtures-from-different-dir/122069)

<div class="topic-metadata">

**Author:** [@eggie5](https://www.ruby-forum.com/u/eggie5)\
**Replies:** 1\
**Last updated:** [December 4, 2007, 6:56pm UTC](https://www.ruby-forum.com/t/loading-fixtures-from-different-dir/122069 "2007-12-04T18:56:19Z")

</div>

I have a set of fixtures in my db/bootstrap dir. anybody have any idea on how I can use rake db:fixtures:load with fixtures in a different dir?

---

## [Utf-8 encoding foreign charectors](https://www.ruby-forum.com/t/utf-8-encoding-foreign-charectors/122030)

<div class="topic-metadata">

**Author:** [@oweism](https://www.ruby-forum.com/u/oweism)\
**Replies:** 4\
**Last updated:** [December 4, 2007, 6:24pm UTC](https://www.ruby-forum.com/t/utf-8-encoding-foreign-charectors/122030 "2007-12-04T18:24:38Z")

</div>

hi, i am trying to build and application that accepts different languages and characters. There is two yaml files: english and frensh. i first load the content of the French file as a hash array the dump it back usin…

---

## [Starting ruby on rails with multiple applications](https://www.ruby-forum.com/t/starting-ruby-on-rails-with-multiple-applications/122104)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 2\
**Last updated:** [December 4, 2007, 6:05pm UTC](https://www.ruby-forum.com/t/starting-ruby-on-rails-with-multiple-applications/122104 "2007-12-04T18:05:02Z")

</div>

Hi, I’m using Fedora Core 5 Linux with the latest version of Ruby on Rails. I’m just learning it, but let’s say I’ve created two rails applications in the directories application1/ application2/ I can “cd” to appl…

---

## [Attachment\_fu validation error](https://www.ruby-forum.com/t/attachment-fu-validation-error/122110)

<div class="topic-metadata">

**Author:** [@judybsa](https://www.ruby-forum.com/u/judybsa)\
**Replies:** 0\
**Last updated:** [December 4, 2007, 5:45pm UTC](https://www.ruby-forum.com/t/attachment-fu-validation-error/122110 "2007-12-04T17:45:19Z")

</div>

I’ve installed attachment\_fu and when I try and upload a file, I get this validation error: There were problems with the following fields: Size is not included in the list I’ve changed the model to say: :max\_size =\> …

---

## [NetBeans IDE for RAILS](https://www.ruby-forum.com/t/netbeans-ide-for-rails/122042)

<div class="topic-metadata">

**Author:** [@ayyanar](https://www.ruby-forum.com/u/ayyanar)\
**Replies:** 7\
**Last updated:** [December 4, 2007, 5:38pm UTC](https://www.ruby-forum.com/t/netbeans-ide-for-rails/122042 "2007-12-04T17:38:17Z")

</div>

Any one used NetBeans for the ROR development in windows? Kindly share your experience

---

## [REXML::Formatters - where do they come from?](https://www.ruby-forum.com/t/rexml-formatters-where-do-they-come-from/121433)

<div class="topic-metadata">

**Author:** [@kelleysislander](https://www.ruby-forum.com/u/kelleysislander)\
**Replies:** 9\
**Last updated:** [December 4, 2007, 5:15pm UTC](https://www.ruby-forum.com/t/rexml-formatters-where-do-they-come-from/121433 "2007-12-04T17:15:56Z")

</div>

This is driving me nuts - the Ruby docs mention REXML::Formatters::Default, REXML::Formatters::Transitive, and REXML::Formatters::Pretty. Documentation all over the web talks about using these to format REXML::Documen…

---

## [Call model method out of the controller =\> undefined method](https://www.ruby-forum.com/t/call-model-method-out-of-the-controller-undefined-method/121064)

<div class="topic-metadata">

**Author:** [@danmcb](https://www.ruby-forum.com/u/danmcb)\
**Replies:** 3\
**Last updated:** [December 4, 2007, 5:04pm UTC](https://www.ruby-forum.com/t/call-model-method-out-of-the-controller-undefined-method/121064 "2007-12-04T17:04:09Z")

</div>

Hi, I’m a newby and I fight with the Rails convention - i think so. I’ve done little tools and scripts in Ruby before. I’ve successfully uploaded a textfile. And now i want to extract some filecontent to pass it into…

---

## [Clean way for a modular rails app?](https://www.ruby-forum.com/t/clean-way-for-a-modular-rails-app/122090)

<div class="topic-metadata">

**Author:** [@Karine\_D](https://www.ruby-forum.com/u/Karine_D)\
**Replies:** 1\
**Last updated:** [December 4, 2007, 4:58pm UTC](https://www.ruby-forum.com/t/clean-way-for-a-modular-rails-app/122090 "2007-12-04T16:58:52Z")

</div>

Hello, Right now, my Rails app has a controller with far too many functions. Some of these functions look like: def generic\_function(params) case x when “module1” return module1\_function(params) when “module2” re…

---

## [Choose 6 records from the database randomly](https://www.ruby-forum.com/t/choose-6-records-from-the-database-randomly/122056)

<div class="topic-metadata">

**Author:** [@ror-user](https://www.ruby-forum.com/u/ror-user)\
**Replies:** 7\
**Last updated:** [December 4, 2007, 4:38pm UTC](https://www.ruby-forum.com/t/choose-6-records-from-the-database-randomly/122056 "2007-12-04T16:38:53Z")

</div>

Hello All, I have to choose 6 records from the table but randomly. I have written the code: @products = Product.find(:all, :conditions =\> “feature = 1”, :limit =\> 6) But it fetches only the first six records from th…

---

## [Flicker when replace\_html then blind\_down](https://www.ruby-forum.com/t/flicker-when-replace-html-then-blind-down/122083)

<div class="topic-metadata">

**Author:** [@deliak](https://www.ruby-forum.com/u/deliak)\
**Replies:** 2\
**Last updated:** [December 4, 2007, 3:55pm UTC](https://www.ruby-forum.com/t/flicker-when-replace-html-then-blind-down/122083 "2007-12-04T15:55:10Z")

</div>

Hi all, does anybody know how to make it not flicker when in a rjs you replace\_html and then do a blind\_down? it looks like it displays the whole div, then shrinks it, then grows it…how to fix? Emanuele.

---

## [Clean way for a modular rails app?](https://www.ruby-forum.com/t/clean-way-for-a-modular-rails-app/196533)

<div class="topic-metadata">

**Author:** [@Karine\_D](https://www.ruby-forum.com/u/Karine_D)\
**Replies:** 0\
**Last updated:** [December 4, 2007, 3:53pm UTC](https://www.ruby-forum.com/t/clean-way-for-a-modular-rails-app/196533 "2007-12-04T15:53:41Z")

</div>

Hello, Right now, my Rails app has a controller with far too many functions. Some of these functions look like: def generic\_function(params) case x when “module1” return module1\_function(params) when “module2” re…

---

## [Extending the ActiveRecord:Base class](https://www.ruby-forum.com/t/extending-the-activerecord-base-class/122086)

<div class="topic-metadata">

**Author:** [@harm](https://www.ruby-forum.com/u/harm)\
**Replies:** 2\
**Last updated:** [December 4, 2007, 3:44pm UTC](https://www.ruby-forum.com/t/extending-the-activerecord-base-class/122086 "2007-12-04T15:44:16Z")

</div>

Dear list, I’d like to make an ‘after\_find’ call for each and every AR model I defined. In AWDWR page 376 they do so by opening up the AR class like this: class ActiveRecord::Base def self.some\_method return ‘foo’ …

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

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