# Rails

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

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

---

## [Polymorphic associations](https://www.ruby-forum.com/t/polymorphic-associations/117527)

<div class="topic-metadata">

**Author:** [@destiney](https://www.ruby-forum.com/u/destiney)\
**Replies:** 1\
**Last updated:** [October 18, 2007, 4:49pm UTC](https://www.ruby-forum.com/t/polymorphic-associations/117527 "2007-10-18T16:49:02Z")

</div>

If i have the string ‘us\_address’ how can I use that to create an instance for a view? @us\_address = UsAddress.new Also, does anyone have a URL for how to construct forms for use with polymorphic associations? Every…

---

## [Rerquest.whole\_url? :: does this exist already somewhere?](https://www.ruby-forum.com/t/rerquest-whole-url-does-this-exist-already-somewhere/117588)

<div class="topic-metadata">

**Author:** [@josh](https://www.ruby-forum.com/u/josh)\
**Replies:** 1\
**Last updated:** [October 18, 2007, 4:41pm UTC](https://www.ruby-forum.com/t/rerquest-whole-url-does-this-exist-already-somewhere/117588 "2007-10-18T16:41:28Z")

</div>

Hi all I need to determine the whole URL that a user visits. So I created the following method: class ActionController::AbstractRequest def whole\_url protocol + host\_with\_port + request\_uri end end However, I can…

---

## [Render :nothing deprecated?](https://www.ruby-forum.com/t/render-nothing-deprecated/117596)

<div class="topic-metadata">

**Author:** [@fjan](https://www.ruby-forum.com/u/fjan)\
**Replies:** 3\
**Last updated:** [October 18, 2007, 4:07pm UTC](https://www.ruby-forum.com/t/render-nothing-deprecated/117596 "2007-10-18T16:07:19Z")

</div>

I get a warning “render :nothing deprecated, use render :file instead”… but I cannot find any info on how to use render :file to render nothing. It’s also not mentioned on the deprecated items web page, it this warnin…

---

## [Proxy errors with apache 2.2.3 + mongrel](https://www.ruby-forum.com/t/proxy-errors-with-apache-2-2-3-mongrel/117476)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [October 18, 2007, 3:59pm UTC](https://www.ruby-forum.com/t/proxy-errors-with-apache-2-2-3-mongrel/117476 "2007-10-18T15:59:09Z")

</div>

I have to administer a medium size rails app (1’5 million requests each day), recently I’ve switched from lighttpd + fcgi to apache + mongrel. In the following lines I am going to describe the platform: All machines a…

---

## [Cart configuration and sessions](https://www.ruby-forum.com/t/cart-configuration-and-sessions/229129)

<div class="topic-metadata">

**Author:** [@elle](https://www.ruby-forum.com/u/elle)\
**Replies:** 1\
**Last updated:** [October 18, 2007, 3:36pm UTC](https://www.ruby-forum.com/t/cart-configuration-and-sessions/229129 "2007-10-18T15:36:53Z")

</div>

Hi, I guess as many people, I am very new to Rails. I used a book to create a shopping cart and then modified the code to try and fit it to my project’s requirements. I have been trying figure this out for the last w…

---

## [Class works on Ruby, does not work on Rails controller](https://www.ruby-forum.com/t/class-works-on-ruby-does-not-work-on-rails-controller/117578)

<div class="topic-metadata">

**Author:** [@ace](https://www.ruby-forum.com/u/ace)\
**Replies:** 2\
**Last updated:** [October 18, 2007, 3:26pm UTC](https://www.ruby-forum.com/t/class-works-on-ruby-does-not-work-on-rails-controller/117578 "2007-10-18T15:26:57Z")

</div>

Dear All, I have written a ruby class which uses the flickr webservice. When I wrote a “command line” sript using that class the I get a proper response (through res\_message). But when I use the class in a controller…

---

## [Rails + Apache 2.2.3](https://www.ruby-forum.com/t/rails-apache-2-2-3/117530)

<div class="topic-metadata">

**Author:** [@turnkeytraders](https://www.ruby-forum.com/u/turnkeytraders)\
**Replies:** 5\
**Last updated:** [October 18, 2007, 1:48pm UTC](https://www.ruby-forum.com/t/rails-apache-2-2-3/117530 "2007-10-18T13:48:17Z")

</div>

Hello, I have a server with multiple domains and it runs Apache 2.2.3 with Rails 1.2.5, Ruby 1.8.5 Now, on 1 domain, I have a subdomain and on this subdomain, I want to run a rails app. Now I don’t use Mongrel or anyt…

---

## [To Implement Remember me functionality](https://www.ruby-forum.com/t/to-implement-remember-me-functionality/117595)

<div class="topic-metadata">

**Author:** [@ruchita](https://www.ruby-forum.com/u/ruchita)\
**Replies:** 13\
**Last updated:** [October 18, 2007, 1:27pm UTC](https://www.ruby-forum.com/t/to-implement-remember-me-functionality/117595 "2007-10-18T13:27:27Z")

</div>

Hi all, I am trying to implement the functionality of Remember Me. The requirement is that once the user closes the browser after checking the remember me check box, it should return to the login page with username a…

---

## [Form removing leading zeros for a string](https://www.ruby-forum.com/t/form-removing-leading-zeros-for-a-string/117583)

<div class="topic-metadata">

**Author:** [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Replies:** 1\
**Last updated:** [October 18, 2007, 11:31am UTC](https://www.ruby-forum.com/t/form-removing-leading-zeros-for-a-string/117583 "2007-10-18T11:31:35Z")

</div>

Hi, I have a drop down select see below which populates from the below, select(:record, :visually\_similar\_to, Sample.find(:all).collect {|p| p.sample\_ref, p.id \] }) sample\_ref is varchar field so the values that popu…

---

## [Mixing Mongrel and non-Mongrel vHosts with Apache](https://www.ruby-forum.com/t/mixing-mongrel-and-non-mongrel-vhosts-with-apache/117592)

<div class="topic-metadata">

**Author:** [@smc7000](https://www.ruby-forum.com/u/smc7000)\
**Replies:** 0\
**Last updated:** [October 18, 2007, 11:15am UTC](https://www.ruby-forum.com/t/mixing-mongrel-and-non-mongrel-vhosts-with-apache/117592 "2007-10-18T11:15:26Z")

</div>

Hey everybody. I don’t know if this is properly a Rails question, but I figure if I ask in the Apache forums all I will get is a bunch of people telling me to go ask somebody who knows about Rails. :slight\_smile: I’m…

---

## [Rake db:migrate tells me a custom validation is not avail.!](https://www.ruby-forum.com/t/rake-db-migrate-tells-me-a-custom-validation-is-not-avail/117548)

<div class="topic-metadata">

**Author:** [@josh](https://www.ruby-forum.com/u/josh)\
**Replies:** 2\
**Last updated:** [October 18, 2007, 11:08am UTC](https://www.ruby-forum.com/t/rake-db-migrate-tells-me-a-custom-validation-is-not-avail/117548 "2007-10-18T11:08:24Z")

</div>

Hi all I have the following custom validation helper in application.rb: module ActiveRecord::Validations::ClassMethods def validates\_email\_format\_of(\*attr\_names) configuration = {} configuration.update(attr\_names.po…

---

## [Has\_many :through delete(object) only NULL foreign keys?](https://www.ruby-forum.com/t/has-many-through-delete-object-only-null-foreign-keys/117551)

<div class="topic-metadata">

**Author:** [@stickstone](https://www.ruby-forum.com/u/stickstone)\
**Replies:** 3\
**Last updated:** [October 18, 2007, 10:17am UTC](https://www.ruby-forum.com/t/has-many-through-delete-object-only-null-foreign-keys/117551 "2007-10-18T10:17:11Z")

</div>

I have join model being used with the has\_many :through relationship and am doing the following… class Job has\_many :views has\_many :candidates\_viewd, :through =\> :views, :source =\> :candidate end class Candidate …

---

## [Session Timeout - Best Practice or Gem?](https://www.ruby-forum.com/t/session-timeout-best-practice-or-gem/117496)

<div class="topic-metadata">

**Author:** [@gavin](https://www.ruby-forum.com/u/gavin)\
**Replies:** 3\
**Last updated:** [October 18, 2007, 10:04am UTC](https://www.ruby-forum.com/t/session-timeout-best-practice-or-gem/117496 "2007-10-18T10:04:55Z")

</div>

What’s the best practice for implementing session timeouts? Or is there a gem for this functionality? I remember seeing one several months ago but it appears that it’s no longer available. Gavin

---

## [Count By Group SQL Syntax](https://www.ruby-forum.com/t/count-by-group-sql-syntax/117558)

<div class="topic-metadata">

**Author:** [@nick](https://www.ruby-forum.com/u/nick)\
**Replies:** 4\
**Last updated:** [October 18, 2007, 9:53am UTC](https://www.ruby-forum.com/t/count-by-group-sql-syntax/117558 "2007-10-18T09:53:48Z")

</div>

Dear all, I’m trying to figure out how many rows I have for each group in the following query: @trails = Trail.find(:all, :select =\> "country", :group =\> "country") How can I…

---

## [Catching Timeout::Error from Net::HTTP::new.start()](https://www.ruby-forum.com/t/catching-timeout-error-from-net-new-start/117576)

<div class="topic-metadata">

**Author:** [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Replies:** 2\
**Last updated:** [October 18, 2007, 9:51am UTC](https://www.ruby-forum.com/t/catching-timeout-error-from-net-new-start/117576 "2007-10-18T09:51:28Z")

</div>

I’ve decided to add reCAPTCHA ‘prove you’re not a bot’ to my signup page, and plan on sprinkling it around in various places when people want to post to forums, etc. I know I could use the thing that is already writt…

---

## [Regular expression in Ruby](https://www.ruby-forum.com/t/regular-expression-in-ruby/117161)

<div class="topic-metadata">

**Author:** [@elemental](https://www.ruby-forum.com/u/elemental)\
**Replies:** 13\
**Last updated:** [October 18, 2007, 9:41am UTC](https://www.ruby-forum.com/t/regular-expression-in-ruby/117161 "2007-10-18T09:41:32Z")

</div>

Hi all, I’m new to RoR, and I’ve only used regular expressions in bash, Java, and Perl. I am trying to validate a date input on my model, and I have the following line in my Item class. validates\_format\_of( :purcha…

---

## [Conditionally loading a particular routes file](https://www.ruby-forum.com/t/conditionally-loading-a-particular-routes-file/117495)

<div class="topic-metadata">

**Author:** [@tachekent](https://www.ruby-forum.com/u/tachekent)\
**Replies:** 1\
**Last updated:** [October 18, 2007, 8:40am UTC](https://www.ruby-forum.com/t/conditionally-loading-a-particular-routes-file/117495 "2007-10-18T08:40:42Z")

</div>

Hi there, I’m trying to use RESTful routes with an application that has 2 possible URL roots (e.g): www.example.com/yournamehere/ and (for people who wish to use their own domain name for the app) with the same ap…

---

## [Pagination using SQL Server is slow and often times out on last page](https://www.ruby-forum.com/t/pagination-using-sql-server-is-slow-and-often-times-out-on-last-page/117569)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 2\
**Last updated:** [October 18, 2007, 7:28am UTC](https://www.ruby-forum.com/t/pagination-using-sql-server-is-slow-and-often-times-out-on-last-page/117569 "2007-10-18T07:28:48Z")

</div>

I am working with a legacy database that is in SQL Server. I can’t add any new fields to the database. I think there was a field you are supposed to add for count as an attribute. At any rate, I tried to paginate the …

---

## [Validates\_presence\_of validating twice?](https://www.ruby-forum.com/t/validates-presence-of-validating-twice/117534)

<div class="topic-metadata">

**Author:** [@steve](https://www.ruby-forum.com/u/steve)\
**Replies:** 3\
**Last updated:** [October 18, 2007, 6:47am UTC](https://www.ruby-forum.com/t/validates-presence-of-validating-twice/117534 "2007-10-18T06:47:54Z")

</div>

I’m getting some weird behavior in one of my models. I have a model defined something like this class User \< ActiveRecord::Base attr\_accessor :password validates\_presence\_of :password end If I validate the model wi…

---

## [Rails 1.2.5 - : warning: Object#type is deprecated; use Object#class](https://www.ruby-forum.com/t/rails-1-2-5-warning-object-type-is-deprecated-use-object-class/117567)

<div class="topic-metadata">

**Author:** [@CCH](https://www.ruby-forum.com/u/CCH)\
**Replies:** 4\
**Last updated:** [October 18, 2007, 6:21am UTC](https://www.ruby-forum.com/t/rails-1-2-5-warning-object-type-is-deprecated-use-object-class/117567 "2007-10-18T06:21:02Z")

</div>

Hi After updating to 1.2.5, I am getting : warning: Object#type is deprecated; use Object#class for this code snippet AuditTrail.create(:record\_id =\> record.id, :record\_type =\> record.type.name, :event =\> event, :…

---

## [Fwd: acts\_as\_modified broken in edge](https://www.ruby-forum.com/t/fwd-acts-as-modified-broken-in-edge/117505)

<div class="topic-metadata">

**Author:** [@linojon](https://www.ruby-forum.com/u/linojon)\
**Replies:** 2\
**Last updated:** [October 18, 2007, 5:29am UTC](https://www.ruby-forum.com/t/fwd-acts-as-modified-broken-in-edge/117505 "2007-10-18T05:29:38Z")

</div>

I originally sent this to the author listed in rubyforge, but maybe someone here has already dealt with this? Begin forwarded message:

---

## [How to arrange the field in excel by using to\_csv](https://www.ruby-forum.com/t/how-to-arrange-the-field-in-excel-by-using-to-csv/117378)

<div class="topic-metadata">

**Author:** [@vidyagayathri](https://www.ruby-forum.com/u/vidyagayathri)\
**Replies:** 11\
**Last updated:** [October 18, 2007, 5:21am UTC](https://www.ruby-forum.com/t/how-to-arrange-the-field-in-excel-by-using-to-csv/117378 "2007-10-18T05:21:01Z")

</div>

Hi all, i am exporting the file by using to\_csv, but its coming as unordered rather than my expected output, if i check in the database, its working fine, but in the excel sheet it shows in the unordered,so please let…

---

## [Rails Plugin Fix For attachment\_fu/Kropper Scaling](https://www.ruby-forum.com/t/rails-plugin-fix-for-attachment-fu-kropper-scaling/116086)

<div class="topic-metadata">

**Author:** [@preston](https://www.ruby-forum.com/u/preston)\
**Replies:** 2\
**Last updated:** [October 18, 2007, 5:02am UTC](https://www.ruby-forum.com/t/rails-plugin-fix-for-attachment-fu-kropper-scaling/116086 "2007-10-18T05:02:46Z")

</div>

I recently integrated Kropper into a RoR application. A fundamental flaw in the upload-save-crop-save process used by Kropper is that attachment\_fu automatically scales down the image on first save to :resize\_to dimen…

---

## [BackgrounDRb question](https://www.ruby-forum.com/t/backgroundrb-question/89751)

<div class="topic-metadata">

**Author:** [@simon1](https://www.ruby-forum.com/u/simon1)\
**Replies:** 5\
**Last updated:** [October 18, 2007, 4:53am UTC](https://www.ruby-forum.com/t/backgroundrb-question/89751 "2007-10-18T04:53:12Z")

</div>

Hi, I am going to use BackgrounDRb for to handle some processing, but have one question that I haven’t been able to find in the documentation. I have an application that accepts XML docs via a HTTP POST. I am going …

---

## [Overloading paginate method](https://www.ruby-forum.com/t/overloading-paginate-method/117566)

<div class="topic-metadata">

**Author:** [@kimchirnside](https://www.ruby-forum.com/u/kimchirnside)\
**Replies:** 1\
**Last updated:** [October 18, 2007, 4:49am UTC](https://www.ruby-forum.com/t/overloading-paginate-method/117566 "2007-10-18T04:49:20Z")

</div>

I have run into some problems with the Rails paginate helper. Given a relatively complex pagination search including joins etc, the @item\_count is set incorrectly. This is because the paginator\_and\_collection\_for us…

---

## [Testing white\_list plugin](https://www.ruby-forum.com/t/testing-white-list-plugin/117565)

<div class="topic-metadata">

**Author:** [@flamingsole](https://www.ruby-forum.com/u/flamingsole)\
**Replies:** 0\
**Last updated:** [October 18, 2007, 4:21am UTC](https://www.ruby-forum.com/t/testing-white-list-plugin/117565 "2007-10-18T04:21:20Z")

</div>

Hello, I’ve just attempted to install the white\_list plugin to secure various text areas. I’m seeking a way to filter the posted content before it is implemented in the database, but I wanted to get it to work in the …

---

## [How get the value user id?](https://www.ruby-forum.com/t/how-get-the-value-user-id/117547)

<div class="topic-metadata">

**Author:** [@mmnmm7](https://www.ruby-forum.com/u/mmnmm7)\
**Replies:** 3\
**Last updated:** [October 18, 2007, 3:53am UTC](https://www.ruby-forum.com/t/how-get-the-value-user-id/117547 "2007-10-18T03:53:13Z")

</div>

Hi, all! I’m new to RoR. Please help me. :slight\_smile: ====================================================== \[ /controller/login.rb \] … def find\_id if request.post? member = params\[:member\] @is\_member = Member…

---

## [Restful\_auth - current\_user in models](https://www.ruby-forum.com/t/restful-auth-current-user-in-models/117556)

<div class="topic-metadata">

**Author:** [@bob](https://www.ruby-forum.com/u/bob)\
**Replies:** 1\
**Last updated:** [October 18, 2007, 3:46am UTC](https://www.ruby-forum.com/t/restful-auth-current-user-in-models/117556 "2007-10-18T03:46:13Z")

</div>

Is it possible to reference the current\_user object that restful\_authentication creates when you login, in a model? I’m trying to move some Find methods into my models, but any reference to current\_user returns “metho…

---

## [Initialize Static Data on Startup](https://www.ruby-forum.com/t/initialize-static-data-on-startup/117564)

<div class="topic-metadata">

**Author:** [@acerpro](https://www.ruby-forum.com/u/acerpro)\
**Replies:** 0\
**Last updated:** [October 18, 2007, 3:31am UTC](https://www.ruby-forum.com/t/initialize-static-data-on-startup/117564 "2007-10-18T03:31:36Z")

</div>

Hi, I want to initialize some variables once on startup with static data from the db. The code is at the bottom. Here are all the scenarios I tested: Call Setup.state\_list inside environment.rb before the Rails::…

---

## [A strange error with javascript and safari](https://www.ruby-forum.com/t/a-strange-error-with-javascript-and-safari/117561)

<div class="topic-metadata">

**Author:** [@emuen](https://www.ruby-forum.com/u/emuen)\
**Replies:** 0\
**Last updated:** [October 18, 2007, 3:28am UTC](https://www.ruby-forum.com/t/a-strange-error-with-javascript-and-safari/117561 "2007-10-18T03:28:23Z")

</div>

Hi there. I have attached my file, containing the javascript, that does work in FF but not in Safari. The problem is, that the selectbox is not filled in Safari, as it should be. Is there a special way to do it for Sa…

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

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