# Rails

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

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

---

## [Validations](https://www.ruby-forum.com/t/validations/120965)

<div class="topic-metadata">

**Author:** [@Sameer\_I](https://www.ruby-forum.com/u/Sameer_I)\
**Replies:** 0\
**Last updated:** [November 22, 2007, 8:13am UTC](https://www.ruby-forum.com/t/validations/120965 "2007-11-22T08:13:54Z")

</div>

Hi, I have a question related to validations. My user table has a password field. I have some validations related to password field in my model file for this table (user.rb). I have a typical form to change password …

---

## [Requests through Apache show as from Localhost](https://www.ruby-forum.com/t/requests-through-apache-show-as-from-localhost/119635)

<div class="topic-metadata">

**Author:** [@supasta](https://www.ruby-forum.com/u/supasta)\
**Replies:** 3\
**Last updated:** [November 22, 2007, 8:11am UTC](https://www.ruby-forum.com/t/requests-through-apache-show-as-from-localhost/119635 "2007-11-22T08:11:32Z")

</div>

Does anyone know of a recent change in the way Rails or Mongrel handles headers? After the following updates: Rails updated to 1.2.5 Mongrel updated to 1.1 All log files show as the following no matter the host they…

---

## [Updating quantity of product (Shopping cart)](https://www.ruby-forum.com/t/updating-quantity-of-product-shopping-cart/120854)

<div class="topic-metadata">

**Author:** [@ror-user](https://www.ruby-forum.com/u/ror-user)\
**Replies:** 4\
**Last updated:** [November 22, 2007, 8:00am UTC](https://www.ruby-forum.com/t/updating-quantity-of-product-shopping-cart/120854 "2007-11-22T08:00:14Z")

</div>

Hi all, I am implementing the shopping cart. The functionality is like I have a list of products with fields quantity, product name, unit price and total price. Quantity field is having a text box to change it. There …

---

## [A little help with associations](https://www.ruby-forum.com/t/a-little-help-with-associations/120716)

<div class="topic-metadata">

**Author:** [@cantankerous](https://www.ruby-forum.com/u/cantankerous)\
**Replies:** 1\
**Last updated:** [November 22, 2007, 7:52am UTC](https://www.ruby-forum.com/t/a-little-help-with-associations/120716 "2007-11-22T07:52:15Z")

</div>

I know this is an easy question for a software developer but I’m new to this so I’d really appreciate a little help in designing associations. The basic models I have created are listed below but I’m having a little t…

---

## [Model with two associations?](https://www.ruby-forum.com/t/model-with-two-associations/120954)

<div class="topic-metadata">

**Author:** [@Danimal](https://www.ruby-forum.com/u/Danimal)\
**Replies:** 9\
**Last updated:** [November 22, 2007, 7:36am UTC](https://www.ruby-forum.com/t/model-with-two-associations/120954 "2007-11-22T07:36:26Z")

</div>

Hello! I’m stumped on this one and after lots of searching and reading I need some help, please! I’m trying to model a “purchase” as occurring between a “seller” and a “buyer”, both of which are instances of a User c…

---

## [Apache queue](https://www.ruby-forum.com/t/apache-queue/120884)

<div class="topic-metadata">

**Author:** [@selva](https://www.ruby-forum.com/u/selva)\
**Replies:** 1\
**Last updated:** [November 22, 2007, 5:32am UTC](https://www.ruby-forum.com/t/apache-queue/120884 "2007-11-22T05:32:34Z")

</div>

Hi All, Today i have installed lammp in my application and i deployed my application successfully. But problem is i want to know apache queue.. means how many request has come and how many completed and pending reque…

---

## [ActiveRecord::Migration is a mix-in?](https://www.ruby-forum.com/t/activerecord-migration-is-a-mix-in/120956)

<div class="topic-metadata">

**Author:** [@Thufir](https://www.ruby-forum.com/u/Thufir)\
**Replies:** 0\
**Last updated:** [November 22, 2007, 4:14am UTC](https://www.ruby-forum.com/t/activerecord-migration-is-a-mix-in/120956 "2007-11-22T04:14:56Z")

</div>

I’m going by http://railsforum.com/viewtopic.php?id=1011 and am curious about this line: class AddUserIdToPosts \< ActiveRecord::Migration AddUserIdToPosts is a class, ok. ActiveRecord is a module, ok. Migration is …

---

## [Best way to sanitize a decimal field (remove commas and $'s)](https://www.ruby-forum.com/t/best-way-to-sanitize-a-decimal-field-remove-commas-and-s/120853)

<div class="topic-metadata">

**Author:** [@dracos](https://www.ruby-forum.com/u/dracos)\
**Replies:** 9\
**Last updated:** [November 22, 2007, 2:14am UTC](https://www.ruby-forum.com/t/best-way-to-sanitize-a-decimal-field-remove-commas-and-s/120853 "2007-11-22T02:14:29Z")

</div>

What’s the best way to convert a number that may contain dollar signs or commas to a plain decimal? It seems like there would be a helper for this, but I haven’t found one. I could just declare this data invalid upon …

---

## [Problem with route defaults and caching](https://www.ruby-forum.com/t/problem-with-route-defaults-and-caching/120939)

<div class="topic-metadata">

**Author:** [@andrewkendall](https://www.ruby-forum.com/u/andrewkendall)\
**Replies:** 1\
**Last updated:** [November 22, 2007, 1:12am UTC](https://www.ruby-forum.com/t/problem-with-route-defaults-and-caching/120939 "2007-11-22T01:12:30Z")

</div>

Hi, I’m having a problem with routes and caching. I have two routes set up as follows in my route file… map.connect ‘stats’, :controller =\> ‘stats’, :action =\> ‘index’ map.connect ‘stats/:type’, :controller =\> ‘stats…

---

## [To\_json syntax help](https://www.ruby-forum.com/t/to-json-syntax-help/120945)

<div class="topic-metadata">

**Author:** [@eggie5](https://www.ruby-forum.com/u/eggie5)\
**Replies:** 0\
**Last updated:** [November 22, 2007, 12:35am UTC](https://www.ruby-forum.com/t/to-json-syntax-help/120945 "2007-11-22T00:35:09Z")

</div>

How can I include the delivery\_schedule attribute in this? format.json { render :json =\> @campaign.to\_json(:include =\> {:category =\> {:include =\> :subscriptions}}, :methods =\> :status) } I tried this but I get an er…

---

## [.htaccess configuration](https://www.ruby-forum.com/t/htaccess-configuration/120944)

<div class="topic-metadata">

**Author:** [@oskopik](https://www.ruby-forum.com/u/oskopik)\
**Replies:** 0\
**Last updated:** [November 22, 2007, 12:18am UTC](https://www.ruby-forum.com/t/htaccess-configuration/120944 "2007-11-22T00:18:31Z")

</div>

hello, i use shared hosting with apache and .htacces file for configuration. .htaccess file is places in the rails project folder: RewriteEngine On RewriteRule ^$ public/index.html \[L\] RewriteCond %{REQUEST\_URI} !^…

---

## [Very weird - Type error where there isn't one?!](https://www.ruby-forum.com/t/very-weird-type-error-where-there-isnt-one/120941)

<div class="topic-metadata">

**Author:** [@josh](https://www.ruby-forum.com/u/josh)\
**Replies:** 0\
**Last updated:** [November 22, 2007, 12:10am UTC](https://www.ruby-forum.com/t/very-weird-type-error-where-there-isnt-one/120941 "2007-11-22T00:10:28Z")

</div>

Hi all Put the following code in a view of a Rails app (replace the model classes in the array with some of your model classes): \<ul class="buttons"\> \<% \[Country, LinkCategory, Link, Member, MusicArtist, MusicLabel,…

---

## [Get taken route's name in a view?](https://www.ruby-forum.com/t/get-taken-routes-name-in-a-view/120902)

<div class="topic-metadata">

**Author:** [@josh](https://www.ruby-forum.com/u/josh)\
**Replies:** 4\
**Last updated:** [November 22, 2007, 12:07am UTC](https://www.ruby-forum.com/t/get-taken-routes-name-in-a-view/120902 "2007-11-22T00:07:00Z")

</div>

Hi all Is it possible to get the taken route’s name in a view? Something like \<%= taken\_route %\> Thanks for help Josh

---

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

<div class="topic-metadata">

**Author:** [@tesmar](https://www.ruby-forum.com/u/tesmar)\
**Replies:** 3\
**Last updated:** [November 21, 2007, 11:27pm UTC](https://www.ruby-forum.com/t/rake-error/120849 "2007-11-21T23:27:47Z")

</div>

HI all If I have two functional tests that test the same controller, I get fixture errors. Is this right? here is one require File.dirname(FILE) + ‘/…/test\_helper’ require ‘summary\_controller’ Re-raise errors caugh…

---

## [After Filter Runs Even When Chain Is Halted](https://www.ruby-forum.com/t/after-filter-runs-even-when-chain-is-halted/120710)

<div class="topic-metadata">

**Author:** [@Ian\_Lesperance](https://www.ruby-forum.com/u/Ian_Lesperance)\
**Replies:** 2\
**Last updated:** [November 21, 2007, 11:21pm UTC](https://www.ruby-forum.com/t/after-filter-runs-even-when-chain-is-halted/120710 "2007-11-21T23:21:56Z")

</div>

For a particular set of actions, I have a before and an after filter. When the before filter returns false, however, the after filter still executes (which I can tell because an error is being thrown from it.) I know …

---

## [Shared hosting for mephisto blog + git/svn](https://www.ruby-forum.com/t/shared-hosting-for-mephisto-blog-git-svn/120942)

<div class="topic-metadata">

**Author:** [@pergesu](https://www.ruby-forum.com/u/pergesu)\
**Replies:** 0\
**Last updated:** [November 21, 2007, 11:16pm UTC](https://www.ruby-forum.com/t/shared-hosting-for-mephisto-blog-git-svn/120942 "2007-11-21T23:16:04Z")

</div>

I’ve been running my blog and git/svn repos on Slicehost for a while now, and haven’t had any problems. However at this point any time spent managing the server is time wasted - I’ve just got a ton of stuff to do. I…

---

## [Uninitialized constant: GetText::Rails::Configuration](https://www.ruby-forum.com/t/uninitialized-constant-gettext-configuration/120938)

<div class="topic-metadata">

**Author:** [@benni](https://www.ruby-forum.com/u/benni)\
**Replies:** 0\
**Last updated:** [November 21, 2007, 11:11pm UTC](https://www.ruby-forum.com/t/uninitialized-constant-gettext-configuration/120938 "2007-11-21T23:11:32Z")

</div>

hey I’m using gettext (1.10.0) in my app (rails 1.2.5) and everything works fine except a litte action. this exception occurs, when i finish an order (were using a software to manage foodcoops) and the users should g…

---

## [HowTo: Display file being executed?](https://www.ruby-forum.com/t/howto-display-file-being-executed/120839)

<div class="topic-metadata">

**Author:** [@drub](https://www.ruby-forum.com/u/drub)\
**Replies:** 3\
**Last updated:** [November 21, 2007, 11:06pm UTC](https://www.ruby-forum.com/t/howto-display-file-being-executed/120839 "2007-11-21T23:06:52Z")

</div>

Would like to display some debug code, the file being executed. I want to see something like “File: app/views/site/file.rhtml” Have tried displaying FILE and get a consistent string, regardless of the page displayed. …

---

## [Update\_attribute weirdness in edge](https://www.ruby-forum.com/t/update-attribute-weirdness-in-edge/120842)

<div class="topic-metadata">

**Author:** [@dishkuvek](https://www.ruby-forum.com/u/dishkuvek)\
**Replies:** 3\
**Last updated:** [November 21, 2007, 10:29pm UTC](https://www.ruby-forum.com/t/update-attribute-weirdness-in-edge/120842 "2007-11-21T22:29:05Z")

</div>

If I am changing a boolean value, no matter what approach I take, I get the same results: lets say table “users” has an “enabled” field that is boolean: user = User.find(1) user.enabled.toggle NoMethodError: undefin…

---

## [Slowdown after installing engines](https://www.ruby-forum.com/t/slowdown-after-installing-engines/120934)

<div class="topic-metadata">

**Author:** [@Luke\_Galea](https://www.ruby-forum.com/u/Luke_Galea)\
**Replies:** 0\
**Last updated:** [November 21, 2007, 10:12pm UTC](https://www.ruby-forum.com/t/slowdown-after-installing-engines/120934 "2007-11-21T22:12:32Z")

</div>

Hi all! So, I just added the engines plugin to a large app (aprox 20-30 plugins already installed) so that I could write the first engine in that app. It’s working great, but there was a pretty major performance hit.…

---

## [Warning: require\_gem is obsolete](https://www.ruby-forum.com/t/warning-require-gem-is-obsolete/120845)

<div class="topic-metadata">

**Author:** [@Thufir](https://www.ruby-forum.com/u/Thufir)\
**Replies:** 2\
**Last updated:** [November 21, 2007, 10:10pm UTC](https://www.ruby-forum.com/t/warning-require-gem-is-obsolete/120845 "2007-11-21T22:10:11Z")

</div>

I’m going to continue poking at rails – it’s very exciting :slight\_smile: However, I’m a bit concerned about the warnings about obsolete gems usage. How can I update rails? Googling indicates to re-install all gems, …

---

## [How to find current template](https://www.ruby-forum.com/t/how-to-find-current-template/120932)

<div class="topic-metadata">

**Author:** [@praveen](https://www.ruby-forum.com/u/praveen)\
**Replies:** 0\
**Last updated:** [November 21, 2007, 9:42pm UTC](https://www.ruby-forum.com/t/how-to-find-current-template/120932 "2007-11-21T21:42:31Z")

</div>

Hi How do I find out the template that’s going to be rendered, in a controller action? I need to render the template to a string and send the resulting string via JSON. I need to do this in app/controller/ applicatio…

---

## [Problems with scaffold generated list](https://www.ruby-forum.com/t/problems-with-scaffold-generated-list/120927)

<div class="topic-metadata">

**Author:** [@crispy](https://www.ruby-forum.com/u/crispy)\
**Replies:** 0\
**Last updated:** [November 21, 2007, 8:46pm UTC](https://www.ruby-forum.com/t/problems-with-scaffold-generated-list/120927 "2007-11-21T20:46:10Z")

</div>

There appears to be a problem with LIST generated from scaffold. I just dumped the contents of a table that stores Service Pack Descriptions… ID Title 1 Any 2 SP0 3 SP1 4 SP2 5 SP3 6 SP4 7 SP5 8 SP6 9 SP7 10…

---

## [Expiring page caches with regexp?](https://www.ruby-forum.com/t/expiring-page-caches-with-regexp/120925)

<div class="topic-metadata">

**Author:** [@idlefingers](https://www.ruby-forum.com/u/idlefingers)\
**Replies:** 0\
**Last updated:** [November 21, 2007, 8:27pm UTC](https://www.ruby-forum.com/t/expiring-page-caches-with-regexp/120925 "2007-11-21T20:27:27Z")

</div>

Is there a way to expire page caches using regular expressions like you can with fragment caches? I’m writing an app which has a catalogue style product listing but not full on e-commerce. It’s pretty simple; with jus…

---

## [Property file in RoR](https://www.ruby-forum.com/t/property-file-in-ror/120919)

<div class="topic-metadata">

**Author:** [@backz](https://www.ruby-forum.com/u/backz)\
**Replies:** 1\
**Last updated:** [November 21, 2007, 7:53pm UTC](https://www.ruby-forum.com/t/property-file-in-ror/120919 "2007-11-21T19:53:32Z")

</div>

hi, I am about to deploy RoR app and I need to create property file so that I can put some global variables depends on deployment status (dev/ test/production). How does this work in RoR? If there is any helpful site…

---

## [Selenium on rails](https://www.ruby-forum.com/t/selenium-on-rails/120921)

<div class="topic-metadata">

**Author:** [@nuscas](https://www.ruby-forum.com/u/nuscas)\
**Replies:** 0\
**Last updated:** [November 21, 2007, 7:38pm UTC](https://www.ruby-forum.com/t/selenium-on-rails/120921 "2007-11-21T19:38:57Z")

</div>

Hi Im using selenium on rails for testing my application (ajax action, ui)… Im using rsel files to write my tests but I want to use UnitTest working with selenium (create classes to group functions etc.). I try to re…

---

## [Same site, multiple branding. Putting out the feelers](https://www.ruby-forum.com/t/same-site-multiple-branding-putting-out-the-feelers/120888)

<div class="topic-metadata">

**Author:** [@builderchad](https://www.ruby-forum.com/u/builderchad)\
**Replies:** 2\
**Last updated:** [November 21, 2007, 7:38pm UTC](https://www.ruby-forum.com/t/same-site-multiple-branding-putting-out-the-feelers/120888 "2007-11-21T19:38:42Z")

</div>

Hi all, Just putting out some general feelers and wondering if anyone has tackled this issue before in Rails. Something along the lines of allowing different customers to run their own mini sites from within the main…

---

## [Capistrano: copying directory from previous release](https://www.ruby-forum.com/t/capistrano-copying-directory-from-previous-release/120843)

<div class="topic-metadata">

**Author:** [@leonb](https://www.ruby-forum.com/u/leonb)\
**Replies:** 3\
**Last updated:** [November 21, 2007, 6:57pm UTC](https://www.ruby-forum.com/t/capistrano-copying-directory-from-previous-release/120843 "2007-11-21T18:57:03Z")

</div>

Hi all, I’m using capistrano to deploy my application. But I have to copy the images/\* directory manually each time to the current release. Is there a way to make capistrano do this for me? Something like: run "cp -…

---

## [Testing with development data?](https://www.ruby-forum.com/t/testing-with-development-data/120906)

<div class="topic-metadata">

**Author:** [@stedwick](https://www.ruby-forum.com/u/stedwick)\
**Replies:** 0\
**Last updated:** [November 21, 2007, 5:35pm UTC](https://www.ruby-forum.com/t/testing-with-development-data/120906 "2007-11-21T17:35:34Z")

</div>

My migrations load in some default data into my database: a few categories, a few items, etc. However, when I test using rake, none of that data is there. I even went and installed the migrate\_test\_db plug-in to build…

---

## [Two belong\_to to same model](https://www.ruby-forum.com/t/two-belong-to-to-same-model/120901)

<div class="topic-metadata">

**Author:** [@sabrinih](https://www.ruby-forum.com/u/sabrinih)\
**Replies:** 1\
**Last updated:** [November 21, 2007, 4:50pm UTC](https://www.ruby-forum.com/t/two-belong-to-to-same-model/120901 "2007-11-21T16:50:59Z")

</div>

I have a reservation class which has origin\_city and destination\_city, both of which are instance of location class. How would I represent this using belongs\_to relationship. I would like something like: class Locatio…

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

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