# Rails

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

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

---

## [How to syntax highlight Rails 2.0 .html.erb files in Textmate/E-texteditor](https://www.ruby-forum.com/t/how-to-syntax-highlight-rails-2-0-html-erb-files-in-textmate-e-texteditor/116864)

<div class="topic-metadata">

**Author:** [@Jesper\_RSSSSnn-Jens](https://www.ruby-forum.com/u/Jesper_RSSSSnn-Jens)\
**Replies:** 5\
**Last updated:** [October 17, 2007, 4:44pm UTC](https://www.ruby-forum.com/t/how-to-syntax-highlight-rails-2-0-html-erb-files-in-textmate-e-texteditor/116864 "2007-10-17T16:44:07Z")

</div>

I’m using E-texteditor that reads and understand the macromates bundles just fine. But how do you set up your editor so that it correctly can identify .html.erb as “HTML (Rails)” in Textmate? It seems as the bundle i…

---

## [Why not \[\] as ActiveRecord::Base class method?](https://www.ruby-forum.com/t/why-not-as-activerecord-base-class-method/117201)

<div class="topic-metadata">

**Author:** [@adistarmid](https://www.ruby-forum.com/u/adistarmid)\
**Replies:** 3\
**Last updated:** [October 17, 2007, 4:25pm UTC](https://www.ruby-forum.com/t/why-not-as-activerecord-base-class-method/117201 "2007-10-17T16:25:27Z")

</div>

Here’s a little method module ActiveRecord class Base def self. find(id) end end end So you can write MyModel\[12\] as an equivalent to MyModle.find(12) Just a little sugar, nothing else really. Is anyone aware…

---

## [Controller plugin?](https://www.ruby-forum.com/t/controller-plugin/117432)

<div class="topic-metadata">

**Author:** [@tmac](https://www.ruby-forum.com/u/tmac)\
**Replies:** 8\
**Last updated:** [October 17, 2007, 3:57pm UTC](https://www.ruby-forum.com/t/controller-plugin/117432 "2007-10-17T15:57:52Z")

</div>

Do I understand correctly that you can’t write controller plugins? Of course “can’t” is a big word, what I’m really wondering is what the major stumbling blocks to doing so are? Am I missing something or wouldn’t this…

---

## [RJS doesn't work](https://www.ruby-forum.com/t/rjs-doesnt-work/117449)

<div class="topic-metadata">

**Author:** [@juan](https://www.ruby-forum.com/u/juan)\
**Replies:** 3\
**Last updated:** [October 17, 2007, 3:30pm UTC](https://www.ruby-forum.com/t/rjs-doesnt-work/117449 "2007-10-17T15:30:55Z")

</div>

Hi, When using an :update in a remote function it does work without problems. Removing it and adding instead a .rjs file to modify a part of the HTML doesn’t work. This is what receives the browser: Element.update(“…

---

## [\[OT\]Anybody using YUI Rich Text Editor](https://www.ruby-forum.com/t/ot-anybody-using-yui-rich-text-editor/117501)

<div class="topic-metadata">

**Author:** [@cwt137](https://www.ruby-forum.com/u/cwt137)\
**Replies:** 2\
**Last updated:** [October 17, 2007, 2:55pm UTC](https://www.ruby-forum.com/t/ot-anybody-using-yui-rich-text-editor/117501 "2007-10-17T14:55:09Z")

</div>

I’m currently using TinyMCE, but frustrated by the lack of support for Safari. Anybody tried it? Hated it? Loved it? Cheers Chris – Autopendium :: Stuff about old cars http://autopendium.com

---

## [Unicode character handling](https://www.ruby-forum.com/t/unicode-character-handling/116857)

<div class="topic-metadata">

**Author:** [@hitesh](https://www.ruby-forum.com/u/hitesh)\
**Replies:** 3\
**Last updated:** [October 17, 2007, 1:43pm UTC](https://www.ruby-forum.com/t/unicode-character-handling/116857 "2007-10-17T13:43:01Z")

</div>

Hi, I developing a web application using ruby on rails, apache 2.2.3 and Mysql. I want to handle the unicode characters(chinese, japanese etc.) in my application. I have made the necessary configuration in applicatio…

---

## [Domain specific controllers](https://www.ruby-forum.com/t/domain-specific-controllers/117499)

<div class="topic-metadata">

**Author:** [@johnlester](https://www.ruby-forum.com/u/johnlester)\
**Replies:** 0\
**Last updated:** [October 17, 2007, 1:30pm UTC](https://www.ruby-forum.com/t/domain-specific-controllers/117499 "2007-10-17T13:30:12Z")

</div>

Hello, I am investigating having a multi-domain rails app, where I have a central “core” that works across many domains and is supplemented by domain specific functionality. I have looked into adding routing function…

---

## [Problem with assert\_difference](https://www.ruby-forum.com/t/problem-with-assert-difference/117481)

<div class="topic-metadata">

**Author:** [@kirankinuforu](https://www.ruby-forum.com/u/kirankinuforu)\
**Replies:** 1\
**Last updated:** [October 17, 2007, 10:43am UTC](https://www.ruby-forum.com/t/problem-with-assert-difference/117481 "2007-10-17T10:43:39Z")

</div>

Hello Friends, I have problem with assert\_difference, I want its syntax and explantion in detail, Please help me, plz give me solution. Regards, Kiran P.

---

## [Regarding auto complete](https://www.ruby-forum.com/t/regarding-auto-complete/117474)

<div class="topic-metadata">

**Author:** [@anitha.tanda](https://www.ruby-forum.com/u/anitha.tanda)\
**Replies:** 1\
**Last updated:** [October 17, 2007, 10:43am UTC](https://www.ruby-forum.com/t/regarding-auto-complete/117474 "2007-10-17T10:43:38Z")

</div>

I want to auto complete feature for multiple tables which are logically related. Can any one help me regarding this issue.

---

## [More precise distance\_in\_words?](https://www.ruby-forum.com/t/more-precise-distance-in-words/117482)

<div class="topic-metadata">

**Author:** [@vapor](https://www.ruby-forum.com/u/vapor)\
**Replies:** 0\
**Last updated:** [October 17, 2007, 10:41am UTC](https://www.ruby-forum.com/t/more-precise-distance-in-words/117482 "2007-10-17T10:41:45Z")

</div>

I want a more precise distance in words…like instead of ‘two month before’, I want ‘1 month and 11 days before’. any suggestions? thanks

---

## [Validates\_... :if option: only validate when not empty?](https://www.ruby-forum.com/t/validates-if-option-only-validate-when-not-empty/117443)

<div class="topic-metadata">

**Author:** [@josh](https://www.ruby-forum.com/u/josh)\
**Replies:** 5\
**Last updated:** [October 17, 2007, 10:24am UTC](https://www.ruby-forum.com/t/validates-if-option-only-validate-when-not-empty/117443 "2007-10-17T10:24:21Z")

</div>

Hi all I have several fields that are optional in a web form. E.g. the user may enter his age or not. Sadly the validates\_numericality\_of(:age) always fires, also when the user omitted the field. So no entry results …

---

## [Re: Basic Question about Base Files](https://www.ruby-forum.com/t/re-basic-question-about-base-files/117478)

<div class="topic-metadata">

**Author:** [@Thomas\_England](https://www.ruby-forum.com/u/Thomas_England)\
**Replies:** 0\
**Last updated:** [October 17, 2007, 10:12am UTC](https://www.ruby-forum.com/t/re-basic-question-about-base-files/117478 "2007-10-17T10:12:03Z")

</div>

ugh I also wanted to ask why would you need a controller for all your actions if they’re relatively static. Just throw your static pages in railsapp/public thomas england

---

## [Re: Basic Question about Base Files](https://www.ruby-forum.com/t/re-basic-question-about-base-files/117477)

<div class="topic-metadata">

**Author:** [@Thomas\_England](https://www.ruby-forum.com/u/Thomas_England)\
**Replies:** 0\
**Last updated:** [October 17, 2007, 10:08am UTC](https://www.ruby-forum.com/t/re-basic-question-about-base-files/117477 "2007-10-17T10:08:33Z")

</div>

you can also set up a layout in apps/views/layouts/ and put your html template there then in the controller you want to share this template put layout “nameoflayout” make sure you have a yield :layout where you wan…

---

## [Problem with show and hide div on mouse events](https://www.ruby-forum.com/t/problem-with-show-and-hide-div-on-mouse-events/117032)

<div class="topic-metadata">

**Author:** [@kirankinuforu](https://www.ruby-forum.com/u/kirankinuforu)\
**Replies:** 2\
**Last updated:** [October 17, 2007, 9:41am UTC](https://www.ruby-forum.com/t/problem-with-show-and-hide-div-on-mouse-events/117032 "2007-10-17T09:41:14Z")

</div>

\*Problem with show and hide div on mouse eventshttp://www.ruby-forum.com/topic/127744#569797 \* Hi, Friends, I am new to Ruby On Rails, I want to implement show and hide div on mouseover and mouseout events, I have t…

---

## [Form with two buttons](https://www.ruby-forum.com/t/form-with-two-buttons/117294)

<div class="topic-metadata">

**Author:** [@zaid](https://www.ruby-forum.com/u/zaid)\
**Replies:** 6\
**Last updated:** [October 17, 2007, 9:31am UTC](https://www.ruby-forum.com/t/form-with-two-buttons/117294 "2007-10-17T09:31:44Z")

</div>

Hi, I need to make a form with two buttons. But I do wrong. And why not can be. form: \<%= form\_tag :controller =\> ‘establishment\_contents’, :action =\> ‘llamada’, :opMenu =\> opcionMenu %\> \[…\] \<%= image\_submit\_tag ("…

---

## [Rails and Least Privilege Practices](https://www.ruby-forum.com/t/rails-and-least-privilege-practices/117464)

<div class="topic-metadata">

**Author:** [@S-gw](https://www.ruby-forum.com/u/S-gw)\
**Replies:** 0\
**Last updated:** [October 17, 2007, 7:35am UTC](https://www.ruby-forum.com/t/rails-and-least-privilege-practices/117464 "2007-10-17T07:35:21Z")

</div>

Wondering about the practice of running code under the philosophy of least privilege inside Rails – or perhaps its a Ruby question. (New to both). I’m used to a language called Lasso which has a security layer between …

---

## [Is Services a reserved word?](https://www.ruby-forum.com/t/is-services-a-reserved-word/117442)

<div class="topic-metadata">

**Author:** [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Replies:** 2\
**Last updated:** [October 17, 2007, 7:18am UTC](https://www.ruby-forum.com/t/is-services-a-reserved-word/117442 "2007-10-17T07:18:59Z")

</div>

I want to have a controller/model called services\_controller.rb/service.rb all went well, but then I tried to get a ‘list’ view and I got this error… Message uninitialized constant ServicesController::Services Loc…

---

## [How to establish remote connection to inranet server in ruby](https://www.ruby-forum.com/t/how-to-establish-remote-connection-to-inranet-server-in-ruby/196490)

<div class="topic-metadata">

**Author:** [@jhonny](https://www.ruby-forum.com/u/jhonny)\
**Replies:** 0\
**Last updated:** [October 17, 2007, 7:12am UTC](https://www.ruby-forum.com/t/how-to-establish-remote-connection-to-inranet-server-in-ruby/196490 "2007-10-17T07:12:21Z")

</div>

Hi , I have my application on two different servers text drive server 2 intranet server located at some place. Right now i am using VPN to access my application that is on intranet server. Now using ruby code i n…

---

## [Active Record: Defining Table Relationships](https://www.ruby-forum.com/t/active-record-defining-table-relationships/117457)

<div class="topic-metadata">

**Author:** [@demonGeek](https://www.ruby-forum.com/u/demonGeek)\
**Replies:** 3\
**Last updated:** [October 17, 2007, 7:02am UTC](https://www.ruby-forum.com/t/active-record-defining-table-relationships/117457 "2007-10-17T07:02:03Z")

</div>

Hi, I’ve just started with Rails and I’m struggling with how to define a particular table relationship in Active Record. There are two tables, Family and Person. Family: id father\_id mother\_id Person: id name W…

---

## [PostgreSQL, templates, and test databases](https://www.ruby-forum.com/t/postgresql-templates-and-test-databases/116401)

<div class="topic-metadata">

**Author:** [@marnen](https://www.ruby-forum.com/u/marnen)\
**Replies:** 5\
**Last updated:** [October 17, 2007, 6:24am UTC](https://www.ruby-forum.com/t/postgresql-templates-and-test-databases/116401 "2007-10-17T06:24:47Z")

</div>

Hi everyone. I’m having a bit of a problem with an application I’m currently developing with Rails 1.2.3 and PostgreSQL, attempting to use test-first development. Here’s the scenario: I have the usual three databas…

---

## [Trouble installing/configuring Rails](https://www.ruby-forum.com/t/trouble-installing-configuring-rails/117140)

<div class="topic-metadata">

**Author:** [@Colleen\_RobledoS\_ML](https://www.ruby-forum.com/u/Colleen_RobledoS_ML)\
**Replies:** 2\
**Last updated:** [October 17, 2007, 6:17am UTC](https://www.ruby-forum.com/t/trouble-installing-configuring-rails/117140 "2007-10-17T06:17:26Z")

</div>

Hello, I’m absolutely brand new to Ruby on Rails, and am trying to install it on my host server. My host server (Netfirms) provides limited support for Ruby on Rails, meaning they have the programming script and db …

---

## [Testing Log](https://www.ruby-forum.com/t/testing-log/117461)

<div class="topic-metadata">

**Author:** [@keynan](https://www.ruby-forum.com/u/keynan)\
**Replies:** 0\
**Last updated:** [October 17, 2007, 5:50am UTC](https://www.ruby-forum.com/t/testing-log/117461 "2007-10-17T05:50:45Z")

</div>

Context: I am attempting to setup an RoR application with CI. Problem: I need the tests to spit out a Junit format test log. Solution …

---

## [Where override model attribute names?](https://www.ruby-forum.com/t/where-override-model-attribute-names/117435)

<div class="topic-metadata">

**Author:** [@S-gw](https://www.ruby-forum.com/u/S-gw)\
**Replies:** 2\
**Last updated:** [October 17, 2007, 5:25am UTC](https://www.ruby-forum.com/t/where-override-model-attribute-names/117435 "2007-10-17T05:25:38Z")

</div>

OK, so I get that ActiveRecord determines model attributes through reflection of the table schema. Handy for many cases, but not mine. I need to override that and provide my own mapping of attribute names to column na…

---

## [Coniditional loading of rjs files?](https://www.ruby-forum.com/t/coniditional-loading-of-rjs-files/117348)

<div class="topic-metadata">

**Author:** [@jessehk](https://www.ruby-forum.com/u/jessehk)\
**Replies:** 4\
**Last updated:** [October 17, 2007, 5:19am UTC](https://www.ruby-forum.com/t/coniditional-loading-of-rjs-files/117348 "2007-10-17T05:19:36Z")

</div>

ok I have been struggling with this - seems very straight forward? given a controller game\_controller with a method/action receive\_move that gets called by an ajax event on the client/browser I can ‘automatically’ loa…

---

## [One model, multiple tables vs. confusion about SQL indexes](https://www.ruby-forum.com/t/one-model-multiple-tables-vs-confusion-about-sql-indexes/117439)

<div class="topic-metadata">

**Author:** [@dukael](https://www.ruby-forum.com/u/dukael)\
**Replies:** 1\
**Last updated:** [October 17, 2007, 3:37am UTC](https://www.ruby-forum.com/t/one-model-multiple-tables-vs-confusion-about-sql-indexes/117439 "2007-10-17T03:37:32Z")

</div>

Hi all, This might be more of an SQL question, but I figured I give it a shot here. One of my models has ~2 million records in it but only 200 are frequently updated. I can also reliably predict which 200 these are g…

---

## [PackR - a Ruby port of Packer](https://www.ruby-forum.com/t/packr-a-ruby-port-of-packer/117459)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [October 17, 2007, 2:12am UTC](https://www.ruby-forum.com/t/packr-a-ruby-port-of-packer/117459 "2007-10-17T02:12:16Z")

</div>

Hi all, Just a quick announcement: I’ve no idea whether someone already did this but my limited Google searching turned up nothing. I’ve ported Dean Edwards’ JavaScript compressor to Ruby and released it as a Rails p…

---

## [Code Completion by IDEs - How Complete?](https://www.ruby-forum.com/t/code-completion-by-ides-how-complete/115581)

<div class="topic-metadata">

**Author:** [@CCH](https://www.ruby-forum.com/u/CCH)\
**Replies:** 37\
**Last updated:** [October 17, 2007, 2:04am UTC](https://www.ruby-forum.com/t/code-completion-by-ides-how-complete/115581 "2007-10-17T02:04:41Z")

</div>

Hi Continuing from “Moving to 3rd Rail” After being educated on the virtues of NBRubyIde, I was motivated to actually checked out code completion of the much maligned free Aptana radrails. This is the result Type v…

---

## [Acts\_as\_authenticated reset vs. resend password](https://www.ruby-forum.com/t/acts-as-authenticated-reset-vs-resend-password/117446)

<div class="topic-metadata">

**Author:** [@jgjgjg](https://www.ruby-forum.com/u/jgjgjg)\
**Replies:** 1\
**Last updated:** [October 17, 2007, 1:58am UTC](https://www.ruby-forum.com/t/acts-as-authenticated-reset-vs-resend-password/117446 "2007-10-17T01:58:15Z")

</div>

We’re using acts\_as\_authenticated and we’d like to just send users their forgotten password instead of resetting it. I read that this can be somewhat risky since you have to decrypt the password to send it. Does anyon…

---

## [Losing session variable with acts\_as\_authenticated](https://www.ruby-forum.com/t/losing-session-variable-with-acts-as-authenticated/117285)

<div class="topic-metadata">

**Author:** [@miss\_michelle](https://www.ruby-forum.com/u/miss_michelle)\
**Replies:** 8\
**Last updated:** [October 17, 2007, 1:52am UTC](https://www.ruby-forum.com/t/losing-session-variable-with-acts-as-authenticated/117285 "2007-10-17T01:52:25Z")

</div>

Hi, I initially set up acts\_as\_authenticated to require a user login before accessing and updating pages on my recipe site. This worked fine with no problems with the user session. Now, I have changed the setup so th…

---

## [Having 2 forms/ Storing form data onto sessions?](https://www.ruby-forum.com/t/having-2-forms-storing-form-data-onto-sessions/117447)

<div class="topic-metadata">

**Author:** [@rich](https://www.ruby-forum.com/u/rich)\
**Replies:** 1\
**Last updated:** [October 17, 2007, 1:08am UTC](https://www.ruby-forum.com/t/having-2-forms-storing-form-data-onto-sessions/117447 "2007-10-17T01:08:36Z")

</div>

I am trying to find a way to have two forms on the same page. However when I hit the submit button on one form the data that had been entered on the other form disappears. Is there a way to transfer the data on a form…

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

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