# Rails

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

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

---

## [Html into rhtml](https://www.ruby-forum.com/t/html-into-rhtml/113592)

<div class="topic-metadata">

**Author:** [@demoversion](https://www.ruby-forum.com/u/demoversion)\
**Replies:** 2\
**Last updated:** [September 2, 2007, 4:45pm UTC](https://www.ruby-forum.com/t/html-into-rhtml/113592 "2007-09-02T16:45:09Z")

</div>

Hello, How to render a HTML file from RHTML file? When I used “render :file” i need to put HTML file to VIEWS folder, but i have static web-pages in “PUBLIC” folder? Thanks for replies

---

## [Using database for validation](https://www.ruby-forum.com/t/using-database-for-validation/113598)

<div class="topic-metadata">

**Author:** [@dnstevenson](https://www.ruby-forum.com/u/dnstevenson)\
**Replies:** 0\
**Last updated:** [September 2, 2007, 4:10pm UTC](https://www.ruby-forum.com/t/using-database-for-validation/113598 "2007-09-02T16:10:10Z")

</div>

I’ve been playing around with the idea of using the database for model validation where possible (instead of duplicating that validation in rails). My first approach to this was to catch exceptions from save/ create a…

---

## [:order based on an aggregate value?](https://www.ruby-forum.com/t/order-based-on-an-aggregate-value/113329)

<div class="topic-metadata">

**Author:** [@jacob](https://www.ruby-forum.com/u/jacob)\
**Replies:** 2\
**Last updated:** [September 2, 2007, 3:55pm UTC](https://www.ruby-forum.com/t/order-based-on-an-aggregate-value/113329 "2007-09-02T15:55:09Z")

</div>

Hi all, I’m building an app where each :referral has\_many :sales. In a list of all referrals, I’m displaying referral.date, referral.other\_details, and also referral.sales.count. I want to able to sort this list by t…

---

## [Question concerning deprec and capistrano](https://www.ruby-forum.com/t/question-concerning-deprec-and-capistrano/113596)

<div class="topic-metadata">

**Author:** [@gissmoh](https://www.ruby-forum.com/u/gissmoh)\
**Replies:** 0\
**Last updated:** [September 2, 2007, 3:25pm UTC](https://www.ruby-forum.com/t/question-concerning-deprec-and-capistrano/113596 "2007-09-02T15:25:06Z")

</div>

Server: Debian/Etch Development: MAC OS X 10.4 Development: gem install capistrano --include-dependencies OK gem install deprec --include-dependencies OK echo “require ‘deprec/recipes’” \>\> ./.caprc OK cap install\_r…

---

## [No route found to match "/search" with {:method=\>:get}](https://www.ruby-forum.com/t/no-route-found-to-match-search-with-method-get/113563)

<div class="topic-metadata">

**Author:** [@bashar](https://www.ruby-forum.com/u/bashar)\
**Replies:** 5\
**Last updated:** [September 2, 2007, 2:18pm UTC](https://www.ruby-forum.com/t/no-route-found-to-match-search-with-method-get/113563 "2007-09-02T14:18:56Z")

</div>

Hi, I have posted this before on another site with no help so I’m hoping I will get it here: am a bit new to the whole RoR thing and have faced small problem, but was not able to fine related answer to my specific co…

---

## [@content\_for\_layout or changing default fields on "new" page](https://www.ruby-forum.com/t/content-for-layout-or-changing-default-fields-on-new-page/113539)

<div class="topic-metadata">

**Author:** [@Artur\_Kaminski](https://www.ruby-forum.com/u/Artur_Kaminski)\
**Replies:** 2\
**Last updated:** [September 2, 2007, 1:58pm UTC](https://www.ruby-forum.com/t/content-for-layout-or-changing-default-fields-on-new-page/113539 "2007-09-02T13:58:55Z")

</div>

Hi all, I test my small Rails apps using SQLite3, but I think the problem appeares in every type of database. . When I create table and scaffolding apps, a HTML view is based on columns types. Everything is OK until…

---

## [Getting JSON from the body of a POST](https://www.ruby-forum.com/t/getting-json-from-the-body-of-a-post/113570)

<div class="topic-metadata">

**Author:** [@markh](https://www.ruby-forum.com/u/markh)\
**Replies:** 2\
**Last updated:** [September 2, 2007, 1:26pm UTC](https://www.ruby-forum.com/t/getting-json-from-the-body-of-a-post/113570 "2007-09-02T13:26:06Z")

</div>

I have a Flash application that is sending JSON data to a Rails app. I want to be able to read the JSON from the controller. Does anyone know where I can go to figure this out? I’ve Google’d around but can only fin…

---

## [Associating (or scoping) information with currently logged i](https://www.ruby-forum.com/t/associating-or-scoping-information-with-currently-logged-i/113579)

<div class="topic-metadata">

**Author:** [@gberz3](https://www.ruby-forum.com/u/gberz3)\
**Replies:** 1\
**Last updated:** [September 2, 2007, 1:04pm UTC](https://www.ruby-forum.com/t/associating-or-scoping-information-with-currently-logged-i/113579 "2007-09-02T13:04:50Z")

</div>

Hi All, I’m currently developing a multi-user/multi-company invoice/billing application in Rails. I haven’t implemented any kind of scoping because I can’t figure out the most intelligent mechanism by which to do it…

---

## [No route found to match "/search" with {:method=\>:get}](https://www.ruby-forum.com/t/no-route-found-to-match-search-with-method-get/113313)

<div class="topic-metadata">

**Author:** [@bashar](https://www.ruby-forum.com/u/bashar)\
**Replies:** 2\
**Last updated:** [September 2, 2007, 12:56pm UTC](https://www.ruby-forum.com/t/no-route-found-to-match-search-with-method-get/113313 "2007-09-02T12:56:50Z")

</div>

Hi, I am a bit new to the whole RoR thing and have faced small problem, but was not able to fine related answer to my specific condition. I am writing an application called site which I want to be the default root ap…

---

## [Lost connection to MySQL server during query](https://www.ruby-forum.com/t/lost-connection-to-mysql-server-during-query/113575)

<div class="topic-metadata">

**Author:** [@jose](https://www.ruby-forum.com/u/jose)\
**Replies:** 1\
**Last updated:** [September 2, 2007, 12:55pm UTC](https://www.ruby-forum.com/t/lost-connection-to-mysql-server-during-query/113575 "2007-09-02T12:55:06Z")

</div>

How do I configure Rails and MySQL to eliminate these messages? “Mysql::Error: Lost connection to MySQL server during query:” They occur about 1 in every 20 connections. Jose

---

## [Ferret for professionals](https://www.ruby-forum.com/t/ferret-for-professionals/113587)

<div class="topic-metadata">

**Author:** [@demoversion](https://www.ruby-forum.com/u/demoversion)\
**Replies:** 1\
**Last updated:** [September 2, 2007, 12:53pm UTC](https://www.ruby-forum.com/t/ferret-for-professionals/113587 "2007-09-02T12:53:07Z")

</div>

Hello, I’m trying to setup ferret search engine(what i did successfully for searching english phrases, words) But i doesn’t work for UTF-8 symbols!!! I tried to find the solution for this problem: i add to envirom…

---

## [Building a calendar of events - not trivial](https://www.ruby-forum.com/t/building-a-calendar-of-events-not-trivial/113584)

<div class="topic-metadata">

**Author:** [@ozozoz](https://www.ruby-forum.com/u/ozozoz)\
**Replies:** 0\
**Last updated:** [September 2, 2007, 10:12am UTC](https://www.ruby-forum.com/t/building-a-calendar-of-events-not-trivial/113584 "2007-09-02T10:12:34Z")

</div>

I wanted to build a calendar of events, record when they happen and where and cost and some details, and publish for people to see. I also wanted to allow a small group to login and confirm their attendance, and later…

---

## [Textdriven worst hosting i ever seen](https://www.ruby-forum.com/t/textdriven-worst-hosting-i-ever-seen/110619)

<div class="topic-metadata">

**Author:** [@gorter9](https://www.ruby-forum.com/u/gorter9)\
**Replies:** 10\
**Last updated:** [September 2, 2007, 9:21am UTC](https://www.ruby-forum.com/t/textdriven-worst-hosting-i-ever-seen/110619 "2007-09-02T09:21:27Z")

</div>

Somebody tolds me that textdriven is a very good hosting company so i get an account for one year at textdriven Maybe it was a good hosting company in the past but for now it’s a problem hosting company. The only goo…

---

## [Unit test failing](https://www.ruby-forum.com/t/unit-test-failing/113573)

<div class="topic-metadata">

**Author:** [@dnstevenson](https://www.ruby-forum.com/u/dnstevenson)\
**Replies:** 4\
**Last updated:** [September 2, 2007, 6:26am UTC](https://www.ruby-forum.com/t/unit-test-failing/113573 "2007-09-02T06:26:20Z")

</div>

I have unit tests set up with “self.use\_transactional\_fixtures = true”, so each test should roll back. Run individually, all my tests succeed. But running “rake test:units”, I get the below error in 5 test cases. I’m…

---

## [What is the URL to view my first rails app under Apache?](https://www.ruby-forum.com/t/what-is-the-url-to-view-my-first-rails-app-under-apache/113534)

<div class="topic-metadata">

**Author:** [@foolishbrat](https://www.ruby-forum.com/u/foolishbrat)\
**Replies:** 5\
**Last updated:** [September 2, 2007, 4:32am UTC](https://www.ruby-forum.com/t/what-is-the-url-to-view-my-first-rails-app-under-apache/113534 "2007-09-02T04:32:15Z")

</div>

Dear expert, I have succesfully created an initial app with Ruby with the following step: \[ewijaya@defiant library\]$ pwd /home/ewijaya/public\_html/MyRuby/library \[ewijaya@defiant library\]$ ruby script/server =\> Boo…

---

## [Javascript\_include\_tag :defaults \<-- How to include my stuff](https://www.ruby-forum.com/t/javascript-include-tag-defaults-how-to-include-my-stuff/113577)

<div class="topic-metadata">

**Author:** [@jose](https://www.ruby-forum.com/u/jose)\
**Replies:** 2\
**Last updated:** [September 2, 2007, 4:27am UTC](https://www.ruby-forum.com/t/javascript-include-tag-defaults-how-to-include-my-stuff/113577 "2007-09-02T04:27:15Z")

</div>

I want to include my JSS files in javascript\_include\_tag(:defaults). How do I tweak the :defaults? Jose

---

## [Accessing this.parentNode in RJS?](https://www.ruby-forum.com/t/accessing-this-parentnode-in-rjs/113571)

<div class="topic-metadata">

**Author:** [@chirag](https://www.ruby-forum.com/u/chirag)\
**Replies:** 0\
**Last updated:** [September 2, 2007, 2:49am UTC](https://www.ruby-forum.com/t/accessing-this-parentnode-in-rjs/113571 "2007-09-02T02:49:07Z")

</div>

Does anyone know how I can do this Javascript command with RJS? this.parentNode.className = ‘selsec’; This is what my AJAX call looks like in my view (which will invoke load\_chart.rjs) \<%= link\_to\_remote “Ajax Magic”…

---

## [Code reuse with rails (ex ASP.NET developer having trouble)](https://www.ruby-forum.com/t/code-reuse-with-rails-ex-asp-net-developer-having-trouble/113567)

<div class="topic-metadata">

**Author:** [@rick](https://www.ruby-forum.com/u/rick)\
**Replies:** 3\
**Last updated:** [September 2, 2007, 2:09am UTC](https://www.ruby-forum.com/t/code-reuse-with-rails-ex-asp-net-developer-having-trouble/113567 "2007-09-02T02:09:05Z")

</div>

Hi, I’m converting a few of my existing websites from ASP.NET to Ruby on Rails, but I’m having a problem getting my head a round code re-use in ROR. For example, the site I am currently attempting to convert has dif…

---

## [Newbie question: what does string\[:symbol\] mean?](https://www.ruby-forum.com/t/newbie-question-what-does-string-symbol-mean/113569)

<div class="topic-metadata">

**Author:** [@wawaloo](https://www.ruby-forum.com/u/wawaloo)\
**Replies:** 3\
**Last updated:** [September 2, 2007, 1:01am UTC](https://www.ruby-forum.com/t/newbie-question-what-does-string-symbol-mean/113569 "2007-09-02T01:01:02Z")

</div>

I found this in many rails source codes: string\[:symbol\] 'Some string'\[:some\_symbol'\] Can someone tell me what it stands for? Thks

---

## [Rails + Amazon](https://www.ruby-forum.com/t/rails-amazon/113466)

<div class="topic-metadata">

**Author:** [@RSElliott\_M](https://www.ruby-forum.com/u/RSElliott_M)\
**Replies:** 2\
**Last updated:** [September 2, 2007, 12:49am UTC](https://www.ruby-forum.com/t/rails-amazon/113466 "2007-09-02T00:49:27Z")

</div>

I’m trying to develop a Facebook application in Rails that allows users to look up certain products on Amazon. I know Amazon has Amazon Web Services, and I thought this would give me a clue as to how to proceed, but …

---

## [Using file\_column data in IMG tag](https://www.ruby-forum.com/t/using-file-column-data-in-img-tag/113566)

<div class="topic-metadata">

**Author:** [@bchodo](https://www.ruby-forum.com/u/bchodo)\
**Replies:** 0\
**Last updated:** [September 1, 2007, 11:03pm UTC](https://www.ruby-forum.com/t/using-file-column-data-in-img-tag/113566 "2007-09-01T23:03:35Z")

</div>

When I use file\_column to upload an image, it seems that the correct filename is saved in the database. But, when building a page from a record that contains links to the image, I get the following url when I try to u…

---

## [Lost session with file upload](https://www.ruby-forum.com/t/lost-session-with-file-upload/113449)

<div class="topic-metadata">

**Author:** [@Long](https://www.ruby-forum.com/u/Long)\
**Replies:** 5\
**Last updated:** [September 1, 2007, 10:32pm UTC](https://www.ruby-forum.com/t/lost-session-with-file-upload/113449 "2007-09-01T22:32:50Z")

</div>

I’ve search this group for reports of this problem but didn’t find anything useful. I am doing the following with plain vanilla Rails 1.1.6 running WEBrick. View: Upload photo Controller: def post\_photo se…

---

## [You have a nil object when you didn't expect it!](https://www.ruby-forum.com/t/you-have-a-nil-object-when-you-didnt-expect-it/113524)

<div class="topic-metadata">

**Author:** [@Kedron](https://www.ruby-forum.com/u/Kedron)\
**Replies:** 4\
**Last updated:** [September 1, 2007, 10:06pm UTC](https://www.ruby-forum.com/t/you-have-a-nil-object-when-you-didnt-expect-it/113524 "2007-09-01T22:06:23Z")

</div>

I’ve got a list of members in a sidebar using the code below. It works great for the list page, but when I edit or add a new member I get “You have a nil object when you didn’t expect it!” - I have a hunch this is jus…

---

## [Again search engine question](https://www.ruby-forum.com/t/again-search-engine-question/113507)

<div class="topic-metadata">

**Author:** [@demoversion](https://www.ruby-forum.com/u/demoversion)\
**Replies:** 3\
**Last updated:** [September 1, 2007, 9:51pm UTC](https://www.ruby-forum.com/t/again-search-engine-question/113507 "2007-09-01T21:51:47Z")

</div>

Hello, who can tell me how i make a search engine that satisfy following requiments: support for UTF-8 search by part of word, example: dem\* \<- returns demo, demon, demor… UTF-8 search ignoring case sensitive symbols…

---

## [A layout for each action](https://www.ruby-forum.com/t/a-layout-for-each-action/87683)

<div class="topic-metadata">

**Author:** [@mr\_brownstone](https://www.ruby-forum.com/u/mr_brownstone)\
**Replies:** 3\
**Last updated:** [September 1, 2007, 9:39pm UTC](https://www.ruby-forum.com/t/a-layout-for-each-action/87683 "2007-09-01T21:39:02Z")

</div>

How I make for using a layout for each action in a controller: examplo def show layout ‘show’ bla bla bla bla end def list layout ‘list’ bla bla bla bla end

---

## [Need help with sessions](https://www.ruby-forum.com/t/need-help-with-sessions/113559)

<div class="topic-metadata">

**Author:** [@shybe](https://www.ruby-forum.com/u/shybe)\
**Replies:** 3\
**Last updated:** [September 1, 2007, 8:20pm UTC](https://www.ruby-forum.com/t/need-help-with-sessions/113559 "2007-09-01T20:20:40Z")

</div>

Ok, I need my users to fill in form hit a “continue” button, then be taken to a page were they can preview the content they just entered in the previous form. I know I need sessions and cookies to make this happen, bu…

---

## [Accessing controllers from models](https://www.ruby-forum.com/t/accessing-controllers-from-models/113557)

<div class="topic-metadata">

**Author:** [@ahmad](https://www.ruby-forum.com/u/ahmad)\
**Replies:** 2\
**Last updated:** [September 1, 2007, 7:33pm UTC](https://www.ruby-forum.com/t/accessing-controllers-from-models/113557 "2007-09-01T19:33:04Z")

</div>

Hello, In my controllers, I have a method called ‘current\_user’. I want to make it automatic that when a new ActiveRecord object is created and saved the current user id in the current controller is saved with the obj…

---

## [Run migration from with rails project](https://www.ruby-forum.com/t/run-migration-from-with-rails-project/113506)

<div class="topic-metadata">

**Author:** [@jngo](https://www.ruby-forum.com/u/jngo)\
**Replies:** 3\
**Last updated:** [September 1, 2007, 7:30pm UTC](https://www.ruby-forum.com/t/run-migration-from-with-rails-project/113506 "2007-09-01T19:30:34Z")

</div>

I want to dynamically create and populate databases on the fly, and I would like to know how you would go about running a migration from with the rails project. I was thinking of doing it either in a model, or shell…

---

## [Verifying existence of elements](https://www.ruby-forum.com/t/verifying-existence-of-elements/113488)

<div class="topic-metadata">

**Author:** [@josh](https://www.ruby-forum.com/u/josh)\
**Replies:** 3\
**Last updated:** [September 1, 2007, 7:20pm UTC](https://www.ruby-forum.com/t/verifying-existence-of-elements/113488 "2007-09-01T19:20:33Z")

</div>

My controller ends like this: render :update do |page| page.replace\_html 'someDiv', :partial =\> 'somePartial' end I need to edit this to verify that someDiv exists before I go replacing\_htmling it. I’m at a loss to…

---

## [Mongrel complaining =\> pids and not up-to-date](https://www.ruby-forum.com/t/mongrel-complaining-pids-and-not-up-to-date/113289)

<div class="topic-metadata">

**Author:** [@softf5ajivanet](https://www.ruby-forum.com/u/softf5ajivanet)\
**Replies:** 3\
**Last updated:** [September 1, 2007, 6:45pm UTC](https://www.ruby-forum.com/t/mongrel-complaining-pids-and-not-up-to-date/113289 "2007-09-01T18:45:08Z")

</div>

Hi, Iâ€™ve got a Ubuntu 6.04 slice with the mongrel + rails stack all fully loaded, used the automatic setup guide from slicehost to do it. However, little annoying problem, mongrel is always complaining at me that th…

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

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