# Rails

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

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

---

## [How to start backgroundrb server on server reboot?](https://www.ruby-forum.com/t/how-to-start-backgroundrb-server-on-server-reboot/175163)

<div class="topic-metadata">

**Author:** [@san2821](https://www.ruby-forum.com/u/san2821)\
**Replies:** 2\
**Last updated:** [September 9, 2009, 1:46pm UTC](https://www.ruby-forum.com/t/how-to-start-backgroundrb-server-on-server-reboot/175163 "2009-09-09T13:46:35Z")

</div>

Hello How do i start backgroundrb server on server reboot ?? Thanks, Sandip Ruby on Rails Developer

---

## [Traversing nested ActiveRecord associations](https://www.ruby-forum.com/t/traversing-nested-activerecord-associations/226048)

<div class="topic-metadata">

**Author:** [@steven\_noble](https://www.ruby-forum.com/u/steven_noble)\
**Replies:** 2\
**Last updated:** [September 9, 2009, 1:35pm UTC](https://www.ruby-forum.com/t/traversing-nested-activerecord-associations/226048 "2009-09-09T13:35:28Z")

</div>

Let’s say… class Town \< ActiveRecord::Base has\_many :streets has\_many :houses, :through =\> :streets end class Street \< ActiveRecord::Base has\_many :houses end Then we can find individual streets and houses like t…

---

## [A basic collections/hash question](https://www.ruby-forum.com/t/a-basic-collections-hash-question/175181)

<div class="topic-metadata">

**Author:** [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Replies:** 3\
**Last updated:** [September 9, 2009, 1:26pm UTC](https://www.ruby-forum.com/t/a-basic-collections-hash-question/175181 "2009-09-09T13:26:41Z")

</div>

Hi, I give up trying. I need to ask this basic question about collections and hashes. I’m trying to do a batch update of records using XML: \<?xml version="1.0" encoding="UTF-8"?\> 111 111 111 Six 777 7…

---

## [Undefined method \`attr\_accessor' for #&lt;CustomersControl](https://www.ruby-forum.com/t/undefined-method-attr-accessor-for-lt-customerscontrol/175184)

<div class="topic-metadata">

**Author:** [@venkat\_ruby](https://www.ruby-forum.com/u/venkat_ruby)\
**Replies:** 4\
**Last updated:** [September 9, 2009, 1:08pm UTC](https://www.ruby-forum.com/t/undefined-method-attr-accessor-for-lt-customerscontrol/175184 "2009-09-09T13:08:32Z")

</div>

pleas help

---

## [Link\_to\_function variable increment](https://www.ruby-forum.com/t/link-to-function-variable-increment/175188)

<div class="topic-metadata">

**Author:** [@prabesh](https://www.ruby-forum.com/u/prabesh)\
**Replies:** 1\
**Last updated:** [September 9, 2009, 12:43pm UTC](https://www.ruby-forum.com/t/link-to-function-variable-increment/175188 "2009-09-09T12:43:56Z")

</div>

My view looks like this \<%count=0%\> \<%=link\_to\_function(“add another”, nil, :id =\> “more\_link”) do | page| page.insert\_html :bottom, ‘phone\_numbers’, add\_phone\_field(count +=1) end %\> add\_phone\_field is a helper …

---

## [Pass Ruby Array to Javasript Problem](https://www.ruby-forum.com/t/pass-ruby-array-to-javasript-problem/175182)

<div class="topic-metadata">

**Author:** [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Replies:** 7\
**Last updated:** [September 9, 2009, 11:50am UTC](https://www.ruby-forum.com/t/pass-ruby-array-to-javasript-problem/175182 "2009-09-09T11:50:32Z")

</div>

I have an array named weight\_array. Now i want to pass it to my javascript function abc… How can i pass it … May be a stupid question but did’nt find it by googling also … Currently i am doing like this. \<%= radio\_bu…

---

## [Strange behavior of rails - configuration ?, memory leak ?, system ? - error](https://www.ruby-forum.com/t/strange-behavior-of-rails-configuration-memory-leak-system-error/175176)

<div class="topic-metadata">

**Author:** [@marmolin](https://www.ruby-forum.com/u/marmolin)\
**Replies:** 2\
**Last updated:** [September 9, 2009, 10:38am UTC](https://www.ruby-forum.com/t/strange-behavior-of-rails-configuration-memory-leak-system-error/175176 "2009-09-09T10:38:03Z")

</div>

System problems with rails ? I have dveloped a rather complex rails application with many gems and pluginsg. It worked fine until some days ago, when I started to get some unredicatble errors that I cannot understand …

---

## [Problem in Getting Records one by one](https://www.ruby-forum.com/t/problem-in-getting-records-one-by-one/175174)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [September 9, 2009, 10:28am UTC](https://www.ruby-forum.com/t/problem-in-getting-records-one-by-one/175174 "2009-09-09T10:28:05Z")

</div>

Hi All, Here is the code I am using \<%= periodically\_call\_remote :update =\> “news\_div”, :url =\> { :action =\> “get\_news”}, :frequency =\> “5” %\> this is my method get\_news def get\_news @news = News.find(:all, :cond…

---

## [Understanding Associations with Multiple forms on a Page](https://www.ruby-forum.com/t/understanding-associations-with-multiple-forms-on-a-page/226049)

<div class="topic-metadata">

**Author:** [@bluehandtalking](https://www.ruby-forum.com/u/bluehandtalking)\
**Replies:** 0\
**Last updated:** [September 9, 2009, 9:42am UTC](https://www.ruby-forum.com/t/understanding-associations-with-multiple-forms-on-a-page/226049 "2009-09-09T09:42:26Z")

</div>

I have a project with the following relationships: class Project \< ActiveRecord::Base has\_one :photo has\_one :project\_detail class Photo \< ActiveRecord::Base belongs\_to :project, :accessible =\> true, :creator …

---

## [Setting up Ruby for use with MS SQL 2008](https://www.ruby-forum.com/t/setting-up-ruby-for-use-with-ms-sql-2008/175171)

<div class="topic-metadata">

**Author:** [@Gavtheman](https://www.ruby-forum.com/u/Gavtheman)\
**Replies:** 0\
**Last updated:** [September 9, 2009, 9:38am UTC](https://www.ruby-forum.com/t/setting-up-ruby-for-use-with-ms-sql-2008/175171 "2009-09-09T09:38:20Z")

</div>

Hello there! I am pretty close to being able to develop in rails, but I keep running into a problem with my setup in connecting to my MS SQL database. When I try to navigate to my control page, I get the “…but someth…

---

## [How to deal with this code?](https://www.ruby-forum.com/t/how-to-deal-with-this-code/175067)

<div class="topic-metadata">

**Author:** [@fireflyman](https://www.ruby-forum.com/u/fireflyman)\
**Replies:** 6\
**Last updated:** [September 9, 2009, 9:21am UTC](https://www.ruby-forum.com/t/how-to-deal-with-this-code/175067 "2009-09-09T09:21:56Z")

</div>

Hi,everyone Here is my model code—\> has\_many :authors\_books has\_many :authors, :through =\> :authors\_books belongs\_to :book belongs\_to :author has\_many :authors\_books has\_many :books, :through =\> :authors\_books I us…

---

## [Getting started with Rake - how do I copy a directory of assets to RAILS\_ROOT + "/public"](https://www.ruby-forum.com/t/getting-started-with-rake-how-do-i-copy-a-directory-of-assets-to-rails-root-public/175168)

<div class="topic-metadata">

**Author:** [@Kristian](https://www.ruby-forum.com/u/Kristian)\
**Replies:** 0\
**Last updated:** [September 9, 2009, 9:19am UTC](https://www.ruby-forum.com/t/getting-started-with-rake-how-do-i-copy-a-directory-of-assets-to-rails-root-public/175168 "2009-09-09T09:19:35Z")

</div>

I am just getting started with Rake. I am trying to create a rake task from within a rails plugin to copy some asset files (inside /assets in my plugin folder) to my rails application /public folder. How can I achieve…

---

## [Closing child window which has form and refreshing parent window](https://www.ruby-forum.com/t/closing-child-window-which-has-form-and-refreshing-parent-window/175166)

<div class="topic-metadata">

**Author:** [@akramwasim1234](https://www.ruby-forum.com/u/akramwasim1234)\
**Replies:** 0\
**Last updated:** [September 9, 2009, 9:08am UTC](https://www.ruby-forum.com/t/closing-child-window-which-has-form-and-refreshing-parent-window/175166 "2009-09-09T09:08:27Z")

</div>

hi all can anyone tell me on how to close the child which contains a form on submit and to refresh the parent window on the same

---

## [Pagination problem](https://www.ruby-forum.com/t/pagination-problem/175161)

<div class="topic-metadata">

**Author:** [@venkat\_ruby](https://www.ruby-forum.com/u/venkat_ruby)\
**Replies:** 5\
**Last updated:** [September 9, 2009, 8:53am UTC](https://www.ruby-forum.com/t/pagination-problem/175161 "2009-09-09T08:53:24Z")

</div>

Hi all, In my controller def index @customers = Customer.find(:all) @size = @customers.size @total\_pages = (@customers.size / $PER\_PAGE.to\_f).ceil end In index.html.erb Displays a customer list with pagination(E…

---

## [Link\_to current page](https://www.ruby-forum.com/t/link-to-current-page/175147)

<div class="topic-metadata">

**Author:** [@glex](https://www.ruby-forum.com/u/glex)\
**Replies:** 1\
**Last updated:** [September 9, 2009, 7:11am UTC](https://www.ruby-forum.com/t/link-to-current-page/175147 "2009-09-09T07:11:23Z")

</div>

I have a desktop version and a mobile version of my website. They have different views, and the one to use is determined automatically from the user agent string. However, I want to let the user switch from/to mobile …

---

## [Adding element](https://www.ruby-forum.com/t/adding-element/175158)

<div class="topic-metadata">

**Author:** [@prashanth\_hiremath](https://www.ruby-forum.com/u/prashanth_hiremath)\
**Replies:** 0\
**Last updated:** [September 9, 2009, 7:01am UTC](https://www.ruby-forum.com/t/adding-element/175158 "2009-09-09T07:01:26Z")

</div>

Hi this one i have an html Central Kolkat Eden Gardens (one of the most famous cricket stadiums in the world), Akashwani Bhavan, All India Radio building Indoor Stadium Fort William, the massive and impregnable B…

---

## [Why to\_xml on ActiveResource does not work well?](https://www.ruby-forum.com/t/why-to-xml-on-activeresource-does-not-work-well/175156)

<div class="topic-metadata">

**Author:** [@chamnap](https://www.ruby-forum.com/u/chamnap)\
**Replies:** 0\
**Last updated:** [September 9, 2009, 6:23am UTC](https://www.ruby-forum.com/t/why-to-xml-on-activeresource-does-not-work-well/175156 "2009-09-09T06:23:58Z")

</div>

I have several ActiveResource model in my project. There was so strange to me when I called to\_xml on my ActiveResource. The options that I passed to to\_xml like :only and :except doesn’t work at all. On ActiveRecord,…

---

## [Vertical slide](https://www.ruby-forum.com/t/vertical-slide/175113)

<div class="topic-metadata">

**Author:** [@puneetpandey85](https://www.ruby-forum.com/u/puneetpandey85)\
**Replies:** 2\
**Last updated:** [September 9, 2009, 6:15am UTC](https://www.ruby-forum.com/t/vertical-slide/175113 "2009-09-09T06:15:46Z")

</div>

Hi Everyone, I have a page where I would like to implement something like this: http://livingsocial.com/ I tried periodically\_call\_remote ajax helper, but it’s not working. It is giving me all the records at a time, …

---

## [Passing :methods to to\_json...sometimes](https://www.ruby-forum.com/t/passing-methods-to-to-json-sometimes/175087)

<div class="topic-metadata">

**Author:** [@kelleysislander](https://www.ruby-forum.com/u/kelleysislander)\
**Replies:** 1\
**Last updated:** [September 9, 2009, 5:24am UTC](https://www.ruby-forum.com/t/passing-methods-to-to-json-sometimes/175087 "2009-09-09T05:24:15Z")

</div>

In my application I have a class, Group, which has\_many GroupMemberships, and has\_many GroupMembers through :group\_memberships. My UI is almost purely JS, so my actions render everything in JSON, which I accomplish th…

---

## [Single quotes vs Colon --- What's the difference? (creating buttons)](https://www.ruby-forum.com/t/single-quotes-vs-colon-whats-the-difference-creating-buttons/175102)

<div class="topic-metadata">

**Author:** [@AlwaysCharging](https://www.ruby-forum.com/u/AlwaysCharging)\
**Replies:** 7\
**Last updated:** [September 9, 2009, 3:35am UTC](https://www.ruby-forum.com/t/single-quotes-vs-colon-whats-the-difference-creating-buttons/175102 "2009-09-09T03:35:58Z")

</div>

I’m programming my way through the Agile Web dev book (3rd) and there’s a part in there that’s causing a bit of confusion (p. 146 to be exact). You’re creating a button in a partial (named \_cart.html.erb) using the f…

---

## [Sessions in RailsSpace](https://www.ruby-forum.com/t/sessions-in-railsspace/175080)

<div class="topic-metadata">

**Author:** [@RubyonRails\_newbie](https://www.ruby-forum.com/u/RubyonRails_newbie)\
**Replies:** 1\
**Last updated:** [September 9, 2009, 3:04am UTC](https://www.ruby-forum.com/t/sessions-in-railsspace/175080 "2009-09-09T03:04:21Z")

</div>

Hi Everyone, I am now at the stage of logging a user in and monitoring the session. I have a new table, called sessions. Now there are a couple of areas that get amended before I see the error: 1 – in user\_control…

---

## [Custom Routes: Determining Action Named Based On Method](https://www.ruby-forum.com/t/custom-routes-determining-action-named-based-on-method/175151)

<div class="topic-metadata">

**Author:** [@MaggotChild](https://www.ruby-forum.com/u/MaggotChild)\
**Replies:** 0\
**Last updated:** [September 9, 2009, 1:01am UTC](https://www.ruby-forum.com/t/custom-routes-determining-action-named-based-on-method/175151 "2009-09-09T01:01:23Z")

</div>

Is it possible to create routes that have the same URL yet map to a different action based on the HTTP method (or pseudo method)? For example: map.resources :foo, :collection =\> { :purge =\> :get, :purge\_them =\> :pos…

---

## [\[JOB\] Ruby on Rails Developer, NYC | 80-100k](https://www.ruby-forum.com/t/job-ruby-on-rails-developer-nyc-80-100k/175145)

<div class="topic-metadata">

**Author:** [@OSS](https://www.ruby-forum.com/u/OSS)\
**Replies:** 0\
**Last updated:** [September 8, 2009, 11:33pm UTC](https://www.ruby-forum.com/t/job-ruby-on-rails-developer-nyc-80-100k/175145 "2009-09-08T23:33:34Z")

</div>

This is a full time, on-site, salaried position located in New York City. Locals only please. US Citizens, Green Card holders or EAD only please. REQUIRED: . 4+ years of server side web development experience . De…

---

## [Automatic Unit Testing and Code Analysis](https://www.ruby-forum.com/t/automatic-unit-testing-and-code-analysis/175142)

<div class="topic-metadata">

**Author:** [@phibo](https://www.ruby-forum.com/u/phibo)\
**Replies:** 1\
**Last updated:** [September 8, 2009, 11:20pm UTC](https://www.ruby-forum.com/t/automatic-unit-testing-and-code-analysis/175142 "2009-09-08T23:20:06Z")

</div>

Hi Does anybody know a good and powerful (yet simple of course) solution to automatically run rails test (unit and functional) let’s say every night? I’ve stumbled upon ‘CruiseControl’ (http:// cruisecontrol.sourcefo…

---

## [\[JOBS\] Qualcomm looking for seasoned Ruby on Rails developer](https://www.ruby-forum.com/t/jobs-qualcomm-looking-for-seasoned-ruby-on-rails-developer/175144)

<div class="topic-metadata">

**Author:** [@Jonathan\_Zhang](https://www.ruby-forum.com/u/Jonathan_Zhang)\
**Replies:** 0\
**Last updated:** [September 8, 2009, 11:18pm UTC](https://www.ruby-forum.com/t/jobs-qualcomm-looking-for-seasoned-ruby-on-rails-developer/175144 "2009-09-08T23:18:20Z")

</div>

Qualcomm Windows Mobile productivity team is looking for seasoned Ruby on Rails web application developer. Details can be seen from Qualcomm’s career site with requisition #G1840083. QUALCOMM CDMA Technologies (QCT) i…

---

## [How can I have the tests for my Rails app to be executed in a random order?](https://www.ruby-forum.com/t/how-can-i-have-the-tests-for-my-rails-app-to-be-executed-in-a-random-order/175115)

<div class="topic-metadata">

**Author:** [@Piero\_Di\_Bello](https://www.ruby-forum.com/u/Piero_Di_Bello)\
**Replies:** 7\
**Last updated:** [September 8, 2009, 10:20pm UTC](https://www.ruby-forum.com/t/how-can-i-have-the-tests-for-my-rails-app-to-be-executed-in-a-random-order/175115 "2009-09-08T22:20:59Z")

</div>

Hi How can I have the tests for my Rails app to be executed in a random order? Is there a simple solution using rake? I already posted my question to stackoverflow (http:// order-with-rake) but the few responses I g…

---

## [Partials in layouts?](https://www.ruby-forum.com/t/partials-in-layouts/175123)

<div class="topic-metadata">

**Author:** [@Dudebot](https://www.ruby-forum.com/u/Dudebot)\
**Replies:** 7\
**Last updated:** [September 8, 2009, 9:32pm UTC](https://www.ruby-forum.com/t/partials-in-layouts/175123 "2009-09-08T21:32:24Z")

</div>

Hi Gurus, how do I include a partial in my main layout? In views/layouts/application.html.erb I have ... \<%= render :partial =\> 'navbar\_tabs' %\> ... No matter where I put \_navbar\_tabs.html.erb (or renamed it to \_navb…

---

## [SQL injectioning](https://www.ruby-forum.com/t/sql-injectioning/175063)

<div class="topic-metadata">

**Author:** [@salil](https://www.ruby-forum.com/u/salil)\
**Replies:** 8\
**Last updated:** [September 8, 2009, 9:13pm UTC](https://www.ruby-forum.com/t/sql-injectioning/175063 "2009-09-08T21:13:42Z")

</div>

Hi All, What is the best way for the sql injectioning. I have problem with field named “name” that if we enter improper value like salil’s system get crashed. it gives error Mysql::Error: You have an error in your SQ…

---

## [Dynamic selects using rjs, page.replace\_html and on\_change](https://www.ruby-forum.com/t/dynamic-selects-using-rjs-page-replace-html-and-on-change/175138)

<div class="topic-metadata">

**Author:** [@Marcos\_MSSS\_ller](https://www.ruby-forum.com/u/Marcos_MSSS_ller)\
**Replies:** 1\
**Last updated:** [September 8, 2009, 8:39pm UTC](https://www.ruby-forum.com/t/dynamic-selects-using-rjs-page-replace-html-and-on-change/175138 "2009-09-08T20:39:44Z")

</div>

Hello everybody, I’m having a “simple” problem but is taking me a long time to understand and i’ll try to do a short and a full explanation about the problem… I’m quite beginner at rails and i’m facing a weird prob…

---

## [Help with Postgre, GROUP BY and ORDER BY](https://www.ruby-forum.com/t/help-with-postgre-group-by-and-order-by/175128)

<div class="topic-metadata">

**Author:** [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Replies:** 3\
**Last updated:** [September 8, 2009, 6:52pm UTC](https://www.ruby-forum.com/t/help-with-postgre-group-by-and-order-by/175128 "2009-09-08T18:52:28Z")

</div>

I want to obtain a array group by a field\_1 of a table but ordered by a field\_2 of a table, with one line of code. How can I do that using Postgre? I’ll appreciate any help

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

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