# Rails

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

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

---

## [How to sort results of group\_by](https://www.ruby-forum.com/t/how-to-sort-results-of-group-by/155000)

<div class="topic-metadata">

**Author:** [@oldbug](https://www.ruby-forum.com/u/oldbug)\
**Replies:** 3\
**Last updated:** [December 7, 2008, 4:24am UTC](https://www.ruby-forum.com/t/how-to-sort-results-of-group-by/155000 "2008-12-07T04:24:44Z")

</div>

@areas.group\_by(&:responsibility).each do |responsibility, areas| \<%=h responsibility.name %\> \<% areas.each do |area| %\> ... I see that #group\_by iterates through my list of areas, splitting them into sets acco…

---

## [Sql question](https://www.ruby-forum.com/t/sql-question/155056)

<div class="topic-metadata">

**Author:** [@nn2001](https://www.ruby-forum.com/u/nn2001)\
**Replies:** 0\
**Last updated:** [December 7, 2008, 3:33am UTC](https://www.ruby-forum.com/t/sql-question/155056 "2008-12-07T03:33:11Z")

</div>

I have two models of matches and teams that are in habtm relations. now now to render all the teams with the number of other teams that they have match with? Also I tried to run find\_by\_sql but don’t know how to add :…

---

## [Is there any way to use separated databases for models in one RoR app?](https://www.ruby-forum.com/t/is-there-any-way-to-use-separated-databases-for-models-in-one-ror-app/155026)

<div class="topic-metadata">

**Author:** [@PaweSSSSSK](https://www.ruby-forum.com/u/PaweSSSSSK)\
**Replies:** 4\
**Last updated:** [December 6, 2008, 11:22pm UTC](https://www.ruby-forum.com/t/is-there-any-way-to-use-separated-databases-for-models-in-one-ror-app/155026 "2008-12-06T23:22:55Z")

</div>

Like in topic - is there any simple and elegant way to use separated databases for specified models in one RoR app? Here is the example: I’d like to have separated DB for user data (model “Account” with credentials, …

---

## [Bar Chart in Rails](https://www.ruby-forum.com/t/bar-chart-in-rails/154931)

<div class="topic-metadata">

**Author:** [@vasan\_cec](https://www.ruby-forum.com/u/vasan_cec)\
**Replies:** 9\
**Last updated:** [December 6, 2008, 10:24pm UTC](https://www.ruby-forum.com/t/bar-chart-in-rails/154931 "2008-12-06T22:24:53Z")

</div>

Hi Everyone, Can anyone tell me how to draw a bar chart in Rails? Is there any in-built method in Ruby on Rails (or) should i go for 3rd party plugins? I searched and came across this “open flash chart” - i don’t know…

---

## [True ActiveRecord result set iteration](https://www.ruby-forum.com/t/true-activerecord-result-set-iteration/154397)

<div class="topic-metadata">

**Author:** [@granden](https://www.ruby-forum.com/u/granden)\
**Replies:** 8\
**Last updated:** [December 6, 2008, 8:52pm UTC](https://www.ruby-forum.com/t/true-activerecord-result-set-iteration/154397 "2008-12-06T20:52:54Z")

</div>

Hello, For an internal project we were looking for a solution which extends ActiveRecord by an iterator function. Using find(:all) is no fun if you have to process some 10.000 records. Until now there have been two w…

---

## [Strange helper error](https://www.ruby-forum.com/t/strange-helper-error/155032)

<div class="topic-metadata">

**Author:** [@Schalk\_N](https://www.ruby-forum.com/u/Schalk_N)\
**Replies:** 4\
**Last updated:** [December 6, 2008, 8:39pm UTC](https://www.ruby-forum.com/t/strange-helper-error/155032 "2008-12-06T20:39:26Z")

</div>

Hey everyone, I have a controller called CMSController and then a helper called cms\_helper.rb. When trying to access my application I get the following: C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/…

---

## [SuperInPlaceControl](https://www.ruby-forum.com/t/superinplacecontrol/154919)

<div class="topic-metadata">

**Author:** [@Harold](https://www.ruby-forum.com/u/Harold)\
**Replies:** 3\
**Last updated:** [December 6, 2008, 8:04pm UTC](https://www.ruby-forum.com/t/superinplacecontrol/154919 "2008-12-06T20:04:18Z")

</div>

In Rails 2.1, I am using the SuperInPlaceControl plugin to render an in\_place\_select on an instance of a model with a has\_many relationship. So far so good, except that when I click on OK to save the user’s selection,…

---

## [Please help newb - observe\_field?](https://www.ruby-forum.com/t/please-help-newb-observe-field/152721)

<div class="topic-metadata">

**Author:** [@indigoi](https://www.ruby-forum.com/u/indigoi)\
**Replies:** 2\
**Last updated:** [December 6, 2008, 7:31pm UTC](https://www.ruby-forum.com/t/please-help-newb-observe-field/152721 "2008-12-06T19:31:44Z")

</div>

thanks everyone, I am using an autocomplete text field with associations following ryan bates rails cast #102. What i would like is when I autocomplete a customer name for their “customer address” to show up in an ed…

---

## [A quick ground up kit for Ruby on Rails](https://www.ruby-forum.com/t/a-quick-ground-up-kit-for-ruby-on-rails/142496)

<div class="topic-metadata">

**Author:** [@abhinavvaid](https://www.ruby-forum.com/u/abhinavvaid)\
**Replies:** 2\
**Last updated:** [December 6, 2008, 5:32pm UTC](https://www.ruby-forum.com/t/a-quick-ground-up-kit-for-ruby-on-rails/142496 "2008-12-06T17:32:25Z")

</div>

Guys, I am relatively very new to Ruby almost a veteran as an automation engineer. Lately we have been using some open source tools which my current employer mandated to use and we started. Now in the middle of the pr…

---

## [Add contact in facebook and MySpace using external website](https://www.ruby-forum.com/t/add-contact-in-facebook-and-myspace-using-external-website/154940)

<div class="topic-metadata">

**Author:** [@Puran](https://www.ruby-forum.com/u/Puran)\
**Replies:** 1\
**Last updated:** [December 6, 2008, 4:52pm UTC](https://www.ruby-forum.com/t/add-contact-in-facebook-and-myspace-using-external-website/154940 "2008-12-06T16:52:01Z")

</div>

Hi there, I would like to add contacts from my application to directly in my facebook and myspace friends list using ruby on rails. If any one has any idea, kindly suggest or send me sample code at removed\_email\_addr…

---

## [Nil object problem in Rails 2.0.2](https://www.ruby-forum.com/t/nil-object-problem-in-rails-2-0-2/155030)

<div class="topic-metadata">

**Author:** [@den1jay](https://www.ruby-forum.com/u/den1jay)\
**Replies:** 1\
**Last updated:** [December 6, 2008, 4:39pm UTC](https://www.ruby-forum.com/t/nil-object-problem-in-rails-2-0-2/155030 "2008-12-06T16:39:09Z")

</div>

I think my problem is that Rails is not seeing the private method “def author\_age” that is holding the result of the query. Do I suppose to put this in the Controller and not in the model? How does the object @results …

---

## [Changing primary.. Rails/mysql](https://www.ruby-forum.com/t/changing-primary-rails-mysql/155003)

<div class="topic-metadata">

**Author:** [@den1jay](https://www.ruby-forum.com/u/den1jay)\
**Replies:** 4\
**Last updated:** [December 6, 2008, 4:30pm UTC](https://www.ruby-forum.com/t/changing-primary-rails-mysql/155003 "2008-12-06T16:30:56Z")

</div>

I am using Rails 2.0.2 with mysql database Migrate sets the primary key to id. Is it possible to change it to another column? If yes, how? Thanks for your help Cypray.

---

## [Problem in number\_helper.rb?](https://www.ruby-forum.com/t/problem-in-number-helper-rb/155027)

<div class="topic-metadata">

**Author:** [@esox\_ch](https://www.ruby-forum.com/u/esox_ch)\
**Replies:** 0\
**Last updated:** [December 6, 2008, 3:04pm UTC](https://www.ruby-forum.com/t/problem-in-number-helper-rb/155027 "2008-12-06T15:04:55Z")

</div>

Hello, Today I noticed that the number\_to\_currency helper didn’t work anymore (it just returned the numeric value, without any currency). I tracked down the error and saw that editing line 89 ( number\_to\_currency met…

---

## [Question About Rails.cache and find method](https://www.ruby-forum.com/t/question-about-rails-cache-and-find-method/154975)

<div class="topic-metadata">

**Author:** [@johnk](https://www.ruby-forum.com/u/johnk)\
**Replies:** 1\
**Last updated:** [December 6, 2008, 3:03pm UTC](https://www.ruby-forum.com/t/question-about-rails-cache-and-find-method/154975 "2008-12-06T15:03:45Z")

</div>

The DB load on my site is getting really high so it is time for me to cache common queries that are being called 1000s of times an hour where the results are not changing. So for instance on my city model I do the fol…

---

## [Replicating Form Behaviour in Functional Test](https://www.ruby-forum.com/t/replicating-form-behaviour-in-functional-test/154951)

<div class="topic-metadata">

**Author:** [@adam](https://www.ruby-forum.com/u/adam)\
**Replies:** 4\
**Last updated:** [December 6, 2008, 2:34pm UTC](https://www.ruby-forum.com/t/replicating-form-behaviour-in-functional-test/154951 "2008-12-06T14:34:52Z")

</div>

Hi, I’m really struggling getting a controller test to pass while the form that uses the method operates correctly. I would really welcome a second pair of eyes to help me find out what I’m missing. The test def te…

---

## [One controller+5 forms(stages)](https://www.ruby-forum.com/t/one-controller-5-forms-stages/154923)

<div class="topic-metadata">

**Author:** [@rbalaji](https://www.ruby-forum.com/u/rbalaji)\
**Replies:** 2\
**Last updated:** [December 6, 2008, 12:54pm UTC](https://www.ruby-forum.com/t/one-controller-5-forms-stages/154923 "2008-12-06T12:54:40Z")

</div>

Hi Im using one controller+ 5 forms(5 stages). and i used the code but ony two form data stored in databases.give any suggestion def wizard if params\[:stage\].nil? … elsif params\[:stage\].to\_i == 1 … elsif params\[…

---

## [Berkeley on Rails](https://www.ruby-forum.com/t/berkeley-on-rails/155021)

<div class="topic-metadata">

**Author:** [@Arthur\_Klepchukov](https://www.ruby-forum.com/u/Arthur_Klepchukov)\
**Replies:** 0\
**Last updated:** [December 6, 2008, 11:21am UTC](https://www.ruby-forum.com/t/berkeley-on-rails/155021 "2008-12-06T11:21:36Z")

</div>

How Berkeley has contributed to entrepreneurship via Ruby on Rails http://startupatberkeley.com/2008/12/06/berkeley-on-rails/

---

## [Do you version control your "doc/plugins" directory?](https://www.ruby-forum.com/t/do-you-version-control-your-doc-plugins-directory/155006)

<div class="topic-metadata">

**Author:** [@greg](https://www.ruby-forum.com/u/greg)\
**Replies:** 1\
**Last updated:** [December 6, 2008, 6:21am UTC](https://www.ruby-forum.com/t/do-you-version-control-your-doc-plugins-directory/155006 "2008-12-06T06:21:33Z")

</div>

do you version control your “doc/plugins” directory? Is one supposed to be able to re-generate this from the plugins? (I don’t see a

---

## [How to associate one model from 2 models](https://www.ruby-forum.com/t/how-to-associate-one-model-from-2-models/154895)

<div class="topic-metadata">

**Author:** [@rgagnon](https://www.ruby-forum.com/u/rgagnon)\
**Replies:** 4\
**Last updated:** [December 6, 2008, 3:00am UTC](https://www.ruby-forum.com/t/how-to-associate-one-model-from-2-models/154895 "2008-12-06T03:00:46Z")

</div>

I know, I have probably a wrong design. Just need your point of view on that. Here is Police has many products Police has many transactions Products has many transactions I need to get a transaction with the combi…

---

## [Files with .fs extension in ruby on rails application](https://www.ruby-forum.com/t/files-with-fs-extension-in-ruby-on-rails-application/153138)

<div class="topic-metadata">

**Author:** [@rpm](https://www.ruby-forum.com/u/rpm)\
**Replies:** 2\
**Last updated:** [December 6, 2008, 2:51am UTC](https://www.ruby-forum.com/t/files-with-fs-extension-in-ruby-on-rails-application/153138 "2008-12-06T02:51:57Z")

</div>

I am using Spiceworks, an application made with Ruby on Rails. It has some files with .fs extension but i donÂ´t know what are this files and with wich tools are generated. Â¿Could someone say me something about it? I…

---

## [Page views counter](https://www.ruby-forum.com/t/page-views-counter/154999)

<div class="topic-metadata">

**Author:** [@petan](https://www.ruby-forum.com/u/petan)\
**Replies:** 1\
**Last updated:** [December 6, 2008, 12:24am UTC](https://www.ruby-forum.com/t/page-views-counter/154999 "2008-12-06T00:24:18Z")

</div>

Hi all, I’ve made a really simple page views counter. def show @post = Post.find… addcount = @post.views += 1 @post.update\_attribute “views”, addcount end Its working fine, but if someone hold the F5 key, it keeps…

---

## [Tzinfo\_timezone plugin - Object::TimeZone not defined](https://www.ruby-forum.com/t/tzinfo-timezone-plugin-object-timezone-not-defined/154905)

<div class="topic-metadata">

**Author:** [@shantanu-uab](https://www.ruby-forum.com/u/shantanu-uab)\
**Replies:** 2\
**Last updated:** [December 5, 2008, 11:06pm UTC](https://www.ruby-forum.com/t/tzinfo-timezone-plugin-object-timezone-not-defined/154905 "2008-12-05T23:06:47Z")

</div>

I am trying to get my rails project working on a new machine. I am using OpenSuse 10.3 and following steps were performed, installed rubygems installed Rails (1.x) using Suse repository - it didn’t have latest versio…

---

## [Test:clone\_structure problems with Postgres](https://www.ruby-forum.com/t/test-clone-structure-problems-with-postgres/154992)

<div class="topic-metadata">

**Author:** [@doug](https://www.ruby-forum.com/u/doug)\
**Replies:** 0\
**Last updated:** [December 5, 2008, 10:49pm UTC](https://www.ruby-forum.com/t/test-clone-structure-problems-with-postgres/154992 "2008-12-05T22:49:22Z")

</div>

(in C:/projects/books/TheatreTickets) \*\* Invoke db:test:clone\_structure (first\_time) \*\* Invoke db:structure:dump (first\_time) \*\* Invoke environment (first\_time) \*\* Execute environment \*\* Execute db:structure:dump \*…

---

## [REST, Nested Routes and Best Practices](https://www.ruby-forum.com/t/rest-nested-routes-and-best-practices/154973)

<div class="topic-metadata">

**Author:** [@bmgreeley](https://www.ruby-forum.com/u/bmgreeley)\
**Replies:** 2\
**Last updated:** [December 5, 2008, 10:37pm UTC](https://www.ruby-forum.com/t/rest-nested-routes-and-best-practices/154973 "2008-12-05T22:37:40Z")

</div>

Hi everyone, I am trying to strictly adhere to REST and I have a few code organization questions. My database tables are as follows: USERS GROUPS GROUP\_USERS EVENTS EVENT\_USERS The relationships are as follows: …

---

## [Problem during validation](https://www.ruby-forum.com/t/problem-during-validation/154960)

<div class="topic-metadata">

**Author:** [@Werner\_L](https://www.ruby-forum.com/u/Werner_L)\
**Replies:** 2\
**Last updated:** [December 5, 2008, 10:34pm UTC](https://www.ruby-forum.com/t/problem-during-validation/154960 "2008-12-05T22:34:07Z")

</div>

Hi…I need some advice: A formular which includes 3 partials The partial will be chosen by userinput stored in a session Controller: def new @booking = Booking.new @booking\_partial = partial\_choice(session\[:pre\]\[:fa…

---

## [How to set the focus to a specified field in a form](https://www.ruby-forum.com/t/how-to-set-the-focus-to-a-specified-field-in-a-form/154907)

<div class="topic-metadata">

**Author:** [@oldbug](https://www.ruby-forum.com/u/oldbug)\
**Replies:** 7\
**Last updated:** [December 5, 2008, 6:42pm UTC](https://www.ruby-forum.com/t/how-to-set-the-focus-to-a-specified-field-in-a-form/154907 "2008-12-05T18:42:35Z")

</div>

This is probably a general HTML question, but I’ll ask it here anyway. Is there any way to set the focus to a specific field in a form generated in a view? The little I’ve found on so far suggests that I need to add …

---

## [Problem with date](https://www.ruby-forum.com/t/problem-with-date/154964)

<div class="topic-metadata">

**Author:** [@chimorito](https://www.ruby-forum.com/u/chimorito)\
**Replies:** 4\
**Last updated:** [December 5, 2008, 6:21pm UTC](https://www.ruby-forum.com/t/problem-with-date/154964 "2008-12-05T18:21:07Z")

</div>

Hi, first and foremost sorry for my english. I have a pbroblem trying to built a search by data. My view is a simple text\_field: \<% form\_tag ({:action =\>‘buscadata’},{:class =\> ‘lgn’}) do%\> \<%= stylesheet\_link\_tag…

---

## [\[OT\] git help](https://www.ruby-forum.com/t/ot-git-help/154969)

<div class="topic-metadata">

**Author:** [@mauricio](https://www.ruby-forum.com/u/mauricio)\
**Replies:** 0\
**Last updated:** [December 5, 2008, 5:49pm UTC](https://www.ruby-forum.com/t/ot-git-help/154969 "2008-12-05T17:49:50Z")

</div>

Hi, I’m having a weird problem using git around here (yeah, i know this isn’t a git list, but maybe someone can help me here). I’ve followed this tutorial to get a remote branch to work and track it → But it just …

---

## [Help passing attributes](https://www.ruby-forum.com/t/help-passing-attributes/154881)

<div class="topic-metadata">

**Author:** [@srj](https://www.ruby-forum.com/u/srj)\
**Replies:** 3\
**Last updated:** [December 5, 2008, 5:49pm UTC](https://www.ruby-forum.com/t/help-passing-attributes/154881 "2008-12-05T17:49:50Z")

</div>

I know this is a really basic and simple thing for Rails, but as a newbie, I am having trouble figuring it out . . . I have a home page with a register link which executes the register action and shows the first (of t…

---

## [Paypal integration with rails project](https://www.ruby-forum.com/t/paypal-integration-with-rails-project/154906)

<div class="topic-metadata">

**Author:** [@tuhin\_cse99](https://www.ruby-forum.com/u/tuhin_cse99)\
**Replies:** 3\
**Last updated:** [December 5, 2008, 5:41pm UTC](https://www.ruby-forum.com/t/paypal-integration-with-rails-project/154906 "2008-12-05T17:41:36Z")

</div>

Hello experts, In my rails project I have to integrate paypal payment system. This is my first project in which I have to integrate paypal. Please show me ways to do this as I have no idea. Thanks in advanced. Ami…

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

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