# Rails

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

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

---

## [Ferret Shared Index Issue](https://www.ruby-forum.com/t/ferret-shared-index-issue/171601)

<div class="topic-metadata">

**Author:** [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Replies:** 0\
**Last updated:** [July 6, 2009, 2:48pm UTC](https://www.ruby-forum.com/t/ferret-shared-index-issue/171601 "2009-07-06T14:48:19Z")

</div>

Hi, A really strange one. I have the following shared index initialized on startup ActsAsFerret::define\_index(‘shared’, :models =\> { Product =\> {:fields =\> \[:name, :desc\]}, HostApplication =\> {:fields =\> \[:name, :…

---

## [How to install rail from source](https://www.ruby-forum.com/t/how-to-install-rail-from-source/171598)

<div class="topic-metadata">

**Author:** [@Vinod\_Singh](https://www.ruby-forum.com/u/Vinod_Singh)\
**Replies:** 1\
**Last updated:** [July 6, 2009, 2:20pm UTC](https://www.ruby-forum.com/t/how-to-install-rail-from-source/171598 "2009-07-06T14:20:08Z")

</div>

I am trying to play with Ruby and rails first time. All instructions to install rails seems to be ‘gem install rails’ kind of. Problem with this method is that it will need an internet connection on the machine where …

---

## [Jruby + SQLserver](https://www.ruby-forum.com/t/jruby-sqlserver/171599)

<div class="topic-metadata">

**Author:** [@Augustus\_C](https://www.ruby-forum.com/u/Augustus_C)\
**Replies:** 0\
**Last updated:** [July 6, 2009, 2:05pm UTC](https://www.ruby-forum.com/t/jruby-sqlserver/171599 "2009-07-06T14:05:31Z")

</div>

Somebody alredy work with this?May work donÂ´t autocommit. Why i make this? unfortunately my db is SQLserver. – Horus Augustus C. C. Lima Sagarana Tech Mobile +55(85)8842.4402 Desk +55(85)3304.6530 removed\_email\_…

---

## [Read email in ruby](https://www.ruby-forum.com/t/read-email-in-ruby/171585)

<div class="topic-metadata">

**Author:** [@remco](https://www.ruby-forum.com/u/remco)\
**Replies:** 2\
**Last updated:** [July 6, 2009, 1:47pm UTC](https://www.ruby-forum.com/t/read-email-in-ruby/171585 "2009-07-06T13:47:45Z")

</div>

Hi, We receive from our partner notification emails. My idea is to insert this email in our database. Ideas/links for reading emails in ruby? Grtz…remco

---

## [RESTFUL routes strange behavior](https://www.ruby-forum.com/t/restful-routes-strange-behavior/171564)

<div class="topic-metadata">

**Author:** [@waheedi](https://www.ruby-forum.com/u/waheedi)\
**Replies:** 2\
**Last updated:** [July 6, 2009, 1:17pm UTC](https://www.ruby-forum.com/t/restful-routes-strange-behavior/171564 "2009-07-06T13:17:01Z")

</div>

routes.rb api.resources :friends, :controller =\> :friends, :only =\> \[:list, :exists\], :collection =\> {:list =\> :get, :ids =\> :get, :exists =\> :get} here is my rake routes. list\_api\_friends GET /api/friends/list …

---

## [Log viewer in GUI](https://www.ruby-forum.com/t/log-viewer-in-gui/171593)

<div class="topic-metadata">

**Author:** [@chandramit](https://www.ruby-forum.com/u/chandramit)\
**Replies:** 0\
**Last updated:** [July 6, 2009, 1:01pm UTC](https://www.ruby-forum.com/t/log-viewer-in-gui/171593 "2009-07-06T13:01:29Z")

</div>

Hi I would like integrate the production log in GUI … any suggesting plugins r methods ? Regard’s chandra sekhar

---

## [Sanitize() AND escapeHTML()/h()?](https://www.ruby-forum.com/t/sanitize-and-escapehtml-h/171567)

<div class="topic-metadata">

**Author:** [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Replies:** 2\
**Last updated:** [July 6, 2009, 11:44am UTC](https://www.ruby-forum.com/t/sanitize-and-escapehtml-h/171567 "2009-07-06T11:44:25Z")

</div>

Hi there, is it correct that one should always use both… sanitize(params\[:whatever\_external\_or\_user\_input\_to\_save\_to\_database\]), AND 2. h(@whatever\_database\_record\_to\_display\_on\_page) …in order to have the highe…

---

## [Ajax update of a table](https://www.ruby-forum.com/t/ajax-update-of-a-table/171580)

<div class="topic-metadata">

**Author:** [@mistressjanna](https://www.ruby-forum.com/u/mistressjanna)\
**Replies:** 1\
**Last updated:** [July 6, 2009, 11:28am UTC](https://www.ruby-forum.com/t/ajax-update-of-a-table/171580 "2009-07-06T11:28:57Z")

</div>

I have a view that has a element in it that I want to update via ajax, so that the view is not refreshed. The number of rows I have will be variable, expanding and contracting, and each row is an element in an array…

---

## [\[ANN\] WiceGrid Plugin version 0.4](https://www.ruby-forum.com/t/ann-wicegrid-plugin-version-0-4/171589)

<div class="topic-metadata">

**Author:** [@yuleven](https://www.ruby-forum.com/u/yuleven)\
**Replies:** 0\
**Last updated:** [July 6, 2009, 10:53am UTC](https://www.ruby-forum.com/t/ann-wicegrid-plugin-version-0-4/171589 "2009-07-06T10:53:54Z")

</div>

Hello all, WiceGrid Plugin version 0.4 is released. A blog post with a list of changes: https://blog.wice.eu/2009/7/6/moving-to-github-and-wicegrid-version-0-4 Homepage & screenshots: http://redmine.wice.eu/wiki/wic…

---

## [Script/server stopped working after deployment](https://www.ruby-forum.com/t/script-server-stopped-working-after-deployment/171581)

<div class="topic-metadata">

**Author:** [@adsouzp](https://www.ruby-forum.com/u/adsouzp)\
**Replies:** 1\
**Last updated:** [July 6, 2009, 10:18am UTC](https://www.ruby-forum.com/t/script-server-stopped-working-after-deployment/171581 "2009-07-06T10:18:59Z")

</div>

I have my app up and running but now I can’t run it locally anymore. I did not touch the environment.rb nor the database.yml. when I run “script/server” I get this: /usr/local/lib/site\_ruby/1.8/rubygems/custom\_require…

---

## [MemCache::MemCacheError: No connection to server](https://www.ruby-forum.com/t/memcache-no-connection-to-server/171587)

<div class="topic-metadata">

**Author:** [@feeling3\_4](https://www.ruby-forum.com/u/feeling3_4)\
**Replies:** 0\
**Last updated:** [July 6, 2009, 10:04am UTC](https://www.ruby-forum.com/t/memcache-no-connection-to-server/171587 "2009-07-06T10:04:58Z")

</div>

hi, all after i switched from nginx + thin to nginx + passenger, the error “MemCache::MemCacheError: No connection to server” always shows up in the log. i did what the post “Phusion Passenger and memcache-client rev…

---

## [How do I generate dynamic items dynamically?](https://www.ruby-forum.com/t/how-do-i-generate-dynamic-items-dynamically/171555)

<div class="topic-metadata">

**Author:** [@dezrtdude](https://www.ruby-forum.com/u/dezrtdude)\
**Replies:** 3\
**Last updated:** [July 6, 2009, 6:42am UTC](https://www.ruby-forum.com/t/how-do-i-generate-dynamic-items-dynamically/171555 "2009-07-06T06:42:35Z")

</div>

Hi All, I’m looking for a way to append elements with javascript using javascript. Basically I have two lists of items. One has a list of items with an “ADD” button (using “link\_to\_remote”) and the other has a list…

---

## [Save! not allowed after validates\_uniqueness](https://www.ruby-forum.com/t/save-not-allowed-after-validates-uniqueness/171539)

<div class="topic-metadata">

**Author:** [@Learn\_by\_D](https://www.ruby-forum.com/u/Learn_by_D)\
**Replies:** 12\
**Last updated:** [July 6, 2009, 5:59am UTC](https://www.ruby-forum.com/t/save-not-allowed-after-validates-uniqueness/171539 "2009-07-06T05:59:26Z")

</div>

I have this in a model validates\_uniqueness\_of :aspect, :scope =\> :user\_id In an instance method of the same model I have “save!” but I don’t touch the :aspect attribute in that instance method at all. Whenever that…

---

## [Authentication and Wiki](https://www.ruby-forum.com/t/authentication-and-wiki/171578)

<div class="topic-metadata">

**Author:** [@enchanter](https://www.ruby-forum.com/u/enchanter)\
**Replies:** 4\
**Last updated:** [July 6, 2009, 2:57am UTC](https://www.ruby-forum.com/t/authentication-and-wiki/171578 "2009-07-06T02:57:12Z")

</div>

Hey, I’m trying as a test to make a simple wiki with RoR. I wanted to use restful\_authentication plugin, which creates a couple controllers, one of which is the Sessions controller. It has all the ‘logged\_in?’ checks …

---

## [No route matches for public directory](https://www.ruby-forum.com/t/no-route-matches-for-public-directory/171576)

<div class="topic-metadata">

**Author:** [@Jej](https://www.ruby-forum.com/u/Jej)\
**Replies:** 2\
**Last updated:** [July 6, 2009, 2:11am UTC](https://www.ruby-forum.com/t/no-route-matches-for-public-directory/171576 "2009-07-06T02:11:39Z")

</div>

Hi all, Strange problem! I get this error when I try to access the public directory (http://localhost:3000/stylesheets/): Routing Error No route matches “/stylesheets/” with {:method=\>:get} This occurs on a fresh ra…

---

## [Has\_many relationship - specify how quantity (how many)](https://www.ruby-forum.com/t/has-many-relationship-specify-how-quantity-how-many/171572)

<div class="topic-metadata">

**Author:** [@benol](https://www.ruby-forum.com/u/benol)\
**Replies:** 2\
**Last updated:** [July 6, 2009, 1:05am UTC](https://www.ruby-forum.com/t/has-many-relationship-specify-how-quantity-how-many/171572 "2009-07-06T01:05:03Z")

</div>

Hi, Is there any way to specify a a validation rule or something for the "has\_many’ relationship so that it would count the related objects? For e.g. I want my Foo object to have maximum of 5 Bar objects in has\_many …

---

## [Eager loading with find\_by\_sql](https://www.ruby-forum.com/t/eager-loading-with-find-by-sql/171533)

<div class="topic-metadata">

**Author:** [@Dallas](https://www.ruby-forum.com/u/Dallas)\
**Replies:** 3\
**Last updated:** [July 6, 2009, 12:52am UTC](https://www.ruby-forum.com/t/eager-loading-with-find-by-sql/171533 "2009-07-06T00:52:47Z")

</div>

I have a model Tweets, it has\_many :teams I wrote a custom find\_by\_sql query for tweets (yes i tried all other approaches) such that I can’t eager load the teams. I collect the ids and try to fake eager loading mysel…

---

## [Tell me how to rectify this error](https://www.ruby-forum.com/t/tell-me-how-to-rectify-this-error/171558)

<div class="topic-metadata">

**Author:** [@rajendra](https://www.ruby-forum.com/u/rajendra)\
**Replies:** 2\
**Last updated:** [July 5, 2009, 11:24pm UTC](https://www.ruby-forum.com/t/tell-me-how-to-rectify-this-error/171558 "2009-07-05T23:24:34Z")

</div>

hi i am using this command to scaffold G:\\my\\webblog\>ruby script/generate scaffold Comments comments:text but i got the folllwoing error, can any one help to rectify htis problam…

---

## [JSON data not decoded in Rails](https://www.ruby-forum.com/t/json-data-not-decoded-in-rails/171568)

<div class="topic-metadata">

**Author:** [@migrate](https://www.ruby-forum.com/u/migrate)\
**Replies:** 2\
**Last updated:** [July 5, 2009, 10:58pm UTC](https://www.ruby-forum.com/t/json-data-not-decoded-in-rails/171568 "2009-07-05T22:58:45Z")

</div>

Hello all, I’m trying to send some json data from the browser to the server using prototype without success. On the server side ActiveSupport::JSON.decode isn’t decoding the data. Here is the code: Javacript: click …

---

## [Gem update --system not updating](https://www.ruby-forum.com/t/gem-update-system-not-updating/171571)

<div class="topic-metadata">

**Author:** [@marcusj2](https://www.ruby-forum.com/u/marcusj2)\
**Replies:** 1\
**Last updated:** [July 5, 2009, 10:43pm UTC](https://www.ruby-forum.com/t/gem-update-system-not-updating/171571 "2009-07-05T22:43:41Z")

</div>

Yes, I’m a nubie. Trying to learn ruby and rails and have a very frustrating problem. Running Ubuntu 8.0.4 $ ruby -v ruby 1.8.6 (2007-09-24 patchlevel 111) \[x86\_64-linux\] $ gem -v 1.2.0 $ rails -v Rails 2.3.2 I …

---

## [How can I DRY this up?](https://www.ruby-forum.com/t/how-can-i-dry-this-up/171566)

<div class="topic-metadata">

**Author:** [@dr\_gavin](https://www.ruby-forum.com/u/dr_gavin)\
**Replies:** 2\
**Last updated:** [July 5, 2009, 10:20pm UTC](https://www.ruby-forum.com/t/how-can-i-dry-this-up/171566 "2009-07-05T22:20:54Z")

</div>

Hey all! Hope you’re having a good weekend. I have a couple of models that share a lot of similar validation so I figured this would be a good opportunity to DRY my code up. lets say for example: class Squirrel \< Ac…

---

## [Distance\_of\_time\_in\_words fails in test](https://www.ruby-forum.com/t/distance-of-time-in-words-fails-in-test/171557)

<div class="topic-metadata">

**Author:** [@brian](https://www.ruby-forum.com/u/brian)\
**Replies:** 3\
**Last updated:** [July 5, 2009, 9:44pm UTC](https://www.ruby-forum.com/t/distance-of-time-in-words-fails-in-test/171557 "2009-07-05T21:44:06Z")

</div>

I have a DateTime object (from DateTime.now), and an ActiveSupport::TimeWithZone object (comes from a date in the DB). I’m passing these values to the helper method distance\_of\_time\_in\_words: \<%= distance\_of\_time\_in\_…

---

## [Composite Primary Keys and validates\_uniqueness\_of](https://www.ruby-forum.com/t/composite-primary-keys-and-validates-uniqueness-of/171527)

<div class="topic-metadata">

**Author:** [@Learn\_by\_D](https://www.ruby-forum.com/u/Learn_by_D)\
**Replies:** 1\
**Last updated:** [July 5, 2009, 8:20pm UTC](https://www.ruby-forum.com/t/composite-primary-keys-and-validates-uniqueness-of/171527 "2009-07-05T20:20:15Z")

</div>

This question regards the Composite Primary Keys gem (http://compositekeys.rubyforge.org/) : Once I use set\_primary\_keys, should I also use validates\_uniqueness\_of to ensure that the composite primary key is unique a…

---

## [Conditions either null or real value](https://www.ruby-forum.com/t/conditions-either-null-or-real-value/171530)

<div class="topic-metadata">

**Author:** [@grayson](https://www.ruby-forum.com/u/grayson)\
**Replies:** 2\
**Last updated:** [July 5, 2009, 7:44pm UTC](https://www.ruby-forum.com/t/conditions-either-null-or-real-value/171530 "2009-07-05T19:44:16Z")

</div>

if my category\_id could be either nil or a int value, how can I specify a condition that handles both? conditions =\> \[“parent\_id = ?”,params\[:category\_id\]\] conditions =\> \[“parent\_id is ?”,params\[:category\_id\]\] I’m us…

---

## [Repeated conditions in sql queries](https://www.ruby-forum.com/t/repeated-conditions-in-sql-queries/171565)

<div class="topic-metadata">

**Author:** [@barunio](https://www.ruby-forum.com/u/barunio)\
**Replies:** 1\
**Last updated:** [July 5, 2009, 7:24pm UTC](https://www.ruby-forum.com/t/repeated-conditions-in-sql-queries/171565 "2009-07-05T19:24:13Z")

</div>

This is a minor question, mostly for curiosity: using rails 2.3, does anybody else notice repeated conditions in sql queries? consider the following app with two models linked through a join table: class User \< Acti…

---

## [Not sure how to do this](https://www.ruby-forum.com/t/not-sure-how-to-do-this/171466)

<div class="topic-metadata">

**Author:** [@jhaagmans](https://www.ruby-forum.com/u/jhaagmans)\
**Replies:** 7\
**Last updated:** [July 5, 2009, 7:09pm UTC](https://www.ruby-forum.com/t/not-sure-how-to-do-this/171466 "2009-07-05T19:09:47Z")

</div>

In an app I’m working on, I want to have a filter in which you can specify certain attributes and click “filter” to activate an AJAX request and return a list of, say, machines that match with those attributes. No I’…

---

## [Authlogic & password problems using rspec](https://www.ruby-forum.com/t/authlogic-password-problems-using-rspec/171292)

<div class="topic-metadata">

**Author:** [@Yoann-Z](https://www.ruby-forum.com/u/Yoann-Z)\
**Replies:** 2\
**Last updated:** [July 5, 2009, 6:58pm UTC](https://www.ruby-forum.com/t/authlogic-password-problems-using-rspec/171292 "2009-07-05T18:58:40Z")

</div>

Hi, I have a problem using rspec with my rspec tests with my application. I used authlogic to create my athentication system, following the video on railscast. It works fine with cucumber, but I always have a problem…

---

## [How to Synchronize?](https://www.ruby-forum.com/t/how-to-synchronize/171449)

<div class="topic-metadata">

**Author:** [@onurgu](https://www.ruby-forum.com/u/onurgu)\
**Replies:** 8\
**Last updated:** [July 5, 2009, 6:22pm UTC](https://www.ruby-forum.com/t/how-to-synchronize/171449 "2009-07-05T18:22:58Z")

</div>

Hi, I am developing a web based game in which people try to guess the concealed word in a collaborative manner. As you already take for granted, I use ruby on rails on the server side. But I have a problem, I synchro…

---

## [Params Merge and URL sorting/pagination](https://www.ruby-forum.com/t/params-merge-and-url-sorting-pagination/171458)

<div class="topic-metadata">

**Author:** [@elricstorm](https://www.ruby-forum.com/u/elricstorm)\
**Replies:** 7\
**Last updated:** [July 5, 2009, 5:32pm UTC](https://www.ruby-forum.com/t/params-merge-and-url-sorting-pagination/171458 "2009-07-05T17:32:48Z")

</div>

Hi all, Here’s my general setup on the specific template I’m having issues with: will\_paginate for pagination custom methods for sorting 1-form for team search 1-form for search by date When searching for a team fo…

---

## [Php =\> rails (JSON)](https://www.ruby-forum.com/t/php-rails-json/171554)

<div class="topic-metadata">

**Author:** [@mistressjanna](https://www.ruby-forum.com/u/mistressjanna)\
**Replies:** 3\
**Last updated:** [July 5, 2009, 1:50pm UTC](https://www.ruby-forum.com/t/php-rails-json/171554 "2009-07-05T13:50:15Z")

</div>

I have an application that creates a snippet of php in a server, for packaging up data for JSON, using the php package “Pear.” The snippet I create (with varying data, of course, as the application runs) is written in…

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

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