# Rails

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

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

---

## [Where to put views for application controller?](https://www.ruby-forum.com/t/where-to-put-views-for-application-controller/103232)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 3\
**Last updated:** [May 3, 2007, 7:05pm UTC](https://www.ruby-forum.com/t/where-to-put-views-for-application-controller/103232 "2007-05-03T19:05:08Z")

</div>

hi, im pretty much a rails newbie, but i was wondering where the rhtml files go for the application controller? i.e. if i had some logic that needed to be performed on the document root of my website: (i.e. http://ww…

---

## [Health Care Professionals: EMR Project](https://www.ruby-forum.com/t/health-care-professionals-emr-project/103279)

<div class="topic-metadata">

**Author:** [@KRD](https://www.ruby-forum.com/u/KRD)\
**Replies:** 0\
**Last updated:** [May 3, 2007, 6:56pm UTC](https://www.ruby-forum.com/t/health-care-professionals-emr-project/103279 "2007-05-03T18:56:07Z")

</div>

Hello, I have started a project to created an open source electronic medical record. openEPRS will be an open source electronic medical record built on Ruby on Rails and MySQL. openEPRS will feature support for mult…

---

## [Shared Nested Resources](https://www.ruby-forum.com/t/shared-nested-resources/103183)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 4\
**Last updated:** [May 3, 2007, 6:54pm UTC](https://www.ruby-forum.com/t/shared-nested-resources/103183 "2007-05-03T18:54:06Z")

</div>

The skinny is that I’m attempting to add “Discussions” as resources under different resources (“Groups”, “Projects”, for example) and I’ve simply hit a roadblock (or two). Discussions are an association between the “d…

---

## [Acts\_as\_tree related question](https://www.ruby-forum.com/t/acts-as-tree-related-question/103181)

<div class="topic-metadata">

**Author:** [@crossblaim](https://www.ruby-forum.com/u/crossblaim)\
**Replies:** 3\
**Last updated:** [May 3, 2007, 6:24pm UTC](https://www.ruby-forum.com/t/acts-as-tree-related-question/103181 "2007-05-03T18:24:03Z")

</div>

hi, I’ve a normal Category model implemented with acts\_as\_tree (name, parent\_id) that has\_many :products (name, category\_id). What I’m asking for is a method to fetch every product that belongs fall into a particular…

---

## [Multiple Update Actions that are Relatively the same](https://www.ruby-forum.com/t/multiple-update-actions-that-are-relatively-the-same/103268)

<div class="topic-metadata">

**Author:** [@daveh](https://www.ruby-forum.com/u/daveh)\
**Replies:** 2\
**Last updated:** [May 3, 2007, 6:08pm UTC](https://www.ruby-forum.com/t/multiple-update-actions-that-are-relatively-the-same/103268 "2007-05-03T18:08:00Z")

</div>

Hi there, I have 2 actions that are rather identical: Put /account/you/update\_password def update\_password @user = current :user respond\_to do |format| if @user.update\_attributes(params\[:user\]) format.html {redirec…

---

## [Update\_element\_function + sortable\_element = how to update?](https://www.ruby-forum.com/t/update-element-function-sortable-element-how-to-update/103258)

<div class="topic-metadata">

**Author:** [@22marine](https://www.ruby-forum.com/u/22marine)\
**Replies:** 2\
**Last updated:** [May 3, 2007, 5:39pm UTC](https://www.ruby-forum.com/t/update-element-function-sortable-element-how-to-update/103258 "2007-05-03T17:39:31Z")

</div>

Hi. I’ve realised this example and it works great : http://demo.script.aculo.us/ajax/sortable\_elements But i want to add to the user the capability to add items to the sortable list. Here is my code : #############…

---

## [Problem in ROR](https://www.ruby-forum.com/t/problem-in-ror/103230)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 3\
**Last updated:** [May 3, 2007, 5:34pm UTC](https://www.ruby-forum.com/t/problem-in-ror/103230 "2007-05-03T17:34:56Z")

</div>

hi, while the time of executing ROR application I get the following problem. Because of this problem I am not able to continue with my project. Please any one help me. Application error Change this error message f…

---

## [Strange mysql performance](https://www.ruby-forum.com/t/strange-mysql-performance/103219)

<div class="topic-metadata">

**Author:** [@dawillis](https://www.ruby-forum.com/u/dawillis)\
**Replies:** 2\
**Last updated:** [May 3, 2007, 5:31pm UTC](https://www.ruby-forum.com/t/strange-mysql-performance/103219 "2007-05-03T17:31:54Z")

</div>

I have 3 boxes, each running Ubuntu Feisty. All of them are AMD64, one of them is in 32b mode, other two are 64b mode. All have the same filesystem type, and roughly the same hardware config. Each has the ruby mysql g…

---

## [Routing to a static resource in Mongrel](https://www.ruby-forum.com/t/routing-to-a-static-resource-in-mongrel/103216)

<div class="topic-metadata">

**Author:** [@weyus](https://www.ruby-forum.com/u/weyus)\
**Replies:** 2\
**Last updated:** [May 3, 2007, 5:31pm UTC](https://www.ruby-forum.com/t/routing-to-a-static-resource-in-mongrel/103216 "2007-05-03T17:31:35Z")

</div>

All, I would like to set up a route that causes a static “index.html” file (in the “public” directory) to be served on a request to an empty URL path (i.e. map.connect ‘’, …). Can I do that with Mongrel? Basically, …

---

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

<div class="topic-metadata">

**Author:** [@kane](https://www.ruby-forum.com/u/kane)\
**Replies:** 6\
**Last updated:** [May 3, 2007, 5:02pm UTC](https://www.ruby-forum.com/t/has-many-conversely/103252 "2007-05-03T17:02:50Z")

</div>

I have a very simple association: class User \< ActiveRecord::Base has\_and\_belongs\_to\_many :friends, :class\_name=\>“User”, :join\_table=\>“friends\_users”, :association\_foreign\_key=\>“friend\_id”, :foreign\_key=\>“user\_id” …

---

## [Toggling between readonly and writeable text\_field\_tag](https://www.ruby-forum.com/t/toggling-between-readonly-and-writeable-text-field-tag/103261)

<div class="topic-metadata">

**Author:** [@Javier\_CH](https://www.ruby-forum.com/u/Javier_CH)\
**Replies:** 0\
**Last updated:** [May 3, 2007, 4:44pm UTC](https://www.ruby-forum.com/t/toggling-between-readonly-and-writeable-text-field-tag/103261 "2007-05-03T16:44:47Z")

</div>

What is the opposite of page\[:text\_field\_tag\_dom\_id\].readonly = “true”? page\[:text\_field\_tag\_dom\_id\].readonly = “false” doesn’t seem to work…and .writeable doesn’t seem to exist.

---

## [Validate unique within date range?](https://www.ruby-forum.com/t/validate-unique-within-date-range/93230)

<div class="topic-metadata">

**Author:** [@mroutley](https://www.ruby-forum.com/u/mroutley)\
**Replies:** 2\
**Last updated:** [May 3, 2007, 4:11pm UTC](https://www.ruby-forum.com/t/validate-unique-within-date-range/93230 "2007-05-03T16:11:13Z")

</div>

I’m setting up a simple system for listing products and specials. I’m looking for a way to validate that only one special can exist per product per date range. For example, if a product is on sale from 2007-04-29 to 2…

---

## [StringIO to Tempfile?](https://www.ruby-forum.com/t/stringio-to-tempfile/103042)

<div class="topic-metadata">

**Author:** [@RSElliott\_M](https://www.ruby-forum.com/u/RSElliott_M)\
**Replies:** 8\
**Last updated:** [May 3, 2007, 2:56pm UTC](https://www.ruby-forum.com/t/stringio-to-tempfile/103042 "2007-05-03T14:56:28Z")

</div>

I recently discovered that uploaded files under ~20KB are used to create StringIO objects instead of Tempfile objects. This has a negative effect in my models: class Image \< Upload def get\_file\_info self\[:width\], s…

---

## [Undefined method \`subclasses' error](https://www.ruby-forum.com/t/undefined-method-subclasses-error/89836)

<div class="topic-metadata">

**Author:** [@bithai80](https://www.ruby-forum.com/u/bithai80)\
**Replies:** 1\
**Last updated:** [May 3, 2007, 2:39pm UTC](https://www.ruby-forum.com/t/undefined-method-subclasses-error/89836 "2007-05-03T14:39:46Z")

</div>

hi, I moved up from rails 1.1.6 to 1.2.3 and now i get this error: Processing ApplicationController#login (for 74.193.67.252 at 2007-03-22 18:04:47) \[GET\] Session ID: 3cf7c4e3edc74e0912bf74c9e309750a Parameters: {“ac…

---

## [Using polymorphism for tags](https://www.ruby-forum.com/t/using-polymorphism-for-tags/103213)

<div class="topic-metadata">

**Author:** [@patcito](https://www.ruby-forum.com/u/patcito)\
**Replies:** 2\
**Last updated:** [May 3, 2007, 2:20pm UTC](https://www.ruby-forum.com/t/using-polymorphism-for-tags/103213 "2007-05-03T14:20:11Z")

</div>

I have something like that: class Commercial \< ActiveRecord::Base belongs\_to :announcer has\_many :tags, :as=\> :taggable end class Announcer \< ActiveRecord::Base has\_many :commercials has\_many :tags, :as=\> :taggabl…

---

## [Help Needed with Routing Controller Modules](https://www.ruby-forum.com/t/help-needed-with-routing-controller-modules/103257)

<div class="topic-metadata">

**Author:** [@charl](https://www.ruby-forum.com/u/charl)\
**Replies:** 0\
**Last updated:** [May 3, 2007, 2:19pm UTC](https://www.ruby-forum.com/t/help-needed-with-routing-controller-modules/103257 "2007-05-03T14:19:11Z")

</div>

HI Please can someone help me with this routing issue. I’m using Controller modules to group controllers. e.g. ruby script/generate controller supplier::home etc. I have a default route setup: map.connect ‘supplier’…

---

## [Need javasrcipt help](https://www.ruby-forum.com/t/need-javasrcipt-help/103255)

<div class="topic-metadata">

**Author:** [@tuhin\_cse99](https://www.ruby-forum.com/u/tuhin_cse99)\
**Replies:** 0\
**Last updated:** [May 3, 2007, 2:13pm UTC](https://www.ruby-forum.com/t/need-javasrcipt-help/103255 "2007-05-03T14:13:29Z")

</div>

hi, I have two button in my Rails page. one is submit and other is delete. for submit button, I use: \<%= submit\_tag “submit” %\> In the case of delete button I place a ‘onclick’ javascript function to call my ‘set\_v…

---

## [Relationship between Tables](https://www.ruby-forum.com/t/relationship-between-tables/92875)

<div class="topic-metadata">

**Author:** [@Linus\_M](https://www.ruby-forum.com/u/Linus_M)\
**Replies:** 4\
**Last updated:** [May 3, 2007, 2:08pm UTC](https://www.ruby-forum.com/t/relationship-between-tables/92875 "2007-05-03T14:08:09Z")

</div>

Hello, how is it possible to specify a “has\_one” attribut in an one-to-many relationship? This code doesn’t work: class Order \< ActiveRecord::Base has\_and\_belongs\_to\_many :invoices has\_one :most\_recent\_invoice, :or…

---

## [Gather validates presence of from rails app](https://www.ruby-forum.com/t/gather-validates-presence-of-from-rails-app/103254)

<div class="topic-metadata">

**Author:** [@acras](https://www.ruby-forum.com/u/acras)\
**Replies:** 0\
**Last updated:** [May 3, 2007, 1:55pm UTC](https://www.ruby-forum.com/t/gather-validates-presence-of-from-rails-app/103254 "2007-05-03T13:55:06Z")

</div>

Hi, I’ve developed an app with Rails that has near 100 models. Now I have to list, for each model, wich attributes are required, ie those that has validate\_presence\_of. How can I do that? Thanx – Ricardo A. remov…

---

## [Rails urls](https://www.ruby-forum.com/t/rails-urls/103250)

<div class="topic-metadata">

**Author:** [@levent](https://www.ruby-forum.com/u/levent)\
**Replies:** 4\
**Last updated:** [May 3, 2007, 1:36pm UTC](https://www.ruby-forum.com/t/rails-urls/103250 "2007-05-03T13:36:23Z")

</div>

Our app dynamically publishes multiple sites for multiple clients but the urls they need are vastly different and I was wondering if rails routes could handle them dynamically somehow Right now we have a unique site\_c…

---

## [Using Oracle without sequences](https://www.ruby-forum.com/t/using-oracle-without-sequences/103248)

<div class="topic-metadata">

**Author:** [@boemitsu](https://www.ruby-forum.com/u/boemitsu)\
**Replies:** 0\
**Last updated:** [May 3, 2007, 11:34am UTC](https://www.ruby-forum.com/t/using-oracle-without-sequences/103248 "2007-05-03T11:34:30Z")

</div>

Hi all, I have to set the primary key myself and not use sequences in an Oracle schema In http://thread.gmane.org/gmane.comp.lang.ruby.rails/118516 someone writes, “Correct, that’s the expected/correct behavior – so…

---

## [Deploying on windows 2000 server](https://www.ruby-forum.com/t/deploying-on-windows-2000-server/103247)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [May 3, 2007, 11:05am UTC](https://www.ruby-forum.com/t/deploying-on-windows-2000-server/103247 "2007-05-03T11:05:28Z")

</div>

Posted this on the rubyonrails-deployment group (http:// groups.google.com/group/rubyonrails-deployment/browse\_thread/thread/ d5ef4f3525c3c39a), but figured it couldn’t hurt posting it here too. I’m not a windows user…

---

## [Render file](https://www.ruby-forum.com/t/render-file/103135)

<div class="topic-metadata">

**Author:** [@Zirael](https://www.ruby-forum.com/u/Zirael)\
**Replies:** 2\
**Last updated:** [May 3, 2007, 10:42am UTC](https://www.ruby-forum.com/t/render-file/103135 "2007-05-03T10:42:26Z")

</div>

Hi, I want to send file in the response, I found it’s possible with render method: def get\_file render :file =\> path, :content\_type =\> “application/x-unknown” end. But there is one problem, the default name of tha…

---

## [RESTful deleting a resource without a resource id](https://www.ruby-forum.com/t/restful-deleting-a-resource-without-a-resource-id/93102)

<div class="topic-metadata">

**Author:** [@mlangenberg](https://www.ruby-forum.com/u/mlangenberg)\
**Replies:** 6\
**Last updated:** [May 3, 2007, 10:29am UTC](https://www.ruby-forum.com/t/restful-deleting-a-resource-without-a-resource-id/93102 "2007-05-03T10:29:23Z")

</div>

In a situation where an Order has many Orderlines and an Item has many Orderlines, I want to call DELETE /orderlines/?order\_id=1&item\_id=1 however the REST restriction don’t allow this by default, right? When adding ‘…

---

## [Need help with file download control](https://www.ruby-forum.com/t/need-help-with-file-download-control/103241)

<div class="topic-metadata">

**Author:** [@Tom\_Lee](https://www.ruby-forum.com/u/Tom_Lee)\
**Replies:** 0\
**Last updated:** [May 3, 2007, 10:02am UTC](https://www.ruby-forum.com/t/need-help-with-file-download-control/103241 "2007-05-03T10:02:17Z")

</div>

hi guys! i want to realize the role control of file upload and download. it means someone upload a file and others must download it with certain role or password. i am now using file\_column but i donot how to contro…

---

## [Loop not rendering anything](https://www.ruby-forum.com/t/loop-not-rendering-anything/103226)

<div class="topic-metadata">

**Author:** [@dasch](https://www.ruby-forum.com/u/dasch)\
**Replies:** 1\
**Last updated:** [May 3, 2007, 9:46am UTC](https://www.ruby-forum.com/t/loop-not-rendering-anything/103226 "2007-05-03T09:46:11Z")

</div>

I have a database that is reading the “show\_times” from a column in my database table, but nothing is showing up. Is there some sort of syntax error here? I thought this was working fine yesterday… \<% @show\_times.each …

---

## [Submit a form from RJS](https://www.ruby-forum.com/t/submit-a-form-from-rjs/103238)

<div class="topic-metadata">

**Author:** [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Replies:** 0\
**Last updated:** [May 3, 2007, 9:33am UTC](https://www.ruby-forum.com/t/submit-a-form-from-rjs/103238 "2007-05-03T09:33:35Z")

</div>

I am submitting an Ajax form with form\_remote\_tag in my view \<% form\_remote\_tag( :url =\>{:action =\> ‘list’}, :html =\> {:id =\> ‘prop\_search\_form’, :name =\> “prop\_search\_form”} ) do %\> … \<% end %\> in my controller …

---

## [Configure server subdomains](https://www.ruby-forum.com/t/configure-server-subdomains/103204)

<div class="topic-metadata">

**Author:** [@adi](https://www.ruby-forum.com/u/adi)\
**Replies:** 6\
**Last updated:** [May 3, 2007, 7:48am UTC](https://www.ruby-forum.com/t/configure-server-subdomains/103204 "2007-05-03T07:48:55Z")

</div>

How can i configure a server to use apache, mysql, ruby on rails and to add how many accounts i wan’t but to give a subdomain not a port. thanks

---

## [Using a different layout for just one action in controller](https://www.ruby-forum.com/t/using-a-different-layout-for-just-one-action-in-controller/103186)

<div class="topic-metadata">

**Author:** [@jason](https://www.ruby-forum.com/u/jason)\
**Replies:** 8\
**Last updated:** [May 3, 2007, 6:50am UTC](https://www.ruby-forum.com/t/using-a-different-layout-for-just-one-action-in-controller/103186 "2007-05-03T06:50:52Z")

</div>

I have a controller where everything uses the same layout except for one action called view. I tried this at the top of the controller: layout “remote”, :only =\> \[:view\] layout “standard”, :except =\> \[:view\] This re…

---

## [Using the ActionView::Helpers::FormTagHelper and ActionView:](https://www.ruby-forum.com/t/using-the-actionview-formtaghelper-and-actionview/103227)

<div class="topic-metadata">

**Author:** [@mrnice](https://www.ruby-forum.com/u/mrnice)\
**Replies:** 0\
**Last updated:** [May 3, 2007, 4:53am UTC](https://www.ruby-forum.com/t/using-the-actionview-formtaghelper-and-actionview/103227 "2007-05-03T04:53:44Z")

</div>

Hi, I have a utility class (in the lib/media\_set/media.rb file in my ruby application) and in there, I would like to access the ActionView::Helpers::FormTagHelper.select\_tag and ActionView::Helpers::FormOptionsHelper…

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

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