# Rails

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

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

---

## [I'm trying to get started with AJAX and having a problem](https://www.ruby-forum.com/t/im-trying-to-get-started-with-ajax-and-having-a-problem/192111)

<div class="topic-metadata">

**Author:** [@adistarmid](https://www.ruby-forum.com/u/adistarmid)\
**Replies:** 4\
**Last updated:** [August 19, 2010, 8:38pm UTC](https://www.ruby-forum.com/t/im-trying-to-get-started-with-ajax-and-having-a-problem/192111 "2010-08-19T20:38:27Z")

</div>

I’m trying to set the focus to the first (and only} field on a search form and having no luck. From searching with google, I came up with: javascript\_tag(“Event.observe(window, ‘load’, function() { var firstForm = $A…

---

## [Ruby question, max length of strings](https://www.ruby-forum.com/t/ruby-question-max-length-of-strings/193518)

<div class="topic-metadata">

**Author:** [@Jeffrey\_LSTaylor](https://www.ruby-forum.com/u/Jeffrey_LSTaylor)\
**Replies:** 4\
**Last updated:** [August 19, 2010, 7:38pm UTC](https://www.ruby-forum.com/t/ruby-question-max-length-of-strings/193518 "2010-08-19T19:38:49Z")

</div>

Am I correct in assuming that the max length of a string is 65,535 on a 32 bit platform? Anyway around this, other classes, 64 bit platform? TIA, Jeffrey

---

## [Rails3: Arel finder discovery!](https://www.ruby-forum.com/t/rails3-arel-finder-discovery/193476)

<div class="topic-metadata">

**Author:** [@AppleII717](https://www.ruby-forum.com/u/AppleII717)\
**Replies:** 2\
**Last updated:** [August 19, 2010, 7:11pm UTC](https://www.ruby-forum.com/t/rails3-arel-finder-discovery/193476 "2010-08-19T19:11:19Z")

</div>

Rail3 Arel finders are just great, but you can’t find a lot of example on how powerful they really are. I made a discovery, just experimenting with some chaining. List say you have Foo has may Bars @foo = Foo.find(1…

---

## [Need some opinions](https://www.ruby-forum.com/t/need-some-opinions/193536)

<div class="topic-metadata">

**Author:** [@Preacher](https://www.ruby-forum.com/u/Preacher)\
**Replies:** 3\
**Last updated:** [August 19, 2010, 6:51pm UTC](https://www.ruby-forum.com/t/need-some-opinions/193536 "2010-08-19T18:51:56Z")

</div>

I have some helper code that I let get out of hand. I have a number of show actions that are routed by ‘controller/:permalink’ and three show actions that are not. The blog controller’s show action gets its page title…

---

## [Removing just leading and trailing newline characters](https://www.ruby-forum.com/t/removing-just-leading-and-trailing-newline-characters/193526)

<div class="topic-metadata">

**Author:** [@priyasaini](https://www.ruby-forum.com/u/priyasaini)\
**Replies:** 11\
**Last updated:** [August 19, 2010, 6:43pm UTC](https://www.ruby-forum.com/t/removing-just-leading-and-trailing-newline-characters/193526 "2010-08-19T18:43:47Z")

</div>

Hi: I am using FCKeditor in one of my form, when i copy and paste something into it using WordPaste, it appends few newlines at the beginning and at the end. How can i strip just those \\n without effecting the inbetw…

---

## [Subclassing a model](https://www.ruby-forum.com/t/subclassing-a-model/193556)

<div class="topic-metadata">

**Author:** [@trapper](https://www.ruby-forum.com/u/trapper)\
**Replies:** 4\
**Last updated:** [August 19, 2010, 6:36pm UTC](https://www.ruby-forum.com/t/subclassing-a-model/193556 "2010-08-19T18:36:54Z")

</div>

Is it possible to define a subclass for a model, that defines additional data columns, which are stored in a separate table? Is there any description, how to do this?

---

## [No route matches ..... for form\_remote\_tag](https://www.ruby-forum.com/t/no-route-matches-for-form-remote-tag/193455)

<div class="topic-metadata">

**Author:** [@techy\_bolek](https://www.ruby-forum.com/u/techy_bolek)\
**Replies:** 2\
**Last updated:** [August 19, 2010, 4:26pm UTC](https://www.ruby-forum.com/t/no-route-matches-for-form-remote-tag/193455 "2010-08-19T16:26:36Z")

</div>

I get an error: No route matches {:controller =\> :controller, :action=\>“add\_groups”} when loading a form under “users” containing: \<% form\_remote\_tag :url =\> { :controller =\> :users, :action =\> :add\_groups } do %\> … …

---

## [Problems installing Flotilla - no such file -- FileUtils](https://www.ruby-forum.com/t/problems-installing-flotilla-no-such-file-fileutils/191153)

<div class="topic-metadata">

**Author:** [@colinloretz](https://www.ruby-forum.com/u/colinloretz)\
**Replies:** 2\
**Last updated:** [August 19, 2010, 4:23pm UTC](https://www.ruby-forum.com/t/problems-installing-flotilla-no-such-file-fileutils/191153 "2010-08-19T16:23:15Z")

</div>

Hi I am attempting to install the Flotilla plugin for the flot javascript charting library. I have tried to install Flotilla using ruby script/plugin install git://github.com/joshuamiller/flotilla.git All seems ok t…

---

## [Error\_messages\_for doesn't work](https://www.ruby-forum.com/t/error-messages-for-doesnt-work/193481)

<div class="topic-metadata">

**Author:** [@upabibi](https://www.ruby-forum.com/u/upabibi)\
**Replies:** 7\
**Last updated:** [August 19, 2010, 3:41pm UTC](https://www.ruby-forum.com/t/error-messages-for-doesnt-work/193481 "2010-08-19T15:41:15Z")

</div>

I’m having a problem, 'cause I wrote the following line in my model “Hi”: validates\_numericality\_of :phone, :only\_integer =\> true, :allow\_blank =\> false, :message =\> "must be a number" And in my “new” view, I put: \<%…

---

## [Test unit results display for every rake task](https://www.ruby-forum.com/t/test-unit-results-display-for-every-rake-task/193542)

<div class="topic-metadata">

**Author:** [@Stewart](https://www.ruby-forum.com/u/Stewart)\
**Replies:** 2\
**Last updated:** [August 19, 2010, 3:32pm UTC](https://www.ruby-forum.com/t/test-unit-results-display-for-every-rake-task/193542 "2010-08-19T15:32:50Z")

</div>

I have not noticed this before but its a little strage. Every time I run a rake task the results of a test suite are displayed. EG ~/Documents/City Uni Work/Final Project/code/server (master)$ rake db:drop (in /Users…

---

## [Respond\_to json gives error: no route matches "/schedules/list.json" with {:method=\>:get}](https://www.ruby-forum.com/t/respond-to-json-gives-error-no-route-matches-schedules-list-json-with-method-get/193389)

<div class="topic-metadata">

**Author:** [@neigaard](https://www.ruby-forum.com/u/neigaard)\
**Replies:** 4\
**Last updated:** [August 19, 2010, 2:22pm UTC](https://www.ruby-forum.com/t/respond-to-json-gives-error-no-route-matches-schedules-list-json-with-method-get/193389 "2010-08-19T14:22:55Z")

</div>

Hi I am a newbie trying to make a webservice that talks JSON. I have this in my controller: class SchedulesController \< ApplicationController def list @schedules = Schedules.all respond\_to do |format| format.html…

---

## [Unable to stop rails application running as window service](https://www.ruby-forum.com/t/unable-to-stop-rails-application-running-as-window-service/193545)

<div class="topic-metadata">

**Author:** [@amit-singh](https://www.ruby-forum.com/u/amit-singh)\
**Replies:** 0\
**Last updated:** [August 19, 2010, 1:59pm UTC](https://www.ruby-forum.com/t/unable-to-stop-rails-application-running-as-window-service/193545 "2010-08-19T13:59:06Z")

</div>

hi, I having a rails application running as windows service and its running ok as service but as i tried stop it using service.msc service box ,it appears to be stopped but its effect is still there and when i restar…

---

## [How to reduce number of queries](https://www.ruby-forum.com/t/how-to-reduce-number-of-queries/193539)

<div class="topic-metadata">

**Author:** [@the-lar](https://www.ruby-forum.com/u/the-lar)\
**Replies:** 0\
**Last updated:** [August 19, 2010, 12:31pm UTC](https://www.ruby-forum.com/t/how-to-reduce-number-of-queries/193539 "2010-08-19T12:31:17Z")

</div>

Hi , presently i have one problem, Ex: i have 6 services SERVICES = { :project\_title =\> ‘Tilte’, :project\_description =\> ‘Description’, :created\_at =\> ‘Created At’, } In these way i have 8 services For each ser…

---

## [How to display a Model Box as Rails response](https://www.ruby-forum.com/t/how-to-display-a-model-box-as-rails-response/193535)

<div class="topic-metadata">

**Author:** [@luckydev](https://www.ruby-forum.com/u/luckydev)\
**Replies:** 0\
**Last updated:** [August 19, 2010, 12:05pm UTC](https://www.ruby-forum.com/t/how-to-display-a-model-box-as-rails-response/193535 "2010-08-19T12:05:55Z")

</div>

I am using jquery colorbox plugin as my popup/modal dialog box solution in my site. When I give a js response to client, I want to open a popup modal dialog box as the response. I wrote the following code in my respon…

---

## [Developer wanted for Rails-Mongo Knowledge Exchange improvements](https://www.ruby-forum.com/t/developer-wanted-for-rails-mongo-knowledge-exchange-improvements/193533)

<div class="topic-metadata">

**Author:** [@SKing](https://www.ruby-forum.com/u/SKing)\
**Replies:** 0\
**Last updated:** [August 19, 2010, 11:00am UTC](https://www.ruby-forum.com/t/developer-wanted-for-rails-mongo-knowledge-exchange-improvements/193533 "2010-08-19T11:00:04Z")

</div>

We are searching for a developer to fork a Rails-based open source Knowledge Exchange (see shapado.com) and add some innovative features and extensions to this excellent codebase. The work will first involve installin…

---

## [Image\_submit\_tag](https://www.ruby-forum.com/t/image-submit-tag/193530)

<div class="topic-metadata">

**Author:** [@srikanth\_j](https://www.ruby-forum.com/u/srikanth_j)\
**Replies:** 2\
**Last updated:** [August 19, 2010, 9:04am UTC](https://www.ruby-forum.com/t/image-submit-tag/193530 "2010-08-19T09:04:12Z")

</div>

Hi Im using image\_submit\_tag to submit my form. works fine… but the image is displayed with border. I used border =\> 0 but no use. This is my code. \<%= image\_submit\_tag “…/images/upload.png”, :border =\> 0 %\> any id…

---

## [Before\_filter :except =\> \[:controller =\> :main\_menu\] ? do we have such thing](https://www.ruby-forum.com/t/before-filter-except-controller-main-menu-do-we-have-such-thing/143631)

<div class="topic-metadata">

**Author:** [@shuaib85](https://www.ruby-forum.com/u/shuaib85)\
**Replies:** 5\
**Last updated:** [August 19, 2010, 8:17am UTC](https://www.ruby-forum.com/t/before-filter-except-controller-main-menu-do-we-have-such-thing/143631 "2010-08-19T08:17:54Z")

</div>

Hi all I have added a before\_filter method in my application. Mainly most of the controllers use that method except one controller. The whole controller does not use this method, so I want to exclude it from the list …

---

## [Help needed to create a complex form](https://www.ruby-forum.com/t/help-needed-to-create-a-complex-form/193464)

<div class="topic-metadata">

**Author:** [@tom-mac](https://www.ruby-forum.com/u/tom-mac)\
**Replies:** 3\
**Last updated:** [August 19, 2010, 8:12am UTC](https://www.ruby-forum.com/t/help-needed-to-create-a-complex-form/193464 "2010-08-19T08:12:38Z")

</div>

Hi My models are message\_thread, message, document (document with attachments I am using paperclip) message\_thread has\_many messages message belongs\_to message\_thread has\_many :document\_messages has\_many :document…

---

## [Help: "500 Internal Server Error"](https://www.ruby-forum.com/t/help-500-internal-server-error/193525)

<div class="topic-metadata">

**Author:** [@jwigal](https://www.ruby-forum.com/u/jwigal)\
**Replies:** 3\
**Last updated:** [August 19, 2010, 7:25am UTC](https://www.ruby-forum.com/t/help-500-internal-server-error/193525 "2010-08-19T07:25:48Z")

</div>

Hi guys, I am a completely ruby & rails newbie. i have being struggling on this issue for almost 2 days, still can not figure out the problem. there are two websites i’m trying to set up a development environment on …

---

## [Has\_many :through question](https://www.ruby-forum.com/t/has-many-through-question/193520)

<div class="topic-metadata">

**Author:** [@hangingclowns](https://www.ruby-forum.com/u/hangingclowns)\
**Replies:** 1\
**Last updated:** [August 19, 2010, 5:14am UTC](https://www.ruby-forum.com/t/has-many-through-question/193520 "2010-08-19T05:14:35Z")

</div>

I am trying to create an association table using the “:through” option in “has\_many” but not having success. I have created the necessary migrations of the association tables and run rake db:migrate I have the followi…

---

## [\<\<starting mysql in virtual rails question\>\>](https://www.ruby-forum.com/t/starting-mysql-in-virtual-rails-question/193517)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [August 19, 2010, 3:32am UTC](https://www.ruby-forum.com/t/starting-mysql-in-virtual-rails-question/193517 "2010-08-19T03:32:49Z")

</div>

I have virtual machine and virtual rails installed on my machine. I opened up a terminal to start the rubystack version of MySQL by typing the following: /opt/rubystack-2.0-0 when I do this I get the following messa…

---

## [Windowed Postgres Query](https://www.ruby-forum.com/t/windowed-postgres-query/193509)

<div class="topic-metadata">

**Author:** [@mindtonic](https://www.ruby-forum.com/u/mindtonic)\
**Replies:** 2\
**Last updated:** [August 19, 2010, 12:32am UTC](https://www.ruby-forum.com/t/windowed-postgres-query/193509 "2010-08-19T00:32:54Z")

</div>

Hello. I have a database query I am trying to develop. For the purpose of explanation, I am going to use a suit of playing cards in ascending order as an example. The complete data set would look like this: \[2, 3, …

---

## [Creating Rails/jQuery/DataMapper application](https://www.ruby-forum.com/t/creating-rails-jquery-datamapper-application/193490)

<div class="topic-metadata">

**Author:** [@Hussein\_B](https://www.ruby-forum.com/u/Hussein_B)\
**Replies:** 1\
**Last updated:** [August 18, 2010, 11:25pm UTC](https://www.ruby-forum.com/t/creating-rails-jquery-datamapper-application/193490 "2010-08-18T23:25:54Z")

</div>

Hey, I want to create a Rails project that uses jQuery and DataMapper. Is it possible? If yes, would you please tell me how. Thanks all.

---

## [How to upgrade Rails version that comes with OS X SL](https://www.ruby-forum.com/t/how-to-upgrade-rails-version-that-comes-with-os-x-sl/193492)

<div class="topic-metadata">

**Author:** [@Hussein\_B](https://www.ruby-forum.com/u/Hussein_B)\
**Replies:** 6\
**Last updated:** [August 18, 2010, 10:50pm UTC](https://www.ruby-forum.com/t/how-to-upgrade-rails-version-that-comes-with-os-x-sl/193492 "2010-08-18T22:50:01Z")

</div>

Hey, I have Rails 2.2.2 installed by default on Mac OS X 10.6 How to upgrade it to the latest Rails 2.x.x ? Thanks for help and time.

---

## [Once I added this HABTM, one of my 'through' relationships, on a non-habtm model, seems to have brok](https://www.ruby-forum.com/t/once-i-added-this-habtm-one-of-my-through-relationships-on-a-non-habtm-model-seems-to-have-brok/193499)

<div class="topic-metadata">

**Author:** [@Rick\_R](https://www.ruby-forum.com/u/Rick_R)\
**Replies:** 6\
**Last updated:** [August 18, 2010, 10:44pm UTC](https://www.ruby-forum.com/t/once-i-added-this-habtm-one-of-my-through-relationships-on-a-non-habtm-model-seems-to-have-brok/193499 "2010-08-18T22:44:49Z")

</div>

I’m a rails newb and have been Googling about this, but I’m still stumped. Not showing everything here, but basically it should be a pretty common setup so I’m sure others know what I’m doing wrong. A meter can belo…

---

## [Locales](https://www.ruby-forum.com/t/locales/193501)

<div class="topic-metadata">

**Author:** [@halfbyte](https://www.ruby-forum.com/u/halfbyte)\
**Replies:** 1\
**Last updated:** [August 18, 2010, 10:40pm UTC](https://www.ruby-forum.com/t/locales/193501 "2010-08-18T22:40:10Z")

</div>

Hello, can sbdy please be so kind and tell me in a few words how to solve the following problem. I have just deployed an application. I generated controller home with an action show. In the view show I have the text…

---

## [Module mixin issue](https://www.ruby-forum.com/t/module-mixin-issue/193504)

<div class="topic-metadata">

**Author:** [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Replies:** 1\
**Last updated:** [August 18, 2010, 9:53pm UTC](https://www.ruby-forum.com/t/module-mixin-issue/193504 "2010-08-18T21:53:53Z")

</div>

I am executing some scripts from the script directory. script files: script1: require File.dirname(FILE) + ‘/…/config/boot’ require File.dirname(FILE) + ‘/…/config/environment’ module DataLoad end script 2 being exe…

---

## [Save! neither saves nor raises error](https://www.ruby-forum.com/t/save-neither-saves-nor-raises-error/193444)

<div class="topic-metadata">

**Author:** [@fearless\_fool](https://www.ruby-forum.com/u/fearless_fool)\
**Replies:** 5\
**Last updated:** [August 18, 2010, 7:25pm UTC](https://www.ruby-forum.com/t/save-neither-saves-nor-raises-error/193444 "2010-08-18T19:25:23Z")

</div>

I don’t like this. This makes me grumpy, and I’ve even already had my morning coffee. obs\[0\] is a PremiseObservation, save! completed without error, yet nothing was written to the db. This is a serious ass-biter: i…

---

## [Rails named scopes joined with OR](https://www.ruby-forum.com/t/rails-named-scopes-joined-with-or/193445)

<div class="topic-metadata">

**Author:** [@san2821](https://www.ruby-forum.com/u/san2821)\
**Replies:** 13\
**Last updated:** [August 18, 2010, 6:33pm UTC](https://www.ruby-forum.com/t/rails-named-scopes-joined-with-or/193445 "2010-08-18T18:33:34Z")

</div>

Is it possible to have OR conditions using named scope ?? For e.g. Gather users based on following or conditions. active is one named scope which finds all users whose state is active OR user id is in 1,2,3 This cond…

---

## [Ruby 1.9 on Windows vs. Linux](https://www.ruby-forum.com/t/ruby-1-9-on-windows-vs-linux/193482)

<div class="topic-metadata">

**Author:** [@cjnkns](https://www.ruby-forum.com/u/cjnkns)\
**Replies:** 2\
**Last updated:** [August 18, 2010, 5:29pm UTC](https://www.ruby-forum.com/t/ruby-1-9-on-windows-vs-linux/193482 "2010-08-18T17:29:14Z")

</div>

I installed Ruby 1.9 on my Ubuntu laptop and started working on the Depot application in the Agile Web D. with Rails book. After trying the same thing at work but, on a Windows machine I notice something strange. Whe…

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

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