# Rails

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

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

---

## [Security in use of contants](https://www.ruby-forum.com/t/security-in-use-of-contants/196785)

<div class="topic-metadata">

**Author:** [@Kless](https://www.ruby-forum.com/u/Kless)\
**Replies:** 2\
**Last updated:** [August 18, 2008, 9:10am UTC](https://www.ruby-forum.com/t/security-in-use-of-contants/196785 "2008-08-18T09:10:39Z")

</div>

Is secure use constants? I come from Python and it isn’t recommended there.

---

## [Select through proxy objects without joins](https://www.ruby-forum.com/t/select-through-proxy-objects-without-joins/146119)

<div class="topic-metadata">

**Author:** [@daniel304](https://www.ruby-forum.com/u/daniel304)\
**Replies:** 4\
**Last updated:** [August 18, 2008, 8:58am UTC](https://www.ruby-forum.com/t/select-through-proxy-objects-without-joins/146119 "2008-08-18T08:58:21Z")

</div>

Company has many Departments, Department has many Employees. Is there nice easy way to select all Employees of certain Company? I mean using just proxy objects, without joins.

---

## [SOT SQL question](https://www.ruby-forum.com/t/sot-sql-question/146055)

<div class="topic-metadata">

**Author:** [@Jeffrey\_LSTaylor](https://www.ruby-forum.com/u/Jeffrey_LSTaylor)\
**Replies:** 4\
**Last updated:** [August 18, 2008, 6:24am UTC](https://www.ruby-forum.com/t/sot-sql-question/146055 "2008-08-18T06:24:31Z")

</div>

I have an items tables, a tokens table, and a items\_tokens join table. There can be multiple joins for an items, tokens pair, i.e. a token appears multiple times in an item. I would like to increment a column in the…

---

## [Preferred plugin installation method](https://www.ruby-forum.com/t/preferred-plugin-installation-method/146112)

<div class="topic-metadata">

**Author:** [@asoto](https://www.ruby-forum.com/u/asoto)\
**Replies:** 0\
**Last updated:** [August 18, 2008, 5:49am UTC](https://www.ruby-forum.com/t/preferred-plugin-installation-method/146112 "2008-08-18T05:49:24Z")

</div>

For anyone who cares to comment, how are you installing plugins (from github, 99% of the time) into your projects, and why are you using the method you’re using? I’m assuming you’re using git to manage your code. Spec…

---

## [Problem displaying correct price/decimal values](https://www.ruby-forum.com/t/problem-displaying-correct-price-decimal-values/146086)

<div class="topic-metadata">

**Author:** [@CPerry](https://www.ruby-forum.com/u/CPerry)\
**Replies:** 2\
**Last updated:** [August 18, 2008, 5:36am UTC](https://www.ruby-forum.com/t/problem-displaying-correct-price-decimal-values/146086 "2008-08-18T05:36:36Z")

</div>

Hey all, I am working on an app where people can post items for sale. When they post an item, they add a price to that item. When the item gets output to the page, it will not display the second number AFTER the decim…

---

## [How to create a change password web form and send email noti](https://www.ruby-forum.com/t/how-to-create-a-change-password-web-form-and-send-email-noti/145800)

<div class="topic-metadata">

**Author:** [@jsn1](https://www.ruby-forum.com/u/jsn1)\
**Replies:** 4\
**Last updated:** [August 18, 2008, 5:19am UTC](https://www.ruby-forum.com/t/how-to-create-a-change-password-web-form-and-send-email-noti/145800 "2008-08-18T05:19:03Z")

</div>

Hi all I am looking for a web page or application that will allow an user to change his/her database password. I am thinking about a web form where end users enter the current password and the new password, hit submit …

---

## [Pessimistic locking](https://www.ruby-forum.com/t/pessimistic-locking/146101)

<div class="topic-metadata">

**Author:** [@jturney](https://www.ruby-forum.com/u/jturney)\
**Replies:** 3\
**Last updated:** [August 18, 2008, 4:57am UTC](https://www.ruby-forum.com/t/pessimistic-locking/146101 "2008-08-18T04:57:26Z")

</div>

Hey, I’ve been trying to figure out how to use pessimistic locking. So far I’ve found this: table.transaction do row = table.find(:first, :lock=\>true) row.col = blah row.save! end I’m not that familiar with SQL o…

---

## [Alias attribute and the dirty methods (\_changed? etc)](https://www.ruby-forum.com/t/alias-attribute-and-the-dirty-methods-changed-etc/146108)

<div class="topic-metadata">

**Author:** [@timhunter](https://www.ruby-forum.com/u/timhunter)\
**Replies:** 0\
**Last updated:** [August 18, 2008, 1:23am UTC](https://www.ruby-forum.com/t/alias-attribute-and-the-dirty-methods-changed-etc/146108 "2008-08-18T01:23:48Z")

</div>

Rails currently doesn’t support the dirty methods for an attribute alias’s. i.e. if you setup an alias called title (alias\_attribute :title, :name) then title\_changed? isn’t defined. Rich has written a simple patch s…

---

## [Best way to display recently changed objects?](https://www.ruby-forum.com/t/best-way-to-display-recently-changed-objects/146104)

<div class="topic-metadata">

**Author:** [@kevin\_evans](https://www.ruby-forum.com/u/kevin_evans)\
**Replies:** 5\
**Last updated:** [August 18, 2008, 12:29am UTC](https://www.ruby-forum.com/t/best-way-to-display-recently-changed-objects/146104 "2008-08-18T00:29:25Z")

</div>

I’m trying to create a list of recently changed objects… but… @events = Event.find :all, :limit =\> 2, :order =\> ‘updated\_at desc’ @videos = Video.find :all, :limit =\> 2, :order =\> ‘updated\_at desc’ @recently = \[@even…

---

## [Cache\_fu bug?](https://www.ruby-forum.com/t/cache-fu-bug/146103)

<div class="topic-metadata">

**Author:** [@nextpulse](https://www.ruby-forum.com/u/nextpulse)\
**Replies:** 0\
**Last updated:** [August 17, 2008, 11:52pm UTC](https://www.ruby-forum.com/t/cache-fu-bug/146103 "2008-08-17T23:52:31Z")

</div>

myobj = Myobj.cached(:find\_by\_user\_id, :with=\>user\_id) Debug gives: ==\> Got Myobj:find\_by\_user\_id:1 BUT on expire\_cache: ==\>Deleted Myobj:1:find\_by\_user\_id The key is totally screwed up. I’m digging into the plugin…

---

## [Help with this (somewhat simple) finder query](https://www.ruby-forum.com/t/help-with-this-somewhat-simple-finder-query/146072)

<div class="topic-metadata">

**Author:** [@galeal](https://www.ruby-forum.com/u/galeal)\
**Replies:** 3\
**Last updated:** [August 17, 2008, 11:21pm UTC](https://www.ruby-forum.com/t/help-with-this-somewhat-simple-finder-query/146072 "2008-08-17T23:21:49Z")

</div>

I have this section in my site that I want to build, “Hot announcements” i.e. the latest 4 announcements that have lots of comments, ordered in a descending fashion. What I want to do is only get the top 4 from the da…

---

## [Trouble Testing a Controller With RSpec](https://www.ruby-forum.com/t/trouble-testing-a-controller-with-rspec/146092)

<div class="topic-metadata">

**Author:** [@snowbird122](https://www.ruby-forum.com/u/snowbird122)\
**Replies:** 3\
**Last updated:** [August 17, 2008, 11:13pm UTC](https://www.ruby-forum.com/t/trouble-testing-a-controller-with-rspec/146092 "2008-08-17T23:13:20Z")

</div>

Hello- I’ve been staring that this problem for hours with no success. What I’m trying to do is pretty simple. I’m trying to test the create method of a controller. Here is the create method: POST /accounts def creat…

---

## [Strange zentest/rspec behavior](https://www.ruby-forum.com/t/strange-zentest-rspec-behavior/146105)

<div class="topic-metadata">

**Author:** [@tatyree](https://www.ruby-forum.com/u/tatyree)\
**Replies:** 0\
**Last updated:** [August 17, 2008, 11:11pm UTC](https://www.ruby-forum.com/t/strange-zentest-rspec-behavior/146105 "2008-08-17T23:11:34Z")

</div>

Hi, Wondering if anyone can help me here? I’m tearing my hair out. I have a spec that works fine when run singly, but fails if run as part other tests (autospec). It does not depend on anything, and everything it …

---

## [Using a helper\_method in a view](https://www.ruby-forum.com/t/using-a-helper-method-in-a-view/146087)

<div class="topic-metadata">

**Author:** [@cjnkns](https://www.ruby-forum.com/u/cjnkns)\
**Replies:** 1\
**Last updated:** [August 17, 2008, 10:15pm UTC](https://www.ruby-forum.com/t/using-a-helper-method-in-a-view/146087 "2008-08-17T22:15:55Z")

</div>

I’m having an odd problem… in application.rb I have: helper\_method :admin? …since I use this all the time in my views to test if the user is an administrator, of course. Pretty standard. I thought I’d be able to use …

---

## [Gamble & odds on future RoR desktop deployability & IP protection?](https://www.ruby-forum.com/t/gamble-odds-on-future-ror-desktop-deployability-ip-protection/146100)

<div class="topic-metadata">

**Author:** [@mitch](https://www.ruby-forum.com/u/mitch)\
**Replies:** 1\
**Last updated:** [August 17, 2008, 9:53pm UTC](https://www.ruby-forum.com/t/gamble-odds-on-future-ror-desktop-deployability-ip-protection/146100 "2008-08-17T21:53:38Z")

</div>

I’m looking at switching to RoR for development of a commercial product, but a big issue is that I currently can’t use RoR for anything other than a classical hosted app. What are the odds that within say 12 months th…

---

## [Trying to Upgrade from Rails 1.2 to 2.1](https://www.ruby-forum.com/t/trying-to-upgrade-from-rails-1-2-to-2-1/146097)

<div class="topic-metadata">

**Author:** [@slain](https://www.ruby-forum.com/u/slain)\
**Replies:** 2\
**Last updated:** [August 17, 2008, 9:06pm UTC](https://www.ruby-forum.com/t/trying-to-upgrade-from-rails-1-2-to-2-1/146097 "2008-08-17T21:06:14Z")

</div>

Hey, I’m trying to upgrade my rails projects that use engines to Rails 2.1. Currently I am stuck at: c:/dev/ruby/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/rails/plugin/loader.rb:145:in \`ensure\_all\_registered\_plugins\_are…

---

## [Mysql "lock wait timeout" tuning](https://www.ruby-forum.com/t/mysql-lock-wait-timeout-tuning/144588)

<div class="topic-metadata">

**Author:** [@Aramis\_K](https://www.ruby-forum.com/u/Aramis_K)\
**Replies:** 3\
**Last updated:** [August 17, 2008, 8:41pm UTC](https://www.ruby-forum.com/t/mysql-lock-wait-timeout-tuning/144588 "2008-08-17T20:41:01Z")

</div>

We’re seeing these errors intermittently: Mysql::Error: Lock wait timeout exceeded; try restarting transaction: UPDATE chairs SET published\_at = NULL, updated\_at = ‘2008-07-30 15:31:05’ WHERE id = 2147 \[RAILS\_ROOT\]/…

---

## [Will\_paginate not working](https://www.ruby-forum.com/t/will-paginate-not-working/146093)

<div class="topic-metadata">

**Author:** [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Replies:** 4\
**Last updated:** [August 17, 2008, 8:40pm UTC](https://www.ruby-forum.com/t/will-paginate-not-working/146093 "2008-08-17T20:40:09Z")

</div>

When I use will\_paginate I get pure code in the layer I try to update starting with “try {”. Any ideas what could be wrong without posting any code? What is the normal error when this happens, if any?

---

## [Rails 2.0.2 and Can't mass-assign these protected attributes](https://www.ruby-forum.com/t/rails-2-0-2-and-cant-mass-assign-these-protected-attributes/146089)

<div class="topic-metadata">

**Author:** [@txapelgorri](https://www.ruby-forum.com/u/txapelgorri)\
**Replies:** 4\
**Last updated:** [August 17, 2008, 8:36pm UTC](https://www.ruby-forum.com/t/rails-2-0-2-and-cant-mass-assign-these-protected-attributes/146089 "2008-08-17T20:36:54Z")

</div>

Hi there: I’m playing around with a form that saves name, type and date for a kind of travels. At the controller I have this: @promotion = Promotion.new(params\[:promotion\]) @promotion.save redirect\_to promotions\_pat…

---

## [Thinking Sphinx No Sources Found in Config?](https://www.ruby-forum.com/t/thinking-sphinx-no-sources-found-in-config/146060)

<div class="topic-metadata">

**Author:** [@jh100000](https://www.ruby-forum.com/u/jh100000)\
**Replies:** 8\
**Last updated:** [August 17, 2008, 8:17pm UTC](https://www.ruby-forum.com/t/thinking-sphinx-no-sources-found-in-config/146060 "2008-08-17T20:17:34Z")

</div>

Hi, I am trying to get Thinking Sphinx running. See snippet below. I receive an error message stating that “no sources found in config file”. I cannot find any information on the thinking sphinx site on what this p…

---

## [Help me in wikipedia and ruby](https://www.ruby-forum.com/t/help-me-in-wikipedia-and-ruby/142619)

<div class="topic-metadata">

**Author:** [@harsh](https://www.ruby-forum.com/u/harsh)\
**Replies:** 6\
**Last updated:** [August 17, 2008, 8:15pm UTC](https://www.ruby-forum.com/t/help-me-in-wikipedia-and-ruby/142619 "2008-08-17T20:15:48Z")

</div>

pls help me if any material is there so that i can directly connect my data to wikipedia search if any one wants… for examle if anyone typed the text like india or some other u and one wants to get the information ab…

---

## [A challenge from a CMS implementer](https://www.ruby-forum.com/t/a-challenge-from-a-cms-implementer/126087)

<div class="topic-metadata">

**Author:** [@mahadewa](https://www.ruby-forum.com/u/mahadewa)\
**Replies:** 33\
**Last updated:** [August 17, 2008, 7:59pm UTC](https://www.ruby-forum.com/t/a-challenge-from-a-cms-implementer/126087 "2008-08-17T19:59:58Z")

</div>

Hey guys RoR evangelists keep telling us that they have the #1 framework for developing webapps. OK, but show us something that works and is useful to many people out there. I could be wrong, but it doesn’t seem as if …

---

## [SQL Server UCS-2 and UTF-8](https://www.ruby-forum.com/t/sql-server-ucs-2-and-utf-8/146088)

<div class="topic-metadata">

**Author:** [@Mikel\_L](https://www.ruby-forum.com/u/Mikel_L)\
**Replies:** 0\
**Last updated:** [August 17, 2008, 7:41pm UTC](https://www.ruby-forum.com/t/sql-server-ucs-2-and-utf-8/146088 "2008-08-17T19:41:14Z")

</div>

Hello all, I am writing data into an MS SQL Server, to be used by other applications (not my rails app). The problem is I need to put Chinese and Japanese characters into the database. If I write it in using the Rai…

---

## [rSpec and model validations](https://www.ruby-forum.com/t/rspec-and-model-validations/146084)

<div class="topic-metadata">

**Author:** [@matid](https://www.ruby-forum.com/u/matid)\
**Replies:** 1\
**Last updated:** [August 17, 2008, 7:05pm UTC](https://www.ruby-forum.com/t/rspec-and-model-validations/146084 "2008-08-17T19:05:29Z")

</div>

Hi there, I’ve got a little question regarding rspec and the way I ought to test models. Let’s say I’ve got the following test: 5797’s gists · GitHub It ensures the identity model is validated and returns an error if …

---

## [Using multiple controllers in one view](https://www.ruby-forum.com/t/using-multiple-controllers-in-one-view/146081)

<div class="topic-metadata">

**Author:** [@dstocks](https://www.ruby-forum.com/u/dstocks)\
**Replies:** 1\
**Last updated:** [August 17, 2008, 6:35pm UTC](https://www.ruby-forum.com/t/using-multiple-controllers-in-one-view/146081 "2008-08-17T18:35:00Z")

</div>

HELP! I am trying to build a site for a client where they can display their art, sell their art, and update the front page in a blog style format. I have one main controller for the site itself, a controller for the …

---

## [How to get/set session in ActionView::TestCase?](https://www.ruby-forum.com/t/how-to-get-set-session-in-actionview-testcase/146085)

<div class="topic-metadata">

**Author:** [@g0nzo](https://www.ruby-forum.com/u/g0nzo)\
**Replies:** 0\
**Last updated:** [August 17, 2008, 5:32pm UTC](https://www.ruby-forum.com/t/how-to-get-set-session-in-actionview-testcase/146085 "2008-08-17T17:32:24Z")

</div>

Hi, I’m trying to use Rails 2.1 ActionView::TestCase to test my helpers. I got really simple method in ApplicationHelper: def current\_user User.find(session\[:user\_id\]) end How can I set/get session in ActionView::T…

---

## [Fixtures and Legacy Tables](https://www.ruby-forum.com/t/fixtures-and-legacy-tables/146082)

<div class="topic-metadata">

**Author:** [@Mark\_Menard](https://www.ruby-forum.com/u/Mark_Menard)\
**Replies:** 2\
**Last updated:** [August 17, 2008, 5:18pm UTC](https://www.ruby-forum.com/t/fixtures-and-legacy-tables/146082 "2008-08-17T17:18:20Z")

</div>

I’m trying to use an existing database for a new Rails project. In my tests the fixture accessors are not working. If I try to access a Party fixture with “parties(:one)” I get the following error: test\_fixture(PartyT…

---

## [How to properly charge credit cards?](https://www.ruby-forum.com/t/how-to-properly-charge-credit-cards/146046)

<div class="topic-metadata">

**Author:** [@benjohnson](https://www.ruby-forum.com/u/benjohnson)\
**Replies:** 9\
**Last updated:** [August 17, 2008, 4:47pm UTC](https://www.ruby-forum.com/t/how-to-properly-charge-credit-cards/146046 "2008-08-17T16:47:31Z")

</div>

I’m building an app that needs to charge credit cards. I read the tutorial in the advanced rails recipes book. They have you set up a separate application called “card\_server” that handles storing and charging credit …

---

## [NoMethodError with collection\_select](https://www.ruby-forum.com/t/nomethoderror-with-collection-select/124852)

<div class="topic-metadata">

**Author:** [@reub](https://www.ruby-forum.com/u/reub)\
**Replies:** 5\
**Last updated:** [August 17, 2008, 2:50pm UTC](https://www.ruby-forum.com/t/nomethoderror-with-collection-select/124852 "2008-08-17T14:50:15Z")

</div>

This is likely another newbie missing the forest for the trees types of questions, but I can’t seem to find my way out. Any help is greatly appreciated. I’m getting a “NoMethodError in Reservations#create” error (full…

---

## [Mongrel errors overload Nginx's error.log and server's CPU](https://www.ruby-forum.com/t/mongrel-errors-overload-nginxs-error-log-and-servers-cpu/146079)

<div class="topic-metadata">

**Author:** [@stanislav](https://www.ruby-forum.com/u/stanislav)\
**Replies:** 0\
**Last updated:** [August 17, 2008, 2:48pm UTC](https://www.ruby-forum.com/t/mongrel-errors-overload-nginxs-error-log-and-servers-cpu/146079 "2008-08-17T14:48:01Z")

</div>

Hello, I’m considering to replace our production server Apache with Enginx. Behind them there are a dozen of mongrel\_rails instances. Some of the features that I like very much in Nginx are - fair load balancing for …

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

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