# Rails

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

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

---

## [Putting require on environment.rb vs on model/controller file](https://www.ruby-forum.com/t/putting-require-on-environment-rb-vs-on-model-controller-file/139416)

<div class="topic-metadata">

**Author:** [@Reynard](https://www.ruby-forum.com/u/Reynard)\
**Replies:** 1\
**Last updated:** [June 3, 2008, 10:27pm UTC](https://www.ruby-forum.com/t/putting-require-on-environment-rb-vs-on-model-controller-file/139416 "2008-06-03T22:27:58Z")

</div>

I’m just curious to know is there any benefit in putting require in environment.rb vs in model/controller file? I guess it’s always better to use it in environment.rb, even when only one controller requires it, since …

---

## [Combining associated models into a single xml or json object](https://www.ruby-forum.com/t/combining-associated-models-into-a-single-xml-or-json-object/139429)

<div class="topic-metadata">

**Author:** [@jkahn](https://www.ruby-forum.com/u/jkahn)\
**Replies:** 1\
**Last updated:** [June 3, 2008, 9:51pm UTC](https://www.ruby-forum.com/t/combining-associated-models-into-a-single-xml-or-json-object/139429 "2008-06-03T21:51:00Z")

</div>

It is clear how to return a model with model.to\_json or model.to\_xml. But how does one returned an object that with associations included? I thought the following would work but it seems to only return the base model. …

---

## [Map.root by domain?](https://www.ruby-forum.com/t/map-root-by-domain/139430)

<div class="topic-metadata">

**Author:** [@giga](https://www.ruby-forum.com/u/giga)\
**Replies:** 0\
**Last updated:** [June 3, 2008, 9:40pm UTC](https://www.ruby-forum.com/t/map-root-by-domain/139430 "2008-06-03T21:40:59Z")

</div>

Is it possible to set map.root by domain? If domain is: “domain1.com” then map.root :controller =\> “domain1” Else if domain is: “domain2.com” then map.root :controller =\> “domain2”

---

## [Field observer parameters](https://www.ruby-forum.com/t/field-observer-parameters/139215)

<div class="topic-metadata">

**Author:** [@mex23](https://www.ruby-forum.com/u/mex23)\
**Replies:** 5\
**Last updated:** [June 3, 2008, 8:53pm UTC](https://www.ruby-forum.com/t/field-observer-parameters/139215 "2008-06-03T20:53:40Z")

</div>

How do I pass more than one parameter through :with in a field observer? Here is my code: \< %= observe\_field(â€™article\_image\_idâ€™, :frequency =\> 0.25, :update =\> â€˜image\_previewâ€™, :url =\> { :action =\> :image\_pr…

---

## [Where not to host your RoR](https://www.ruby-forum.com/t/where-not-to-host-your-ror/139425)

<div class="topic-metadata">

**Author:** [@Laughlink](https://www.ruby-forum.com/u/Laughlink)\
**Replies:** 0\
**Last updated:** [June 3, 2008, 7:47pm UTC](https://www.ruby-forum.com/t/where-not-to-host-your-ror/139425 "2008-06-03T19:47:04Z")

</div>

I was recently looking for a hosting company for my new RoR Project and found www.host2day.com What a mess that turned out to be. Their Rails support (ha, ha) was way out of date, and when I realized that it was just …

---

## [Dynamic map/image showing property rental availability](https://www.ruby-forum.com/t/dynamic-map-image-showing-property-rental-availability/139307)

<div class="topic-metadata">

**Author:** [@gorgeoussoul](https://www.ruby-forum.com/u/gorgeoussoul)\
**Replies:** 13\
**Last updated:** [June 3, 2008, 7:26pm UTC](https://www.ruby-forum.com/t/dynamic-map-image-showing-property-rental-availability/139307 "2008-06-03T19:26:22Z")

</div>

I’m working on a rails app for a campground that rents cabins and tenting spots. I’d like to show a map or image of their property with cabin icons or boxes or something that change color based on whether or not they…

---

## [Newbie: Corrcet use of Render :Partial for forms in CRUD?](https://www.ruby-forum.com/t/newbie-corrcet-use-of-render-partial-for-forms-in-crud/139386)

<div class="topic-metadata">

**Author:** [@oshuma](https://www.ruby-forum.com/u/oshuma)\
**Replies:** 4\
**Last updated:** [June 3, 2008, 7:06pm UTC](https://www.ruby-forum.com/t/newbie-corrcet-use-of-render-partial-for-forms-in-crud/139386 "2008-06-03T19:06:55Z")

</div>

Cna anyone point e at any rails 2.0 tutorials on simple use of partials for forms in new and update CRUD operations? Ive got the following new.html.erb and \_user.html.erb partial First the contents of new.html.erb Ne…

---

## [Cannot find sqlserver adaptor for ActiveRecord](https://www.ruby-forum.com/t/cannot-find-sqlserver-adaptor-for-activerecord/139290)

<div class="topic-metadata">

**Author:** [@harleym](https://www.ruby-forum.com/u/harleym)\
**Replies:** 4\
**Last updated:** [June 3, 2008, 6:54pm UTC](https://www.ruby-forum.com/t/cannot-find-sqlserver-adaptor-for-activerecord/139290 "2008-06-03T18:54:58Z")

</div>

I have been trying to find the adtiverecord adaptor for MS SQL server and attempted to install with the command found on the http://wiki.rubyonrails.com/rails/pages/HowtoConnectToMicrosoftSQLServer wiki page: gem ins…

---

## [ActionWebService vs. fcgi](https://www.ruby-forum.com/t/actionwebservice-vs-fcgi/139420)

<div class="topic-metadata">

**Author:** [@sdetheridge](https://www.ruby-forum.com/u/sdetheridge)\
**Replies:** 0\
**Last updated:** [June 3, 2008, 6:30pm UTC](https://www.ruby-forum.com/t/actionwebservice-vs-fcgi/139420 "2008-06-03T18:30:04Z")

</div>

Hi, I have a rails-2 app that is using ActionWebService to talk to another application. I’m running my production app from apache, on Linux, using fcgi. It works fine in my development environment from webrick, and i…

---

## [Problem with attached log file using ActionMailer](https://www.ruby-forum.com/t/problem-with-attached-log-file-using-actionmailer/139417)

<div class="topic-metadata">

**Author:** [@cobra050](https://www.ruby-forum.com/u/cobra050)\
**Replies:** 0\
**Last updated:** [June 3, 2008, 6:20pm UTC](https://www.ruby-forum.com/t/problem-with-attached-log-file-using-actionmailer/139417 "2008-06-03T18:20:45Z")

</div>

Hi, all I am new to the Rails. I am trying to use ActioanMailer to send an email with a log file attached. However, after I received the email, I found out that the format in the log file is messed up. The orginal …

---

## [STI / Polymorphic Association Issue (or possible bug)?](https://www.ruby-forum.com/t/sti-polymorphic-association-issue-or-possible-bug/139369)

<div class="topic-metadata">

**Author:** [@Derek\_P](https://www.ruby-forum.com/u/Derek_P)\
**Replies:** 2\
**Last updated:** [June 3, 2008, 6:12pm UTC](https://www.ruby-forum.com/t/sti-polymorphic-association-issue-or-possible-bug/139369 "2008-06-03T18:12:18Z")

</div>

Hey everyone, I have been working on some code lately that seems to be yielding some unexpected results. Basically, I have a class that is using single table inheritance for basic subclassing, and I wanted the base cl…

---

## [After filter not working](https://www.ruby-forum.com/t/after-filter-not-working/139412)

<div class="topic-metadata">

**Author:** [@rubylicious](https://www.ruby-forum.com/u/rubylicious)\
**Replies:** 2\
**Last updated:** [June 3, 2008, 6:03pm UTC](https://www.ruby-forum.com/t/after-filter-not-working/139412 "2008-06-03T18:03:10Z")

</div>

I have a simple “after\_filter” that is supposed to remove “child” records from one table (folders\_tbl) when the parent is deleted from another table (courses\_tbl). It’s not working. The “course” gets destroyed but t…

---

## [WYM editor won't save](https://www.ruby-forum.com/t/wym-editor-wont-save/139384)

<div class="topic-metadata">

**Author:** [@mark](https://www.ruby-forum.com/u/mark)\
**Replies:** 1\
**Last updated:** [June 3, 2008, 5:29pm UTC](https://www.ruby-forum.com/t/wym-editor-wont-save/139384 "2008-06-03T17:29:04Z")

</div>

Trying to use the WYM on Rails plugin, but when using it pressing submit doesn’t save changes. Following the instructions on http://gorilla-webdesign.be/artikel/42-WYM+on+Rails Anyone else seen this? Any help would b…

---

## [Internationalise field in model (maybe with globalite)](https://www.ruby-forum.com/t/internationalise-field-in-model-maybe-with-globalite/136042)

<div class="topic-metadata">

**Author:** [@spross](https://www.ruby-forum.com/u/spross)\
**Replies:** 5\
**Last updated:** [June 3, 2008, 5:13pm UTC](https://www.ruby-forum.com/t/internationalise-field-in-model-maybe-with-globalite/136042 "2008-06-03T17:13:02Z")

</div>

hi all i have a model ‘user’ with a ‘country’ references field and a model ‘country’ with a ‘name’ field. now i’m trying to internationalise my application with globalite. but how do i solve that in my model? shall i…

---

## [Trying to show some code](https://www.ruby-forum.com/t/trying-to-show-some-code/139394)

<div class="topic-metadata">

**Author:** [@Rodrigo\_MuiSSSSo](https://www.ruby-forum.com/u/Rodrigo_MuiSSSSo)\
**Replies:** 2\
**Last updated:** [June 3, 2008, 5:07pm UTC](https://www.ruby-forum.com/t/trying-to-show-some-code/139394 "2008-06-03T17:07:08Z")

</div>

how can I avoid to interpret some code within a rhtml? I need to show in a web page, the form helper code I’m using, but the page is actually rendering it I tried using CDATA but it didn’t work (or don’t know how to…

---

## [Simplest Collection Select Tag Not Working](https://www.ruby-forum.com/t/simplest-collection-select-tag-not-working/139300)

<div class="topic-metadata">

**Author:** [@ror\_arch](https://www.ruby-forum.com/u/ror_arch)\
**Replies:** 3\
**Last updated:** [June 3, 2008, 4:34pm UTC](https://www.ruby-forum.com/t/simplest-collection-select-tag-not-working/139300 "2008-06-03T16:34:29Z")

</div>

Ok I just added a collection\_select tag to the form and attempted to save it but the value is not getting saved. This is what my mvc looks like : V (abbreviated edit.html): \<% form\_for :user, :url =\> user\_url(@user)…

---

## [Problem on server and not on local machine?](https://www.ruby-forum.com/t/problem-on-server-and-not-on-local-machine/139396)

<div class="topic-metadata">

**Author:** [@amanda](https://www.ruby-forum.com/u/amanda)\
**Replies:** 5\
**Last updated:** [June 3, 2008, 4:32pm UTC](https://www.ruby-forum.com/t/problem-on-server-and-not-on-local-machine/139396 "2008-06-03T16:32:17Z")

</div>

Okay so originally I had code that would allow a user to browse through all events on my site ( its a calendar site that people can submit events to) but now I’ve altered the code (by adding a global variable $calenda…

---

## [Custom counter cache](https://www.ruby-forum.com/t/custom-counter-cache/196698)

<div class="topic-metadata">

**Author:** [@Dmitrij\_S](https://www.ruby-forum.com/u/Dmitrij_S)\
**Replies:** 0\
**Last updated:** [June 3, 2008, 4:22pm UTC](https://www.ruby-forum.com/t/custom-counter-cache/196698 "2008-06-03T16:22:41Z")

</div>

class Category has\_many :tracks end class Track belongs\_to :category, :counter\_cache =\> true named\_scope :converted, :conditions =\> {:converted =\> true} named\_scope :active, :conditions =\> {:active =\> true} end I…

---

## [Custom counter cache](https://www.ruby-forum.com/t/custom-counter-cache/139405)

<div class="topic-metadata">

**Author:** [@Dmitrij\_S](https://www.ruby-forum.com/u/Dmitrij_S)\
**Replies:** 0\
**Last updated:** [June 3, 2008, 4:20pm UTC](https://www.ruby-forum.com/t/custom-counter-cache/139405 "2008-06-03T16:20:55Z")

</div>

class Category has\_many :tracks end class Track belongs\_to :category, :counter\_cache =\> true named\_scope :converted, :conditions =\> {:converted =\> true} named\_scope :active, :conditions =\> {:active =\> true} end I…

---

## [æ£€æŸ¥ä½ çš„ä»£ç æ³¨é‡Š](https://www.ruby-forum.com/t/ae-aey-a-cs-a-c-ae-e-s/139403)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [June 3, 2008, 4:01pm UTC](https://www.ruby-forum.com/t/ae-aey-a-cs-a-c-ae-e-s/139403 "2008-06-03T16:01:18Z")

</div>

¾ÝÍ³¼Æ£¬Ã¿¸ö³ÌÐò¿ª·¢ÈËÔ±µÄ¹¤×÷Ê±¼äÖÐ£¬Ö»ÓÐ²»µ½Ò»°ëµÄÊ±¼äÊÇ»¨ÔÚÐ´´úÂëÉÏ£¬ÆäËüµÄÊ±¼äÒ»²¿·ÖÊÇÔÚÔÄ¶Á±ðÈË»òÕß×Ô¼ºÒÔÇ°Ð´µÄ´úÂë£¬ÁíÒ»²¿·ÖÔòÊÇ»¨ÔÚ´úÂë µÄµ¼º½¶¨Î»ÉÏ¡£ ¾ÍÄÃÊ¹ÓÃeclipseµÄ¿ª·¢ÈËÔ±À´Ëµ£¬Äã¿ÉÄÜÖ»ÓÐÒ»²¿·ÖµÄÊ±¼äÊÇ¼¯ÖÐÔ…

---

## [Postgresql Arrays](https://www.ruby-forum.com/t/postgresql-arrays/139385)

<div class="topic-metadata">

**Author:** [@raam](https://www.ruby-forum.com/u/raam)\
**Replies:** 1\
**Last updated:** [June 3, 2008, 3:57pm UTC](https://www.ruby-forum.com/t/postgresql-arrays/139385 "2008-06-03T15:57:06Z")

</div>

Hi, I was wondering if anyone knows how ActiveRecord deals with Postgresql arrays? Specifically I am trying to figure out how to: a) Setup migration that creates the following table: CREATE TABLE sal\_emp ( name …

---

## [Auto\_complete problem?](https://www.ruby-forum.com/t/auto-complete-problem/196697)

<div class="topic-metadata">

**Author:** [@varunkumargoel](https://www.ruby-forum.com/u/varunkumargoel)\
**Replies:** 0\
**Last updated:** [June 3, 2008, 3:44pm UTC](https://www.ruby-forum.com/t/auto-complete-problem/196697 "2008-06-03T15:44:06Z")

</div>

Hi All, I am using Rails2.0.2 and i wanna use plugin auto\_complete with this but it’s not working fine i do’nt know the exact reason. Please give me some guideline that how to use auto\_complete with rails2.0.2 Previ…

---

## [PDF text search in rails](https://www.ruby-forum.com/t/pdf-text-search-in-rails/139351)

<div class="topic-metadata">

**Author:** [@ripan](https://www.ruby-forum.com/u/ripan)\
**Replies:** 3\
**Last updated:** [June 3, 2008, 3:26pm UTC](https://www.ruby-forum.com/t/pdf-text-search-in-rails/139351 "2008-06-03T15:26:48Z")

</div>

is there any plugin which could search in PDF documents. For example, user should be able to search for keywords in the PDF contents.

---

## [Spell checker in text area an text field](https://www.ruby-forum.com/t/spell-checker-in-text-area-an-text-field/139390)

<div class="topic-metadata">

**Author:** [@mrbless](https://www.ruby-forum.com/u/mrbless)\
**Replies:** 0\
**Last updated:** [June 3, 2008, 2:50pm UTC](https://www.ruby-forum.com/t/spell-checker-in-text-area-an-text-field/139390 "2008-06-03T14:50:38Z")

</div>

Plz anyone can give me a hint on how to do spelling check in text area and text field. If there is any plugin available then let me know guys. Fck editior is not what I am looking at. Help me

---

## [Leopard 10.5.3 breaks MacPort Rails](https://www.ruby-forum.com/t/leopard-10-5-3-breaks-macport-rails/139174)

<div class="topic-metadata">

**Author:** [@starmaerker](https://www.ruby-forum.com/u/starmaerker)\
**Replies:** 5\
**Last updated:** [June 3, 2008, 2:23pm UTC](https://www.ruby-forum.com/t/leopard-10-5-3-breaks-macport-rails/139174 "2008-06-03T14:23:57Z")

</div>

If you’ve installed Ruby and Rails using mac ports, be aware that installing 10.5.3 will install new versions of ruby and rails, which will hide your mac ports versions of rails. I had to go into /usr/bin and reset/de…

---

## [Rails 2.1 dont create references](https://www.ruby-forum.com/t/rails-2-1-dont-create-references/139320)

<div class="topic-metadata">

**Author:** [@raf4net](https://www.ruby-forum.com/u/raf4net)\
**Replies:** 2\
**Last updated:** [June 3, 2008, 2:22pm UTC](https://www.ruby-forum.com/t/rails-2-1-dont-create-references/139320 "2008-06-03T14:22:10Z")

</div>

Hi, I´m new in Rails framework, and i´m trying to create my first app. I create two tables: clients –id –name –phone keys –id –client\_id –value I use migration to create the relationship on tables: class Add…

---

## [Filter email form production-log?](https://www.ruby-forum.com/t/filter-email-form-production-log/139381)

<div class="topic-metadata">

**Author:** [@peter](https://www.ruby-forum.com/u/peter)\
**Replies:** 1\
**Last updated:** [June 3, 2008, 2:04pm UTC](https://www.ruby-forum.com/t/filter-email-form-production-log/139381 "2008-06-03T14:04:55Z")

</div>

Is it possible to filter the generated emails from the production-log? I’d like to remove them there, since there is some private-info in them…

---

## [Beginning Questions](https://www.ruby-forum.com/t/beginning-questions/139326)

<div class="topic-metadata">

**Author:** [@Paulo\_JSMatos](https://www.ruby-forum.com/u/Paulo_JSMatos)\
**Replies:** 4\
**Last updated:** [June 3, 2008, 12:55pm UTC](https://www.ruby-forum.com/t/beginning-questions/139326 "2008-06-03T12:55:40Z")

</div>

Dear all, I am new to rails and I am considering it for a project. What I would like to know (and I couldn’t straightforwardly find an answer to) is: is it possible to develop commercial web applications in which yo…

---

## [Setting of new generator in Netbeans 6.1](https://www.ruby-forum.com/t/setting-of-new-generator-in-netbeans-6-1/139363)

<div class="topic-metadata">

**Author:** [@DimaSiK](https://www.ruby-forum.com/u/DimaSiK)\
**Replies:** 1\
**Last updated:** [June 3, 2008, 11:59am UTC](https://www.ruby-forum.com/t/setting-of-new-generator-in-netbeans-6-1/139363 "2008-06-03T11:59:58Z")

</div>

Interests the generator of web services, can not find him in the list of generators, as he is named. Did actionwebservice set, it he???

---

## [Metaprogramming of controller methods](https://www.ruby-forum.com/t/metaprogramming-of-controller-methods/139379)

<div class="topic-metadata">

**Author:** [@indra](https://www.ruby-forum.com/u/indra)\
**Replies:** 0\
**Last updated:** [June 3, 2008, 11:41am UTC](https://www.ruby-forum.com/t/metaprogramming-of-controller-methods/139379 "2008-06-03T11:41:56Z")

</div>

Hello everyone, my rails project parses a text file during the starting of mongrel and creates a structure of ruby classes, methods and objects out of it. I then create a form with text\_field\_with\_auto\_completion dyna…

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

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