# Rails

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

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

---

## [Layouts for RJS templates?](https://www.ruby-forum.com/t/layouts-for-rjs-templates/92413)

<div class="topic-metadata">

**Author:** [@benjohnson](https://www.ruby-forum.com/u/benjohnson)\
**Replies:** 0\
**Last updated:** [April 19, 2007, 9:14am UTC](https://www.ruby-forum.com/t/layouts-for-rjs-templates/92413 "2007-04-19T09:14:08Z")

</div>

Is it possible to have layouts for RJS templates? The reason I ask is because I have code in my rjs templates the does the same thing as flash. If there are alerts in the flash hash then I display them by adding the h…

---

## [Dynamic ActiveRecord Associations](https://www.ruby-forum.com/t/dynamic-activerecord-associations/92412)

<div class="topic-metadata">

**Author:** [@cidol](https://www.ruby-forum.com/u/cidol)\
**Replies:** 0\
**Last updated:** [April 19, 2007, 9:06am UTC](https://www.ruby-forum.com/t/dynamic-activerecord-associations/92412 "2007-04-19T09:06:54Z")

</div>

I’m trying to make some dynamic AR associations. The clearest way I can think of to give an idea of what I’m looking to do is in a simple bit of code . ( with some schema-changing pseudo code ) add column “some\_clas…

---

## [Transaction question](https://www.ruby-forum.com/t/transaction-question/78140)

<div class="topic-metadata">

**Author:** [@jeff\_cole](https://www.ruby-forum.com/u/jeff_cole)\
**Replies:** 4\
**Last updated:** [April 19, 2007, 8:59am UTC](https://www.ruby-forum.com/t/transaction-question/78140 "2007-04-19T08:59:29Z")

</div>

How does one set up a transaction for multiple models? For example, how do you wrap the entire logic below in one transaction? #begin transaction for bar in foo.bars bar.something += 1 bar.save end foo.something …

---

## [Anyone able to get attachment\_fu (s3) working with OCS Solut](https://www.ruby-forum.com/t/anyone-able-to-get-attachment-fu-s3-working-with-ocs-solut/92407)

<div class="topic-metadata">

**Author:** [@jko170](https://www.ruby-forum.com/u/jko170)\
**Replies:** 0\
**Last updated:** [April 19, 2007, 7:08am UTC](https://www.ruby-forum.com/t/anyone-able-to-get-attachment-fu-s3-working-with-ocs-solut/92407 "2007-04-19T07:08:37Z")

</div>

Since OCS seems to be a popular host, I’m wondering if anyone has gotten attachment\_fu working on their shared enviroment using s3 as storage.

---

## [Datagrid with dhtmlxGrid](https://www.ruby-forum.com/t/datagrid-with-dhtmlxgrid/92312)

<div class="topic-metadata">

**Author:** [@Edgar\_O](https://www.ruby-forum.com/u/Edgar_O)\
**Replies:** 2\
**Last updated:** [April 19, 2007, 6:58am UTC](https://www.ruby-forum.com/t/datagrid-with-dhtmlxgrid/92312 "2007-04-19T06:58:22Z")

</div>

Hello i am trying to replace a desktop invoice system to a RoR sytem. The system just use the keyboard, i mean all is codebar, and enter, enter, enter…so on :P, well the thing is that i have been trying a lot of ways,…

---

## [How to escape ? in queries](https://www.ruby-forum.com/t/how-to-escape-in-queries/92396)

<div class="topic-metadata">

**Author:** [@Crazy](https://www.ruby-forum.com/u/Crazy)\
**Replies:** 1\
**Last updated:** [April 19, 2007, 2:58am UTC](https://www.ruby-forum.com/t/how-to-escape-in-queries/92396 "2007-04-19T02:58:21Z")

</div>

Hi, I have a simple table with id and name fields and which has some data which includes ? and ‘’ characters. If I try to find the rows which have these elements, the query fails with the following error: irb(main):0…

---

## [Beginner question - overwrite a value in a model](https://www.ruby-forum.com/t/beginner-question-overwrite-a-value-in-a-model/92384)

<div class="topic-metadata">

**Author:** [@Pascal\_F](https://www.ruby-forum.com/u/Pascal_F)\
**Replies:** 9\
**Last updated:** [April 19, 2007, 2:52am UTC](https://www.ruby-forum.com/t/beginner-question-overwrite-a-value-in-a-model/92384 "2007-04-19T02:52:21Z")

</div>

Hi, i am trying to overwrite a value in a model so that the new value is beeing saved in the database instead of the one the user typed into the form. this is my controller class Movie \< ActiveRecord::Base def sel…

---

## [Search by foreign key of foreign key](https://www.ruby-forum.com/t/search-by-foreign-key-of-foreign-key/92397)

<div class="topic-metadata">

**Author:** [@andrew](https://www.ruby-forum.com/u/andrew)\
**Replies:** 0\
**Last updated:** [April 19, 2007, 2:37am UTC](https://www.ruby-forum.com/t/search-by-foreign-key-of-foreign-key/92397 "2007-04-19T02:37:51Z")

</div>

Hi, So far I can sort by foreign key. @section\_pages, @sections = paginate :sections, :per\_page =\> 20, :order =\> sort, :include =\> :title But how do I sort by a foreign key of the foreign key. I have “sections” whic…

---

## [Best practice for modifying html header in templates](https://www.ruby-forum.com/t/best-practice-for-modifying-html-header-in-templates/92377)

<div class="topic-metadata">

**Author:** [@BallS\_Donald\_A\_Jr\_S](https://www.ruby-forum.com/u/BallS_Donald_A_Jr_S)\
**Replies:** 3\
**Last updated:** [April 19, 2007, 2:13am UTC](https://www.ruby-forum.com/t/best-practice-for-modifying-html-header-in-templates/92377 "2007-04-19T02:13:19Z")

</div>

In my rails app, I have a few resources whose header needs differ from the rest of the resources - they need extra javascript libraries, or different css stylesheets, or link to an RSS feed to which I’d also like to l…

---

## [Looking for feedback on my little domain model](https://www.ruby-forum.com/t/looking-for-feedback-on-my-little-domain-model/92269)

<div class="topic-metadata">

**Author:** [@chris\_johnson](https://www.ruby-forum.com/u/chris_johnson)\
**Replies:** 5\
**Last updated:** [April 19, 2007, 2:01am UTC](https://www.ruby-forum.com/t/looking-for-feedback-on-my-little-domain-model/92269 "2007-04-19T02:01:18Z")

</div>

Hi there. In my first rails app, a company can post multiple jobs (think job board). My first instinct would be to say: class Company \< ActiveRecord::Base has\_many :jobs end class Job \< ActiveRecord::Base belongs…

---

## [Getting started and webservices](https://www.ruby-forum.com/t/getting-started-and-webservices/92361)

<div class="topic-metadata">

**Author:** [@woodyuk](https://www.ruby-forum.com/u/woodyuk)\
**Replies:** 3\
**Last updated:** [April 19, 2007, 1:47am UTC](https://www.ruby-forum.com/t/getting-started-and-webservices/92361 "2007-04-19T01:47:18Z")

</div>

I am about to get started on my first ruby on rails project! However I want to make sure I can do everything I need. :slight\_smile: One item I am not sure about is webservices, its not something I have done before. …

---

## [Strange select\_date behavior or possible bug](https://www.ruby-forum.com/t/strange-select-date-behavior-or-possible-bug/92301)

<div class="topic-metadata">

**Author:** [@nielsene](https://www.ruby-forum.com/u/nielsene)\
**Replies:** 1\
**Last updated:** [April 19, 2007, 1:38am UTC](https://www.ruby-forum.com/t/strange-select-date-behavior-or-possible-bug/92301 "2007-04-19T01:38:18Z")

</div>

I’m using select\_date to display combo boxes with a date selection and I would like to change the selected date to be a day or a week from now. \<%= select\_date (Date.today + 1), :prefix =\> ‘start\_date’ %\> \<%= select\_…

---

## [YAML serialization](https://www.ruby-forum.com/t/yaml-serialization/92342)

<div class="topic-metadata">

**Author:** [@Florian\_ASSSSmann](https://www.ruby-forum.com/u/Florian_ASSSSmann)\
**Replies:** 1\
**Last updated:** [April 19, 2007, 1:36am UTC](https://www.ruby-forum.com/t/yaml-serialization/92342 "2007-04-19T01:36:17Z")

</div>

Hi, something wrong with ActiveRecord or YAML? They don’t put Strings into Quotes when it serializes. This gave me trouble when I serialized a String with a double colon (eg. ‘key: value’). After AR unserialized the …

---

## [Url\_for, form\_remote\_tag when rendered from an ajax referenc](https://www.ruby-forum.com/t/url-for-form-remote-tag-when-rendered-from-an-ajax-referenc/92392)

<div class="topic-metadata">

**Author:** [@stephen](https://www.ruby-forum.com/u/stephen)\
**Replies:** 0\
**Last updated:** [April 18, 2007, 11:40pm UTC](https://www.ruby-forum.com/t/url-for-form-remote-tag-when-rendered-from-an-ajax-referenc/92392 "2007-04-18T23:40:10Z")

</div>

I’ve done this a hundred times in other places in my code but it seems that this has suddenly broken. I can replicate it on my coworkers computer… I’m generating a form\_remote\_tag from within a partial as so: \<% fo…

---

## [Postgres-pr interface not found](https://www.ruby-forum.com/t/postgres-pr-interface-not-found/92387)

<div class="topic-metadata">

**Author:** [@blakeage](https://www.ruby-forum.com/u/blakeage)\
**Replies:** 1\
**Last updated:** [April 18, 2007, 11:33pm UTC](https://www.ruby-forum.com/t/postgres-pr-interface-not-found/92387 "2007-04-18T23:33:08Z")

</div>

I’ve installed the postgres-pr gem, and it is found using gem list v0.4.0. In my active record source, inside the postgresql\_adapter.rb file, I’ve changed line 7 from: require\_library\_or\_gem ‘postgres’ unless self.c…

---

## [Tell Rails which version of gems to use](https://www.ruby-forum.com/t/tell-rails-which-version-of-gems-to-use/92385)

<div class="topic-metadata">

**Author:** [@blakeage](https://www.ruby-forum.com/u/blakeage)\
**Replies:** 3\
**Last updated:** [April 18, 2007, 11:27pm UTC](https://www.ruby-forum.com/t/tell-rails-which-version-of-gems-to-use/92385 "2007-04-18T23:27:30Z")

</div>

How do you tell Rails what version of gems to use? For example, I have active record 1.14.2, 1.14.4, 1.15.1, and 1.15.3 installed. 1.15.1 is actually what is used when I browse the website. I want it to use 1.15.3… T…

---

## [Mail Queue Plugin](https://www.ruby-forum.com/t/mail-queue-plugin/92353)

<div class="topic-metadata">

**Author:** [@joep](https://www.ruby-forum.com/u/joep)\
**Replies:** 1\
**Last updated:** [April 18, 2007, 10:13pm UTC](https://www.ruby-forum.com/t/mail-queue-plugin/92353 "2007-04-18T22:13:40Z")

</div>

Hey, I’ve installed the mail-queue plugin but can’t find any instructions on how to use it. http://rubyforge.org/projects/mail-queue/ Does anyone have experience using this, or know of a place with good instructions…

---

## [Controller as subdomain](https://www.ruby-forum.com/t/controller-as-subdomain/92379)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [April 18, 2007, 9:27pm UTC](https://www.ruby-forum.com/t/controller-as-subdomain/92379 "2007-04-18T21:27:54Z")

</div>

Hello, How can I make a controller like a subdomain? Something like: from : localhost/controller/action to: controller.localhost/action Example: www.mysite.com/about www.mysite.com/contact where www and accou…

---

## [Ruby noob error](https://www.ruby-forum.com/t/ruby-noob-error/92376)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [April 18, 2007, 8:20pm UTC](https://www.ruby-forum.com/t/ruby-noob-error/92376 "2007-04-18T20:20:24Z")

</div>

Background I’m an absolute novice at all things development/code related. Masochisticly I’m trying to leanr Ruby on Rails. It took me an evening to work out that start\>run\>command launched something entirely different …

---

## [Has\_one vs. Belongs\_to?](https://www.ruby-forum.com/t/has-one-vs-belongs-to/92364)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 3\
**Last updated:** [April 18, 2007, 8:13pm UTC](https://www.ruby-forum.com/t/has-one-vs-belongs-to/92364 "2007-04-18T20:13:47Z")

</div>

I have clients, (table - model-controller) and I have plans (table - model - controller). A client can have several plans and a plan can only map to one client. I would assume that in the model for clients i need a …

---

## [Forms Generated from Structures](https://www.ruby-forum.com/t/forms-generated-from-structures/92375)

<div class="topic-metadata">

**Author:** [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Replies:** 0\
**Last updated:** [April 18, 2007, 8:03pm UTC](https://www.ruby-forum.com/t/forms-generated-from-structures/92375 "2007-04-18T20:03:52Z")

</div>

Greeting All: I am writing this in hopes of not reinventing the wheel. To me this seems like such a good idea that someone else has thought of and implemented it already. Problem. I am tracking a bunch of user conf…

---

## [Using rjs for preview of form b4 save? i think i know](https://www.ruby-forum.com/t/using-rjs-for-preview-of-form-b4-save-i-think-i-know/92370)

<div class="topic-metadata">

**Author:** [@mixplate](https://www.ruby-forum.com/u/mixplate)\
**Replies:** 0\
**Last updated:** [April 18, 2007, 8:01pm UTC](https://www.ruby-forum.com/t/using-rjs-for-preview-of-form-b4-save-i-think-i-know/92370 "2007-04-18T20:01:06Z")

</div>

hi, i have a form that i would like to show a preview of what the posted data would look like after the user presses the preview button… basically i would need to call the preview action, render the data to a partial,…

---

## [Collection\_select](https://www.ruby-forum.com/t/collection-select/92367)

<div class="topic-metadata">

**Author:** [@jason](https://www.ruby-forum.com/u/jason)\
**Replies:** 0\
**Last updated:** [April 18, 2007, 7:35pm UTC](https://www.ruby-forum.com/t/collection-select/92367 "2007-04-18T19:35:56Z")

</div>

I’m trying to populate a select box with a collection. I have the following code in my view: \<%= collection\_select(:heading, @headings, :id, :name, nil, {:onChange =\> ‘submit();’}) %\> But when I run it, I get an exc…

---

## [SOAP or XML-RPC](https://www.ruby-forum.com/t/soap-or-xml-rpc/92336)

<div class="topic-metadata">

**Author:** [@guest](https://www.ruby-forum.com/u/guest)\
**Replies:** 4\
**Last updated:** [April 18, 2007, 7:19pm UTC](https://www.ruby-forum.com/t/soap-or-xml-rpc/92336 "2007-04-18T19:19:45Z")

</div>

I need to use a third party web service and have a choice between a SOAP or XML-RPC interface. I have never used either and was wondering what people recommend in general and which is best supported/friendly with Rai…

---

## [Trouble understanding rhtml forms](https://www.ruby-forum.com/t/trouble-understanding-rhtml-forms/92318)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 2\
**Last updated:** [April 18, 2007, 7:03pm UTC](https://www.ruby-forum.com/t/trouble-understanding-rhtml-forms/92318 "2007-04-18T19:03:38Z")

</div>

i dont understand where the following points to the actual post method: \<% form\_tag do -%\> Email: \<%= text\_field\_tag 'email' %\> Password \<%= password\_field\_tag 'password' %\> Remember me: \<%= check\_box\_tag 'rememb…

---

## [Limiting results returned by find](https://www.ruby-forum.com/t/limiting-results-returned-by-find/92368)

<div class="topic-metadata">

**Author:** [@simon1](https://www.ruby-forum.com/u/simon1)\
**Replies:** 0\
**Last updated:** [April 18, 2007, 7:00pm UTC](https://www.ruby-forum.com/t/limiting-results-returned-by-find/92368 "2007-04-18T19:00:38Z")

</div>

Hi, I have the following line which returns a collection: @associated\_array = AssociatedAp.find(:all, :include =\> \[:nic\], :order =\> “date DESC”, :conditions =\> \[‘nics.mac = ?’, @nic\_mac\] ) Here @nic\_mac is a paramete…

---

## [Pinging a host](https://www.ruby-forum.com/t/pinging-a-host/92356)

<div class="topic-metadata">

**Author:** [@Raymond\_Ward](https://www.ruby-forum.com/u/Raymond_Ward)\
**Replies:** 2\
**Last updated:** [April 18, 2007, 6:50pm UTC](https://www.ruby-forum.com/t/pinging-a-host/92356 "2007-04-18T18:50:37Z")

</div>

Hello, I am working on an App and am trying to return a page with the status of a host (up/down). The host IP addresses are taken from a database and then pinged using ping.rb. The code works if typed in irb but wh…

---

## [How to connect and retrieve data from a MS SQL SERVER 2000 d](https://www.ruby-forum.com/t/how-to-connect-and-retrieve-data-from-a-ms-sql-server-2000-d/92340)

<div class="topic-metadata">

**Author:** [@jeremy](https://www.ruby-forum.com/u/jeremy)\
**Replies:** 4\
**Last updated:** [April 18, 2007, 4:53pm UTC](https://www.ruby-forum.com/t/how-to-connect-and-retrieve-data-from-a-ms-sql-server-2000-d/92340 "2007-04-18T16:53:53Z")

</div>

Good eveningHO HOIt’s 19:51 in China now. :slight\_smile: I’m new to Ruby on Rails. I wanna know how to connect to a MS SQL SERVER 2000 database. Can I use a T-SQL query in Ruby on Rails directly? If I can do it direct…

---

## [Problems with find(:all, :conditions)](https://www.ruby-forum.com/t/problems-with-find-all-conditions/92345)

<div class="topic-metadata">

**Author:** [@Cassiano\_R](https://www.ruby-forum.com/u/Cassiano_R)\
**Replies:** 1\
**Last updated:** [April 18, 2007, 3:48pm UTC](https://www.ruby-forum.com/t/problems-with-find-all-conditions/92345 "2007-04-18T15:48:19Z")

</div>

I need find all people with “type” in 2,3,4,5… so I wrote this find: Person.find(:all, :conditions =\> \[‘type in (?)’, “#{params\[:types\]}”\] and the params\[:types\] is an Array. ActiveRecord generate this SQL: select ……

---

## [Ajax Drog and Drop Sorting Frequency](https://www.ruby-forum.com/t/ajax-drog-and-drop-sorting-frequency/92346)

<div class="topic-metadata">

**Author:** [@karnirevuri](https://www.ruby-forum.com/u/karnirevuri)\
**Replies:** 0\
**Last updated:** [April 18, 2007, 3:42pm UTC](https://www.ruby-forum.com/t/ajax-drog-and-drop-sorting-frequency/92346 "2007-04-18T15:42:57Z")

</div>

Hi Friends, I am new to ROR.I have implemented sorting by Ajax drag and drop and interaction with database. Working fine but if i sort records rapidly, getting nil point exception. I am pasting the sortable list code…

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

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