# Rails

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

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

---

## [Same table, multiple DBs?](https://www.ruby-forum.com/t/same-table-multiple-dbs/169226)

<div class="topic-metadata">

**Author:** [@brian](https://www.ruby-forum.com/u/brian)\
**Replies:** 4\
**Last updated:** [June 1, 2009, 5:29am UTC](https://www.ruby-forum.com/t/same-table-multiple-dbs/169226 "2009-06-01T05:29:40Z")

</div>

I’m starting to think about how my application can scale if it needs to. This is all very premature - I don’t even have clear performance goals yet, much lest perf testing in place, so it may be unnecessary. However,…

---

## [Autocomplete fill in text fields](https://www.ruby-forum.com/t/autocomplete-fill-in-text-fields/169082)

<div class="topic-metadata">

**Author:** [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Replies:** 6\
**Last updated:** [June 1, 2009, 5:19am UTC](https://www.ruby-forum.com/t/autocomplete-fill-in-text-fields/169082 "2009-06-01T05:19:43Z")

</div>

If you have an autocomplete and you have several text fields that have the other columns from the db. How do you autocomplete on a box and when you select it it fills in the other text fields with the rest of the data…

---

## [Model structure based on unavailable data](https://www.ruby-forum.com/t/model-structure-based-on-unavailable-data/169224)

<div class="topic-metadata">

**Author:** [@brian](https://www.ruby-forum.com/u/brian)\
**Replies:** 6\
**Last updated:** [June 1, 2009, 5:19am UTC](https://www.ruby-forum.com/t/model-structure-based-on-unavailable-data/169224 "2009-06-01T05:19:42Z")

</div>

I’m writing a role-based security plugin for personal use in my apps. The plugin will attach some helper methods to my models automatically (when I run my new class method ‘acts\_as\_a\_foo’). Some of these methods have…

---

## [ActiveRecord changes Logger formatting](https://www.ruby-forum.com/t/activerecord-changes-logger-formatting/168696)

<div class="topic-metadata">

**Author:** [@robredford](https://www.ruby-forum.com/u/robredford)\
**Replies:** 3\
**Last updated:** [June 1, 2009, 4:43am UTC](https://www.ruby-forum.com/t/activerecord-changes-logger-formatting/168696 "2009-06-01T04:43:44Z")

</div>

Why does my Logger formatting change after I “require ‘active\_record’”? irb(main):001:0\> require ‘logger’ =\> true irb(main):002:0\> $logger = Logger::new STDOUT =\> #\<Logger:0xb7dd0a38 @formatter=nil, @default\_format…

---

## [Howto Overwrite existing Ruby Class via Rails app?](https://www.ruby-forum.com/t/howto-overwrite-existing-ruby-class-via-rails-app/169216)

<div class="topic-metadata">

**Author:** [@Jermaine](https://www.ruby-forum.com/u/Jermaine)\
**Replies:** 3\
**Last updated:** [June 1, 2009, 3:49am UTC](https://www.ruby-forum.com/t/howto-overwrite-existing-ruby-class-via-rails-app/169216 "2009-06-01T03:49:42Z")

</div>

Hello Everyone, in the 1.8/usr/lib/ruby/1.8/date/format.rb file there is the following code: class Date module Format # :nodoc: MONTHS = { 'january' =\> 1, 'february' =\> 2, 'march' =\> 3, 'april' =\> 4, ‘ma…

---

## [Rails Erb w/ setAttribute "onclick"](https://www.ruby-forum.com/t/rails-erb-w-setattribute-onclick/169204)

<div class="topic-metadata">

**Author:** [@mk27](https://www.ruby-forum.com/u/mk27)\
**Replies:** 7\
**Last updated:** [June 1, 2009, 1:09am UTC](https://www.ruby-forum.com/t/rails-erb-w-setattribute-onclick/169204 "2009-06-01T01:09:43Z")

</div>

I’m trying to do this in a .js header: tmp.setAttribute(“onclick”,’\<%= remote\_function(:update =\> “mainbody”, :url =\> { :contoller =\> :subject, :action =\> :new }) %\>’) I’ve fiddled with the syntax slightly (eg, ’ vs "…

---

## [ActiveRecord not as smart as I thought it would be? or is it me?](https://www.ruby-forum.com/t/activerecord-not-as-smart-as-i-thought-it-would-be-or-is-it-me/169199)

<div class="topic-metadata">

**Author:** [@pepe](https://www.ruby-forum.com/u/pepe)\
**Replies:** 4\
**Last updated:** [June 1, 2009, 12:05am UTC](https://www.ruby-forum.com/t/activerecord-not-as-smart-as-i-thought-it-would-be-or-is-it-me/169199 "2009-06-01T00:05:02Z")

</div>

Hello, I have been wrestling for a couple of days trying to make my application work with 2 different databases simultaneously. Finally got it running but I am a bit disappointed at what I needed to do in order to ma…

---

## [{ head: ok}?](https://www.ruby-forum.com/t/head-ok/169217)

<div class="topic-metadata">

**Author:** [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Replies:** 0\
**Last updated:** [May 31, 2009, 10:55pm UTC](https://www.ruby-forum.com/t/head-ok/169217 "2009-05-31T22:55:22Z")

</div>

I was looking at the advanced rails recipe for the errata. It has format.js { hedda: ok}. does this not send back a full response so you do not require an RJS file? Also I see that the application helper has the re…

---

## [Ruby enterprise + portable ubuntu on windows](https://www.ruby-forum.com/t/ruby-enterprise-portable-ubuntu-on-windows/169212)

<div class="topic-metadata">

**Author:** [@tornado](https://www.ruby-forum.com/u/tornado)\
**Replies:** 0\
**Last updated:** [May 31, 2009, 10:17pm UTC](https://www.ruby-forum.com/t/ruby-enterprise-portable-ubuntu-on-windows/169212 "2009-05-31T22:17:19Z")

</div>

Hi, Has anybody tried this out ??? -a

---

## [Catching missing translations](https://www.ruby-forum.com/t/catching-missing-translations/169207)

<div class="topic-metadata">

**Author:** [@arvias](https://www.ruby-forum.com/u/arvias)\
**Replies:** 0\
**Last updated:** [May 31, 2009, 9:08pm UTC](https://www.ruby-forum.com/t/catching-missing-translations/169207 "2009-05-31T21:08:45Z")

</div>

Hi. Is it possible to catch globally missing translations? I want to see if users arrive at a page without one or more translations, and receive via email the missing key string and page. – M.

---

## [Ar\_mailer intermittent SystemStackError](https://www.ruby-forum.com/t/ar-mailer-intermittent-systemstackerror/169206)

<div class="topic-metadata">

**Author:** [@LAB](https://www.ruby-forum.com/u/LAB)\
**Replies:** 0\
**Last updated:** [May 31, 2009, 9:01pm UTC](https://www.ruby-forum.com/t/ar-mailer-intermittent-systemstackerror/169206 "2009-05-31T21:01:42Z")

</div>

Hello! I am really hoping someone can help me figure this out. I am hitting this intermittent error. It doesn’t always happen when I am doing a delivery action, but it happens sometimes. Its not always against the…

---

## [Routing inspection](https://www.ruby-forum.com/t/routing-inspection/169187)

<div class="topic-metadata">

**Author:** [@satynos](https://www.ruby-forum.com/u/satynos)\
**Replies:** 2\
**Last updated:** [May 31, 2009, 7:27pm UTC](https://www.ruby-forum.com/t/routing-inspection/169187 "2009-05-31T19:27:38Z")

</div>

Is there any way possible to get the child paths given a path? I mean given the following routes: map.resources :users do |user| user.resources :articles … end If I give path = “users/1”, is there any way to get th…

---

## [Generating and authenticating by API keys](https://www.ruby-forum.com/t/generating-and-authenticating-by-api-keys/169154)

<div class="topic-metadata">

**Author:** [@chunkyslink](https://www.ruby-forum.com/u/chunkyslink)\
**Replies:** 2\
**Last updated:** [May 31, 2009, 7:27pm UTC](https://www.ruby-forum.com/t/generating-and-authenticating-by-api-keys/169154 "2009-05-31T19:27:24Z")

</div>

I’m trying to get my head round offering up an API for a RESTful app; is it just a matter of; adding an api\_key column to the resource on which incoming requests will made (the app has a User model but I think the A…

---

## [How to hook ActionController when plugin init in development mode?](https://www.ruby-forum.com/t/how-to-hook-actioncontroller-when-plugin-init-in-development-mode/168890)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 3\
**Last updated:** [May 31, 2009, 7:07pm UTC](https://www.ruby-forum.com/t/how-to-hook-actioncontroller-when-plugin-init-in-development-mode/168890 "2009-05-31T19:07:34Z")

</div>

Hi all~ I want to add some methods to ActionController. And I generate a plugin. Although this example looks like strange. init.rb require “ac\_plugin” ApplicationController.send(:include, AcPlugin) lib/ac\_plugin.rb …

---

## [\[HELP\] pagination w habtm association and authorization plugin](https://www.ruby-forum.com/t/help-pagination-w-habtm-association-and-authorization-plugin/169203)

<div class="topic-metadata">

**Author:** [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Replies:** 0\
**Last updated:** [May 31, 2009, 6:47pm UTC](https://www.ruby-forum.com/t/help-pagination-w-habtm-association-and-authorization-plugin/169203 "2009-05-31T18:47:39Z")

</div>

I am using the proven authorization plugin to defines roles for users, so I can get all groups where a user is ‘member’ @groups = current\_user.group\_memberships I have an habtm association between groups and events c…

---

## [Simple before filter rights/acl](https://www.ruby-forum.com/t/simple-before-filter-rights-acl/169201)

<div class="topic-metadata">

**Author:** [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Replies:** 0\
**Last updated:** [May 31, 2009, 6:24pm UTC](https://www.ruby-forum.com/t/simple-before-filter-rights-acl/169201 "2009-05-31T18:24:47Z")

</div>

In the past, I have used a solution of Rights/Roles/Users as outlined by Chad F. in his original Rails Recipes but this is different. I am dealing with a legacy application, written in PHP with users, passwords and se…

---

## [Shortcut to call js function](https://www.ruby-forum.com/t/shortcut-to-call-js-function/169130)

<div class="topic-metadata">

**Author:** [@mk27](https://www.ruby-forum.com/u/mk27)\
**Replies:** 19\
**Last updated:** [May 31, 2009, 5:18pm UTC](https://www.ruby-forum.com/t/shortcut-to-call-js-function/169130 "2009-05-31T17:18:03Z")

</div>

Is there a shortcut for this kind of thing: \<%if X=42%\> \<script type="text/javascript\> some\_funct() \<%end%\>

---

## [How to show dropdown list with selected value?](https://www.ruby-forum.com/t/how-to-show-dropdown-list-with-selected-value/168937)

<div class="topic-metadata">

**Author:** [@Mike75](https://www.ruby-forum.com/u/Mike75)\
**Replies:** 5\
**Last updated:** [May 31, 2009, 10:04am UTC](https://www.ruby-forum.com/t/how-to-show-dropdown-list-with-selected-value/168937 "2009-05-31T10:04:00Z")

</div>

hi… I’m having a problem with an editing view to show a dropdown list with selected value. my tables are as followed product table : id | Name | Price | Country\_id country table : id | CountryName on the product n…

---

## [Page object](https://www.ruby-forum.com/t/page-object/169186)

<div class="topic-metadata">

**Author:** [@matthew](https://www.ruby-forum.com/u/matthew)\
**Replies:** 2\
**Last updated:** [May 31, 2009, 9:43am UTC](https://www.ruby-forum.com/t/page-object/169186 "2009-05-31T09:43:26Z")

</div>

Hello, I’m new to the group, and still learning rails. I am a C++ programmer by trade, so I’m finding some of the rails semantics confusing. When I come accross a statement like this: \<%= link\_to\_function “clickme” d…

---

## [Problem with Custom Form Builder](https://www.ruby-forum.com/t/problem-with-custom-form-builder/169176)

<div class="topic-metadata">

**Author:** [@satynos](https://www.ruby-forum.com/u/satynos)\
**Replies:** 5\
**Last updated:** [May 31, 2009, 5:36am UTC](https://www.ruby-forum.com/t/problem-with-custom-form-builder/169176 "2009-05-31T05:36:56Z")

</div>

I created my custom form builder (which inherits rails built-in form builder) name spaced under my app module. I also assigned this form builder to be the default action view form builder in the environment.rb. When I…

---

## [Rails collection\_select syntax issue](https://www.ruby-forum.com/t/rails-collection-select-syntax-issue/169060)

<div class="topic-metadata">

**Author:** [@ReidO](https://www.ruby-forum.com/u/ReidO)\
**Replies:** 2\
**Last updated:** [May 31, 2009, 5:34am UTC](https://www.ruby-forum.com/t/rails-collection-select-syntax-issue/169060 "2009-05-31T05:34:34Z")

</div>

I’m trying to display unique counties listed in my database in select box for a property database. I’ve figured out how to do this, but now I can’t figure out how to access the selected value of the select. This mainl…

---

## [Mi browser no muestra el formato para captura desplegado](https://www.ruby-forum.com/t/mi-browser-no-muestra-el-formato-para-captura-desplegado/169135)

<div class="topic-metadata">

**Author:** [@josegalvan](https://www.ruby-forum.com/u/josegalvan)\
**Replies:** 4\
**Last updated:** [May 31, 2009, 5:34am UTC](https://www.ruby-forum.com/t/mi-browser-no-muestra-el-formato-para-captura-desplegado/169135 "2009-05-31T05:34:19Z")

</div>

Hola, Soy nuevo totalmente con ruby on rails…de hecho durante 15 a#os programe con un RAD que no maneja codigo asi que estoy intentando retomar este tipo de lenguajes nuevamente…y vaya que si han cambiando. Estoy sig…

---

## [Submit form without page refresh](https://www.ruby-forum.com/t/submit-form-without-page-refresh/169181)

<div class="topic-metadata">

**Author:** [@liyu](https://www.ruby-forum.com/u/liyu)\
**Replies:** 1\
**Last updated:** [May 30, 2009, 10:28pm UTC](https://www.ruby-forum.com/t/submit-form-without-page-refresh/169181 "2009-05-30T22:28:13Z")

</div>

I’m looking for an ajax script from submitting a form without page refresh. The script should have these abilities: Submit form without page refresh Display loading icon (or some text) while the script processing the …

---

## [Validates\_associated is unnecessary?](https://www.ruby-forum.com/t/validates-associated-is-unnecessary/169180)

<div class="topic-metadata">

**Author:** [@fipa](https://www.ruby-forum.com/u/fipa)\
**Replies:** 0\
**Last updated:** [May 30, 2009, 10:08pm UTC](https://www.ruby-forum.com/t/validates-associated-is-unnecessary/169180 "2009-05-30T22:08:33Z")

</div>

Hi, I have a strange problem. Using accepts\_nested\_attributes\_for, if I add on top of that the validates\_associated declaration, AR makes 1 SQL query based on the parent\_id (I use acts\_as\_list and acts\_as\_tree) for e…

---

## [How to transform data to database (translation -\> i18n)](https://www.ruby-forum.com/t/how-to-transform-data-to-database-translation-i18n/169177)

<div class="topic-metadata">

**Author:** [@Jermaine](https://www.ruby-forum.com/u/Jermaine)\
**Replies:** 0\
**Last updated:** [May 30, 2009, 9:12pm UTC](https://www.ruby-forum.com/t/how-to-transform-data-to-database-translation-i18n/169177 "2009-05-30T21:12:20Z")

</div>

Hi Everyone, I’m using I18n in my rails app and I’m very pleased about it. However, I’m now having problems posting Date objects to the database. The problem is that in my text field the date is represented in Dutch. …

---

## [Need help : How to render HTML inside of a JSON request](https://www.ruby-forum.com/t/need-help-how-to-render-html-inside-of-a-json-request/169166)

<div class="topic-metadata">

**Author:** [@RFine](https://www.ruby-forum.com/u/RFine)\
**Replies:** 3\
**Last updated:** [May 30, 2009, 8:18pm UTC](https://www.ruby-forum.com/t/need-help-how-to-render-html-inside-of-a-json-request/169166 "2009-05-30T20:18:36Z")

</div>

We have an app that is in production with Rails 2.1.2 and I’m about to upgrade to 2.3.2. However, I am having a problem with a number of AJAX calls and I could really use some help. The client will make an AJAX call…

---

## [Combine if and do in a single line?](https://www.ruby-forum.com/t/combine-if-and-do-in-a-single-line/168983)

<div class="topic-metadata">

**Author:** [@mgiorno](https://www.ruby-forum.com/u/mgiorno)\
**Replies:** 5\
**Last updated:** [May 30, 2009, 8:16pm UTC](https://www.ruby-forum.com/t/combine-if-and-do-in-a-single-line/168983 "2009-05-30T20:16:34Z")

</div>

Is there a way to combine if and do into a single line? items.each do |item| if current\_user.admin? #do stuff end Thanks!

---

## [Query on Ruby array](https://www.ruby-forum.com/t/query-on-ruby-array/168912)

<div class="topic-metadata">

**Author:** [@Vipin](https://www.ruby-forum.com/u/Vipin)\
**Replies:** 12\
**Last updated:** [May 30, 2009, 8:13pm UTC](https://www.ruby-forum.com/t/query-on-ruby-array/168912 "2009-05-30T20:13:04Z")

</div>

Looking for suggestions on following two queries. Query 1 Are the two following lines of code different in Ruby / Rails ( in a \*.html.erb) file. \<% if @forms.count != 0 %\> Vs. \<% if @forms.count %\> @forms is an…

---

## [Default form name in form\_for](https://www.ruby-forum.com/t/default-form-name-in-form-for/169168)

<div class="topic-metadata">

**Author:** [@JannaB](https://www.ruby-forum.com/u/JannaB)\
**Replies:** 3\
**Last updated:** [May 30, 2009, 8:11pm UTC](https://www.ruby-forum.com/t/default-form-name-in-form-for/169168 "2009-05-30T20:11:06Z")

</div>

Does anyone know the default name given to a form created with form\_for ? Thanks, JB

---

## [How to keep persistent socket connections?](https://www.ruby-forum.com/t/how-to-keep-persistent-socket-connections/168516)

<div class="topic-metadata">

**Author:** [@steveybaby](https://www.ruby-forum.com/u/steveybaby)\
**Replies:** 9\
**Last updated:** [May 30, 2009, 8:04pm UTC](https://www.ruby-forum.com/t/how-to-keep-persistent-socket-connections/168516 "2009-05-30T20:04:38Z")

</div>

Hello ruby experts! I’ve been working in Ruby on Rails for awhile now (like 3 months), I and have thoroughly enjoyed it thus far. But my team and I have come up against a problem that I don’t think Rails can address.…

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

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