# Rails

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

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

---

## [Sort relative distance on the fly](https://www.ruby-forum.com/t/sort-relative-distance-on-the-fly/165763)

<div class="topic-metadata">

**Author:** [@dezrtdude](https://www.ruby-forum.com/u/dezrtdude)\
**Replies:** 3\
**Last updated:** [April 18, 2009, 9:02pm UTC](https://www.ruby-forum.com/t/sort-relative-distance-on-the-fly/165763 "2009-04-18T21:02:43Z")

</div>

Hi I am quite a newbie in Ruby. I want to sort a list of locations by relative distance (shortest to farthest relative to my location) on the fly. For example, let say I am at x and y coordinate, I have other points i…

---

## [Nginx-0.6.36 =\> unknown directive "if"](https://www.ruby-forum.com/t/nginx-0-6-36-unknown-directive-if/165780)

<div class="topic-metadata">

**Author:** [@temesta](https://www.ruby-forum.com/u/temesta)\
**Replies:** 1\
**Last updated:** [April 18, 2009, 8:52pm UTC](https://www.ruby-forum.com/t/nginx-0-6-36-unknown-directive-if/165780 "2009-04-18T20:52:41Z")

</div>

Hi, I just installed passenger + nginx on my server. Unfortunately my config seems to be broken now with the new NGINX. I’m getting this error: \[emerg\] 4217#0: unknown directive “if” in /usr/local/nginx/conf/halenje…

---

## [\[ANN\] gettext-2.0.1, gettext\_activerecord-2.0.1, gettext\_rails-2.0.1](https://www.ruby-forum.com/t/ann-gettext-2-0-1-gettext-activerecord-2-0-1-gettext-rails-2-0-1/165875)

<div class="topic-metadata">

**Author:** [@Masao\_M](https://www.ruby-forum.com/u/Masao_M)\
**Replies:** 0\
**Last updated:** [April 18, 2009, 7:25pm UTC](https://www.ruby-forum.com/t/ann-gettext-2-0-1-gettext-activerecord-2-0-1-gettext-rails-2-0-1/165875 "2009-04-18T19:25:43Z")

</div>

Hi, Ruby-GetText-Package-2.0.1 and the families (gettext-2.0.1, gettext\_activerecord-2.0.1 and gettext\_rails-2.0.1) are now available. Ruby-GetText-Package is the library/tools for message localization. gettext - M…

---

## [\[ANN\] locale-2.0.1, locale\_rails-2.0.1](https://www.ruby-forum.com/t/ann-locale-2-0-1-locale-rails-2-0-1/165871)

<div class="topic-metadata">

**Author:** [@Masao\_M](https://www.ruby-forum.com/u/Masao_M)\
**Replies:** 0\
**Last updated:** [April 18, 2009, 7:02pm UTC](https://www.ruby-forum.com/t/ann-locale-2-0-1-locale-rails-2-0-1/165871 "2009-04-18T19:02:52Z")

</div>

Hi, Ruby-Locale for Ruby on Rails(locale\_rails-2.0.1) is now available. locale\_rails is the library for Ruby on Rails to manage/detect various format of locale IDs(language tags), and provide ISO 639-3, ISO-3166 dat…

---

## [Rake test fails in RadRails on Clean Install](https://www.ruby-forum.com/t/rake-test-fails-in-radrails-on-clean-install/165799)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 5\
**Last updated:** [April 18, 2009, 6:24pm UTC](https://www.ruby-forum.com/t/rake-test-fails-in-radrails-on-clean-install/165799 "2009-04-18T18:24:47Z")

</div>

I apologise in advance that I’ve come into TDD late in the game and am now trying to catch up. I searched others posts to try and find the answer before creating this new post, with no success. I’m using the Aptana ID…

---

## [Should I learn git or subversion in order to launch and manage a site?](https://www.ruby-forum.com/t/should-i-learn-git-or-subversion-in-order-to-launch-and-manage-a-site/165849)

<div class="topic-metadata">

**Author:** [@david](https://www.ruby-forum.com/u/david)\
**Replies:** 2\
**Last updated:** [April 18, 2009, 5:30pm UTC](https://www.ruby-forum.com/t/should-i-learn-git-or-subversion-in-order-to-launch-and-manage-a-site/165849 "2009-04-18T17:30:49Z")

</div>

I have never launched a site nor used any kind of source code management so I am wondering what makes sense to start learning in order to launch a site. I would like to be able to push edits to the site which will be…

---

## [Completely override has\_many accessor](https://www.ruby-forum.com/t/completely-override-has-many-accessor/165784)

<div class="topic-metadata">

**Author:** [@chris](https://www.ruby-forum.com/u/chris)\
**Replies:** 2\
**Last updated:** [April 18, 2009, 5:10pm UTC](https://www.ruby-forum.com/t/completely-override-has-many-accessor/165784 "2009-04-18T17:10:18Z")

</div>

Hi, I have an unusual use-case where I need to override a has\_many accessor to return an array of results depending on some the value of a class variable. I’ve tried several solutions, the closest to success using th…

---

## [Loading part of a has\_many association, and sorting as I add more elements](https://www.ruby-forum.com/t/loading-part-of-a-has-many-association-and-sorting-as-i-add-more-elements/165840)

<div class="topic-metadata">

**Author:** [@SeanWalberg](https://www.ruby-forum.com/u/SeanWalberg)\
**Replies:** 2\
**Last updated:** [April 18, 2009, 4:38pm UTC](https://www.ruby-forum.com/t/loading-part-of-a-has-many-association-and-sorting-as-i-add-more-elements/165840 "2009-04-18T16:38:39Z")

</div>

Hello, I have what boils down to a timesheet app. Before I display the entry form (eg one text input per day in the current schedule) I load the shifts I have in the database for the given period, then create new, bl…

---

## [About haml and ruby on rail](https://www.ruby-forum.com/t/about-haml-and-ruby-on-rail/165483)

<div class="topic-metadata">

**Author:** [@nilez](https://www.ruby-forum.com/u/nilez)\
**Replies:** 6\
**Last updated:** [April 18, 2009, 3:12pm UTC](https://www.ruby-forum.com/t/about-haml-and-ruby-on-rail/165483 "2009-04-18T15:12:40Z")

</div>

hi all, I am converting my view into HAML format i have done it with “Html2Haml” command, then I removed all the “- end” from haml code and my indentation is also correct,but now it shows following errors I have kep…

---

## [Tips for getting started with testing for first large app?](https://www.ruby-forum.com/t/tips-for-getting-started-with-testing-for-first-large-app/165792)

<div class="topic-metadata">

**Author:** [@ram](https://www.ruby-forum.com/u/ram)\
**Replies:** 26\
**Last updated:** [April 18, 2009, 2:09pm UTC](https://www.ruby-forum.com/t/tips-for-getting-started-with-testing-for-first-large-app/165792 "2009-04-18T14:09:52Z")

</div>

Hi all, Well I have this fairly large application with restful authentication and a few other plugins in it. I developed it wholly otherwise. This is my first ROR app. And I learnt of Test Driven Development quite la…

---

## [Share controller/table](https://www.ruby-forum.com/t/share-controller-table/165729)

<div class="topic-metadata">

**Author:** [@Armen\_Arevian](https://www.ruby-forum.com/u/Armen_Arevian)\
**Replies:** 1\
**Last updated:** [April 18, 2009, 1:05pm UTC](https://www.ruby-forum.com/t/share-controller-table/165729 "2009-04-18T13:05:02Z")

</div>

I’m building a type of CMS and have a question about sharing code/ tables. So i have a typical blog setup with a ‘posts’ controller which has many comments. I need to also make an ‘article’ controller which is simil…

---

## [A bug in sweeper.rb? \[was: A frustrating and strange error when config.action\_controller.perform\_ca](https://www.ruby-forum.com/t/a-bug-in-sweeper-rb-was-a-frustrating-and-strange-error-when-config-action-controller-perform-ca/165855)

<div class="topic-metadata">

**Author:** [@Tim\_U](https://www.ruby-forum.com/u/Tim_U)\
**Replies:** 0\
**Last updated:** [April 18, 2009, 12:14pm UTC](https://www.ruby-forum.com/t/a-bug-in-sweeper-rb-was-a-frustrating-and-strange-error-when-config-action-controller-perform-ca/165855 "2009-04-18T12:14:59Z")

</div>

I fired up the debugger and watched the code happen tonight. The problem occurs if the config.action\_controller.perform\_caching = true in your environment. It’s not set to true in development but it is set to true i…

---

## [Raw SQL in migrations](https://www.ruby-forum.com/t/raw-sql-in-migrations/165845)

<div class="topic-metadata">

**Author:** [@Tyler\_MacDonald](https://www.ruby-forum.com/u/Tyler_MacDonald)\
**Replies:** 1\
**Last updated:** [April 18, 2009, 5:49am UTC](https://www.ruby-forum.com/t/raw-sql-in-migrations/165845 "2009-04-18T05:49:14Z")

</div>

I’ve taken to using this when I just want a migration to be a big wad of sql; runsplit.rb in my lib/ directory: class Runsplit \< ActiveRecord::Migration def self.runsplit(sql) transaction do sql.split(’;’).each do …

---

## [Problem with running rake db:migrate on a Rails app](https://www.ruby-forum.com/t/problem-with-running-rake-db-migrate-on-a-rails-app/160995)

<div class="topic-metadata">

**Author:** [@polarapfel](https://www.ruby-forum.com/u/polarapfel)\
**Replies:** 4\
**Last updated:** [April 18, 2009, 5:00am UTC](https://www.ruby-forum.com/t/problem-with-running-rake-db-migrate-on-a-rails-app/160995 "2009-04-18T05:00:20Z")

</div>

Hi everybody, I am trying to get the Typo blog engine up and running in development mode but I hit the wall as early as running rake db:migrate: (in /home/tweisser/workspace/typo/typo) rake aborted! no such file to …

---

## [Getting file size on upload](https://www.ruby-forum.com/t/getting-file-size-on-upload/165794)

<div class="topic-metadata">

**Author:** [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Replies:** 6\
**Last updated:** [April 18, 2009, 4:25am UTC](https://www.ruby-forum.com/t/getting-file-size-on-upload/165794 "2009-04-18T04:25:51Z")

</div>

I get the file size of images by imgmb = File.size("#{RAILS\_ROOT}/…/#{file}") But that’s when I have the file on the server. Can you test that before in order to stop the file upload if it’s really heavy? How does tha…

---

## [Act\_as\_state\_machine question](https://www.ruby-forum.com/t/act-as-state-machine-question/165839)

<div class="topic-metadata">

**Author:** [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Replies:** 8\
**Last updated:** [April 18, 2009, 4:21am UTC](https://www.ruby-forum.com/t/act-as-state-machine-question/165839 "2009-04-18T04:21:11Z")

</div>

If I am in a form and I am editing it and I have a status of say “being edited”. If someone were to navigate away say to show all forms or something is there a way to update the state of the form?

---

## [Anyone know how to include playerMultipleList.swf](https://www.ruby-forum.com/t/anyone-know-how-to-include-playermultiplelist-swf/165846)

<div class="topic-metadata">

**Author:** [@rubio](https://www.ruby-forum.com/u/rubio)\
**Replies:** 0\
**Last updated:** [April 18, 2009, 4:18am UTC](https://www.ruby-forum.com/t/anyone-know-how-to-include-playermultiplelist-swf/165846 "2009-04-18T04:18:33Z")

</div>

The following code snippet did work beautifully before I retrofitted the website into ROR. Everything but this is working beautifully, and so far I luv ROR. If you have experience with this thanks in advance for shar…

---

## [Installing Rails on Mac Leopard - Best Approach?](https://www.ruby-forum.com/t/installing-rails-on-mac-leopard-best-approach/165817)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 8\
**Last updated:** [April 18, 2009, 3:50am UTC](https://www.ruby-forum.com/t/installing-rails-on-mac-leopard-best-approach/165817 "2009-04-18T03:50:12Z")

</div>

I know this has been asked often over the years, looking for the latest best practice… I’m a total mac noob, have been using windows/cygwin up until now. Looks like the basic approaches I’ve seen so far: Leave the p…

---

## [When is nil not false?](https://www.ruby-forum.com/t/when-is-nil-not-false/165819)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 5\
**Last updated:** [April 18, 2009, 3:32am UTC](https://www.ruby-forum.com/t/when-is-nil-not-false/165819 "2009-04-18T03:32:04Z")

</div>

Can someone see what I cannot given this code? class ForexCASource def initialize(source=nil) xchg\_source unless source puts “this is source = #{source} #{source.class}” puts “do we get here? why?” xchg\_source(sour…

---

## ["Authentication failed" when third party smtp server is used](https://www.ruby-forum.com/t/authentication-failed-when-third-party-smtp-server-is-used/165803)

<div class="topic-metadata">

**Author:** [@ankit2584](https://www.ruby-forum.com/u/ankit2584)\
**Replies:** 1\
**Last updated:** [April 18, 2009, 3:22am UTC](https://www.ruby-forum.com/t/authentication-failed-when-third-party-smtp-server-is-used/165803 "2009-04-18T03:22:29Z")

</div>

Hello, I am using action mailer to send mails. I need to use a third party smtp server. The third party smtp server i am using is authsmtp. ActionMailer::Base.smtp\_settings = { :address =\> "mail.authsmtp.c…

---

## [Ideas for using Localmemcache + Rails?](https://www.ruby-forum.com/t/ideas-for-using-localmemcache-rails/165841)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [April 18, 2009, 2:57am UTC](https://www.ruby-forum.com/t/ideas-for-using-localmemcache-rails/165841 "2009-04-18T02:57:49Z")

</div>

Hi, I am the author of localmemcache. I wrote it so I could set view counters and last-access dates in a webserver module in C and still being able to access this information when I am in Ruby without having to reso…

---

## [Insert Variables into](https://www.ruby-forum.com/t/insert-variables-into/165842)

<div class="topic-metadata">

**Author:** [@pvanovert](https://www.ruby-forum.com/u/pvanovert)\
**Replies:** 0\
**Last updated:** [April 18, 2009, 2:57am UTC](https://www.ruby-forum.com/t/insert-variables-into/165842 "2009-04-18T02:57:49Z")

</div>

Hello, I wrote a small application for a temporary employment company so that they can insert the timestamps and also note the companies for which their employees are currently working. Because it is a web app the ap…

---

## [Open URI problems with google chart](https://www.ruby-forum.com/t/open-uri-problems-with-google-chart/131078)

<div class="topic-metadata">

**Author:** [@Open\_URI\_S\_problems](https://www.ruby-forum.com/u/Open_URI_S_problems)\
**Replies:** 1\
**Last updated:** [April 18, 2009, 1:55am UTC](https://www.ruby-forum.com/t/open-uri-problems-with-google-chart/131078 "2009-04-18T01:55:01Z")

</div>

Hi: I’m using open-uri for trying to save the png generated with google charts. I need to create a pdf report with charts generated but I need to save thems in some way. the proble is that the url i…

---

## [Rails 1.2.3 'Depot' application \> Can't create table '.\\depot\_development\\products.frm'](https://www.ruby-forum.com/t/rails-1-2-3-depot-application-cant-create-table-depot-development-products-frm/165770)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [April 18, 2009, 1:35am UTC](https://www.ruby-forum.com/t/rails-1-2-3-depot-application-cant-create-table-depot-development-products-frm/165770 "2009-04-18T01:35:22Z")

</div>

So I’m driving myself crazy over the ‘Depot’ application in AWDWR (Agile Web D. With Rails) for Rails 1.2. I can’t run my migration script (001\_create\_products.rb). I’m receiving the following error when attempting t…

---

## [Mysql.rb driver has been removed from Rails 2.2?](https://www.ruby-forum.com/t/mysql-rb-driver-has-been-removed-from-rails-2-2/143720)

<div class="topic-metadata">

**Author:** [@jfernandez](https://www.ruby-forum.com/u/jfernandez)\
**Replies:** 11\
**Last updated:** [April 18, 2009, 1:30am UTC](https://www.ruby-forum.com/t/mysql-rb-driver-has-been-removed-from-rails-2-2/143720 "2009-04-18T01:30:40Z")

</div>

Out of nowhere I’m starting to get this error message when trying to access the DB (currently at rails edge): jose@macbook \[~/Development/clients/sequoyah\] $ rake db:create (in /Users/jose/Development/clients/sequoyah…

---

## [Ruby change](https://www.ruby-forum.com/t/ruby-change/165838)

<div class="topic-metadata">

**Author:** [@ricklach](https://www.ruby-forum.com/u/ricklach)\
**Replies:** 0\
**Last updated:** [April 18, 2009, 1:18am UTC](https://www.ruby-forum.com/t/ruby-change/165838 "2009-04-18T01:18:59Z")

</div>

I’ve been running into this problem with gems and plugins recently when using ruby 1.9.1p0. A review of syntax.y from ruby 1.8.7 and 1.9.1 shows the grammar rule for then no longer includes the literal symbol ‘:’. Th…

---

## [Storing Active record validation code in the database](https://www.ruby-forum.com/t/storing-active-record-validation-code-in-the-database/165756)

<div class="topic-metadata">

**Author:** [@interactivenyc](https://www.ruby-forum.com/u/interactivenyc)\
**Replies:** 2\
**Last updated:** [April 17, 2009, 11:54pm UTC](https://www.ruby-forum.com/t/storing-active-record-validation-code-in-the-database/165756 "2009-04-17T23:54:01Z")

</div>

In the book ‘The Rails Way’, Obie F. discusses keeping active- record validation code within a database and then applying those validations conditionally based upon certain attributes of the model. I had a similar req…

---

## [Link\_to\_remote with an image](https://www.ruby-forum.com/t/link-to-remote-with-an-image/165825)

<div class="topic-metadata">

**Author:** [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Replies:** 2\
**Last updated:** [April 17, 2009, 10:39pm UTC](https://www.ruby-forum.com/t/link-to-remote-with-an-image/165825 "2009-04-17T22:39:05Z")

</div>

I have this: \<%= link\_to\_remote ‘Remove’, :url =\> {:controller =\> ‘steps’, :action =\> ‘removestep’, :id =\> @mop}, :with =\> “‘step\_id=’ + # {step.id}”, :src =\> ‘/images/Trash\_can.gif’ %\> I am not getting an image. I…

---

## [Incorrect Integer Value for MySQL Insert](https://www.ruby-forum.com/t/incorrect-integer-value-for-mysql-insert/165801)

<div class="topic-metadata">

**Author:** [@mifi](https://www.ruby-forum.com/u/mifi)\
**Replies:** 3\
**Last updated:** [April 17, 2009, 10:21pm UTC](https://www.ruby-forum.com/t/incorrect-integer-value-for-mysql-insert/165801 "2009-04-17T22:21:48Z")

</div>

I am trying to insert a line of data into a table in MySQL 5, the data I am using is: StartTime: 20090413 13:41:53.000 TestName:changehistory.pl Pass:20 Fail:0 Total:20 Using this function I strip the data down and a…

---

## [Help moving from SVN to GIT](https://www.ruby-forum.com/t/help-moving-from-svn-to-git/165826)

<div class="topic-metadata">

**Author:** [@sfwalter](https://www.ruby-forum.com/u/sfwalter)\
**Replies:** 0\
**Last updated:** [April 17, 2009, 10:13pm UTC](https://www.ruby-forum.com/t/help-moving-from-svn-to-git/165826 "2009-04-17T22:13:53Z")

</div>

I have recently moved an application from SVN to GIT. I have changed my capistrano deployment script to reflect this change (ie: changed :scm in my deployment recipe and pull from GitHub etc…), however I am unsure of…

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

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