# Rails

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

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

---

## [Memcache/interlock problem (i think?)](https://www.ruby-forum.com/t/memcache-interlock-problem-i-think/188074)

<div class="topic-metadata">

**Author:** [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Replies:** 7\
**Last updated:** [May 5, 2010, 6:53pm UTC](https://www.ruby-forum.com/t/memcache-interlock-problem-i-think/188074 "2010-05-05T18:53:03Z")

</div>

Hey all I have a line of code that’s causing a “undefined method \`include?’ for nil:NilClass” exception, but i can’t work out what’s actually going wrong with it. After a bit of experimentation i discovered that it’s …

---

## [Generating html](https://www.ruby-forum.com/t/generating-html/188096)

<div class="topic-metadata">

**Author:** [@adam\_wead](https://www.ruby-forum.com/u/adam_wead)\
**Replies:** 1\
**Last updated:** [May 5, 2010, 6:51pm UTC](https://www.ruby-forum.com/t/generating-html/188096 "2010-05-05T18:51:12Z")

</div>

Hi all, I’m new to Ruby/Rails and need someone to help point me in the right direction. I have a little inventory app that I built for work to help me learn the language. I would like to modular-ize a bit of the ht…

---

## [Help! Fetch xml from an external source, then pass it into a form](https://www.ruby-forum.com/t/help-fetch-xml-from-an-external-source-then-pass-it-into-a-form/188100)

<div class="topic-metadata">

**Author:** [@roflkk](https://www.ruby-forum.com/u/roflkk)\
**Replies:** 0\
**Last updated:** [May 5, 2010, 6:48pm UTC](https://www.ruby-forum.com/t/help-fetch-xml-from-an-external-source-then-pass-it-into-a-form/188100 "2010-05-05T18:48:57Z")

</div>

OK, I’m looking for tips and help regarding fetching xml data from an external source and then parsing it into a form. What do I need to make this happen? Example: I have an Advert Model (which is for books) fields…

---

## [Advice on recruiting rails developers](https://www.ruby-forum.com/t/advice-on-recruiting-rails-developers/188059)

<div class="topic-metadata">

**Author:** [@drewB](https://www.ruby-forum.com/u/drewB)\
**Replies:** 5\
**Last updated:** [May 5, 2010, 6:42pm UTC](https://www.ruby-forum.com/t/advice-on-recruiting-rails-developers/188059 "2010-05-05T18:42:31Z")

</div>

Other than working with a recruiter or posting jobs on craigslist, dice, or this group, do people have any suggestions for good resources for finding developers in the bay area or philadelphia?

---

## [Check if the there is no records found](https://www.ruby-forum.com/t/check-if-the-there-is-no-records-found/188050)

<div class="topic-metadata">

**Author:** [@mohammed\_a](https://www.ruby-forum.com/u/mohammed_a)\
**Replies:** 3\
**Last updated:** [May 5, 2010, 6:06pm UTC](https://www.ruby-forum.com/t/check-if-the-there-is-no-records-found/188050 "2010-05-05T18:06:47Z")

</div>

In the controller @properties = Property.paginate :page =\> params\[:page\], :order =\> ‘created\_at DESC’ in the view I have tried \<% if !$properties.blank? %\> \<%= render :partial =\> “show\_properties\_list” %\> \<%else%\>…

---

## [Undefined method](https://www.ruby-forum.com/t/undefined-method/188098)

<div class="topic-metadata">

**Author:** [@anna](https://www.ruby-forum.com/u/anna)\
**Replies:** 1\
**Last updated:** [May 5, 2010, 5:53pm UTC](https://www.ruby-forum.com/t/undefined-method/188098 "2010-05-05T17:53:54Z")

</div>

hi, I am trying to add a page to my exisiting database and for some reason I get an error of “no method” I searched a lot but my problem did not get solved, so i’d appreciate if anyone can help me with this: I am try…

---

## [Uninitialized constant Rails::Initializer::MemCache](https://www.ruby-forum.com/t/uninitialized-constant-rails-memcache/188092)

<div class="topic-metadata">

**Author:** [@tedomeara](https://www.ruby-forum.com/u/tedomeara)\
**Replies:** 0\
**Last updated:** [May 5, 2010, 4:26pm UTC](https://www.ruby-forum.com/t/uninitialized-constant-rails-memcache/188092 "2010-05-05T16:26:20Z")

</div>

I’ve installed just about every library/gem that I could find for memcached/memcache, but everytime I attempt to run my application I get this error: Error message: uninitialized constant Rails::Initializer::MemCache …

---

## [Conditionally adding a link to a form -- how?](https://www.ruby-forum.com/t/conditionally-adding-a-link-to-a-form-how/186941)

<div class="topic-metadata">

**Author:** [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Replies:** 35\
**Last updated:** [May 5, 2010, 2:37pm UTC](https://www.ruby-forum.com/t/conditionally-adding-a-link-to-a-form-how/186941 "2010-05-05T14:37:56Z")

</div>

I’ve got two entities created by scaffolding: Expense & Vendor In Expense#new there’s a form with a Vendors-drop-down and a NewVendor- button. The latter button brings up Vendor#new. The Create button in Vendor#new b…

---

## [Integrating hardware with browser](https://www.ruby-forum.com/t/integrating-hardware-with-browser/188013)

<div class="topic-metadata">

**Author:** [@pepe](https://www.ruby-forum.com/u/pepe)\
**Replies:** 6\
**Last updated:** [May 5, 2010, 2:23pm UTC](https://www.ruby-forum.com/t/integrating-hardware-with-browser/188013 "2010-05-05T14:23:56Z")

</div>

Hello, I’ve looked high and low and found just 1 post with some information about this subject, from 2008, and Google searches turned out pretty much no useful information. I would appreciate any help on this. I need…

---

## [Migrations: Manually create primary key (MySQL)](https://www.ruby-forum.com/t/migrations-manually-create-primary-key-mysql/138815)

<div class="topic-metadata">

**Author:** [@demonGeek](https://www.ruby-forum.com/u/demonGeek)\
**Replies:** 11\
**Last updated:** [May 5, 2010, 2:10pm UTC](https://www.ruby-forum.com/t/migrations-manually-create-primary-key-mysql/138815 "2010-05-05T14:10:47Z")

</div>

I need to use a UUID as a primary key. I have everything working right now with the exception of being able to create the column in MySQL (v4) as a primary key. The migration looks like this: create\_table :groups, :i…

---

## [Setting values in nested objects](https://www.ruby-forum.com/t/setting-values-in-nested-objects/188030)

<div class="topic-metadata">

**Author:** [@mike](https://www.ruby-forum.com/u/mike)\
**Replies:** 2\
**Last updated:** [May 5, 2010, 1:14pm UTC](https://www.ruby-forum.com/t/setting-values-in-nested-objects/188030 "2010-05-05T13:14:03Z")

</div>

Hi, I have a model with nested objects similar to this: class Person \< ActiveRecord has\_many :addresses accepts\_nested\_attributes\_for :addresses accepts\_nested\_attributes\_for :home end class Address \< ActiveRecord …

---

## [Passing a variable to a javascript function from a helper function](https://www.ruby-forum.com/t/passing-a-variable-to-a-javascript-function-from-a-helper-function/188077)

<div class="topic-metadata">

**Author:** [@Mlle](https://www.ruby-forum.com/u/Mlle)\
**Replies:** 1\
**Last updated:** [May 5, 2010, 1:00pm UTC](https://www.ruby-forum.com/t/passing-a-variable-to-a-javascript-function-from-a-helper-function/188077 "2010-05-05T13:00:35Z")

</div>

I’m trying to pass a variable to a javascript function from a helper function but I’m not getting it to work. I think the problem is with #{domElement} any ideas? thanks! This is how the helper function is called f…

---

## [Encoding problems, applying a patch, how to?](https://www.ruby-forum.com/t/encoding-problems-applying-a-patch-how-to/188071)

<div class="topic-metadata">

**Author:** [@samuel](https://www.ruby-forum.com/u/samuel)\
**Replies:** 2\
**Last updated:** [May 5, 2010, 11:50am UTC](https://www.ruby-forum.com/t/encoding-problems-applying-a-patch-how-to/188071 "2010-05-05T11:50:19Z")

</div>

So, i’m facing issues with encoding, since I need to write an application in portuguese-brazilian. This is the error i’m getting: “incompatible character encodings: UTF-8 and ASCII-8BIT” The curious thing is that i h…

---

## [Auto\_complete with has\_one association](https://www.ruby-forum.com/t/auto-complete-with-has-one-association/188078)

<div class="topic-metadata">

**Author:** [@gregm](https://www.ruby-forum.com/u/gregm)\
**Replies:** 0\
**Last updated:** [May 5, 2010, 11:43am UTC](https://www.ruby-forum.com/t/auto-complete-with-has-one-association/188078 "2010-05-05T11:43:03Z")

</div>

Hi, Have an issue with the rails auto complete, it works fine but I don’t know how to find the id element search in the textfield. Here is what I’ve done: \<%= text\_field\_with\_auto\_complete :user, :ville\_name, { :size…

---

## [File.exists not working](https://www.ruby-forum.com/t/file-exists-not-working/188064)

<div class="topic-metadata">

**Author:** [@rahul\_m](https://www.ruby-forum.com/u/rahul_m)\
**Replies:** 6\
**Last updated:** [May 5, 2010, 11:11am UTC](https://www.ruby-forum.com/t/file-exists-not-working/188064 "2010-05-05T11:11:41Z")

</div>

hii \<%if File::exists?("../data/aritcal/#{@content.id}")%\> \<div id="image\_holder" class ="span-10 "\> \<%= image\_tag "../data/artical/#{@content.id}" %\> \</div\> \<%end%\> my this file exists not working plea…

---

## [Rails ROUTING map.root](https://www.ruby-forum.com/t/rails-routing-map-root/187919)

<div class="topic-metadata">

**Author:** [@davidz101](https://www.ruby-forum.com/u/davidz101)\
**Replies:** 5\
**Last updated:** [May 5, 2010, 10:04am UTC](https://www.ruby-forum.com/t/rails-routing-map-root/187919 "2010-05-05T10:04:57Z")

</div>

Is it possible to put an if/else statemnt, and change the map.root under each condition? for ex– if current\_user map.root :controller =\> ‘current\_user’ else map.root :controller =\> ‘home’ end cuase apparenlty that…

---

## [Project not serving static pages in production mode (ror3.beta3)](https://www.ruby-forum.com/t/project-not-serving-static-pages-in-production-mode-ror3-beta3/188069)

<div class="topic-metadata">

**Author:** [@anywho](https://www.ruby-forum.com/u/anywho)\
**Replies:** 0\
**Last updated:** [May 5, 2010, 10:02am UTC](https://www.ruby-forum.com/t/project-not-serving-static-pages-in-production-mode-ror3-beta3/188069 "2010-05-05T10:02:37Z")

</div>

hi, During the migration to a new server, I started running into some issues. I’d been running production on passenger which does not seem to have any problems, but the idea was to now use unicorn or thin or some oth…

---

## [Uninitialized constant when trying to migrate files](https://www.ruby-forum.com/t/uninitialized-constant-when-trying-to-migrate-files/188066)

<div class="topic-metadata">

**Author:** [@cbx](https://www.ruby-forum.com/u/cbx)\
**Replies:** 2\
**Last updated:** [May 5, 2010, 10:02am UTC](https://www.ruby-forum.com/t/uninitialized-constant-when-trying-to-migrate-files/188066 "2010-05-05T10:02:01Z")

</div>

Hi, i am having this problem: kevinngsw$ rake db:migrate --trace (in /Users/kevinngsw/Documents/Programming/\*\*\*\*\*\*\*) \*\* Invoke db:migrate (first\_time) \*\* Invoke environment (first\_time) \*\* Execute environment \*\* E…

---

## [Purpose of after\_initialize in ActiveRecord?](https://www.ruby-forum.com/t/purpose-of-after-initialize-in-activerecord/73815)

<div class="topic-metadata">

**Author:** [@weyus](https://www.ruby-forum.com/u/weyus)\
**Replies:** 5\
**Last updated:** [May 5, 2010, 3:18am UTC](https://www.ruby-forum.com/t/purpose-of-after-initialize-in-activerecord/73815 "2010-05-05T03:18:55Z")

</div>

All, I have a quick question - is the purpose of implementing after\_initialize to allow custom attribute initialization for AR descendants? I have been overriding initialize whenever I require custom setup of my mod…

---

## [Run query on IRB](https://www.ruby-forum.com/t/run-query-on-irb/188032)

<div class="topic-metadata">

**Author:** [@jv\_neto](https://www.ruby-forum.com/u/jv_neto)\
**Replies:** 3\
**Last updated:** [May 5, 2010, 2:15am UTC](https://www.ruby-forum.com/t/run-query-on-irb/188032 "2010-05-05T02:15:35Z")

</div>

Hi All I never worked with RUBY my fisrt time. I’d like to run this query by IRB and see how many line it will show me : select codigo, nome from teste My database is postgre 8.4 Look what i did to do it: irb(main…

---

## [Installing sqlite3 1.2.3 or 1.2.5 not working on windows vista](https://www.ruby-forum.com/t/installing-sqlite3-1-2-3-or-1-2-5-not-working-on-windows-vista/186844)

<div class="topic-metadata">

**Author:** [@Developer\_Michael](https://www.ruby-forum.com/u/Developer_Michael)\
**Replies:** 2\
**Last updated:** [May 5, 2010, 1:03am UTC](https://www.ruby-forum.com/t/installing-sqlite3-1-2-3-or-1-2-5-not-working-on-windows-vista/186844 "2010-05-05T01:03:53Z")

</div>

Am a RoR newbie here but have a lot of technical troubleshooting experience and searched here and google and cannot get around this problem. gem install sqlite3-ruby -v 1.2.3 or gem install sqlite3-ruby -v 1.2.5 … …

---

## [Session Store Issues on Production Server](https://www.ruby-forum.com/t/session-store-issues-on-production-server/188029)

<div class="topic-metadata">

**Author:** [@mindtonic](https://www.ruby-forum.com/u/mindtonic)\
**Replies:** 2\
**Last updated:** [May 5, 2010, 12:47am UTC](https://www.ruby-forum.com/t/session-store-issues-on-production-server/188029 "2010-05-05T00:47:47Z")

</div>

Hello, I am using AuthLogic as my authentication gem. Everything is great on my development server. When I upload to my passenger driven production server at Dreamhost, the sessions are persisting relentlessly. In…

---

## [Fields\_for inserts 2 identical rows to the connecting table (has\_many :through)](https://www.ruby-forum.com/t/fields-for-inserts-2-identical-rows-to-the-connecting-table-has-many-through/188051)

<div class="topic-metadata">

**Author:** [@oreng](https://www.ruby-forum.com/u/oreng)\
**Replies:** 1\
**Last updated:** [May 5, 2010, 12:43am UTC](https://www.ruby-forum.com/t/fields-for-inserts-2-identical-rows-to-the-connecting-table-has-many-through/188051 "2010-05-05T00:43:06Z")

</div>

My models are TranslationKey, TranslationValue and KeyValue. Here is the relevant part in the log: (the last two lines are identical inserts!) Processing TranslationKeysController#create (for 127.0.0.1 at 2010-05-04 …

---

## [Best HOST and web server](https://www.ruby-forum.com/t/best-host-and-web-server/188004)

<div class="topic-metadata">

**Author:** [@davidz101](https://www.ruby-forum.com/u/davidz101)\
**Replies:** 10\
**Last updated:** [May 4, 2010, 10:29pm UTC](https://www.ruby-forum.com/t/best-host-and-web-server/188004 "2010-05-04T22:29:40Z")

</div>

Ok im currently trying to choose between Apache/Nginx, and other stuff too (passenger, etc) Could someone give me a brief description/explanation of which one to use? What do you prefer? Pros/Cons? Also, whats ur fav…

---

## [Logging events app?](https://www.ruby-forum.com/t/logging-events-app/188027)

<div class="topic-metadata">

**Author:** [@softf5ajivanet](https://www.ruby-forum.com/u/softf5ajivanet)\
**Replies:** 2\
**Last updated:** [May 4, 2010, 10:00pm UTC](https://www.ruby-forum.com/t/logging-events-app/188027 "2010-05-04T22:00:40Z")

</div>

is there a webapp out there that allows the developer to log events (user emails joe, user logs out at xyz) that you can then turn into a report? seems pretty simple, wonder if someone’s done it already?

---

## [Updating an Application](https://www.ruby-forum.com/t/updating-an-application/187896)

<div class="topic-metadata">

**Author:** [@djames](https://www.ruby-forum.com/u/djames)\
**Replies:** 7\
**Last updated:** [May 4, 2010, 8:52pm UTC](https://www.ruby-forum.com/t/updating-an-application/187896 "2010-05-04T20:52:39Z")

</div>

I have deployed several instances of a Rails application. I am now considering how I might apply application updates to each of the various instances. I would like the updates to be contained in some sort of an arch…

---

## [Rails Authorization plugins](https://www.ruby-forum.com/t/rails-authorization-plugins/187935)

<div class="topic-metadata">

**Author:** [@jmamma](https://www.ruby-forum.com/u/jmamma)\
**Replies:** 3\
**Last updated:** [May 4, 2010, 8:51pm UTC](https://www.ruby-forum.com/t/rails-authorization-plugins/187935 "2010-05-04T20:51:27Z")

</div>

We are evaluating authorization plugins for rails and I wanted to address the group for some feedback. The two we are looking at are: cancan by Ryan B. and declarative\_authorization. If anyone has used either of the…

---

## [AR: dynamic accessors don't always work?](https://www.ruby-forum.com/t/ar-dynamic-accessors-dont-always-work/188038)

<div class="topic-metadata">

**Author:** [@fearless\_fool](https://www.ruby-forum.com/u/fearless_fool)\
**Replies:** 4\
**Last updated:** [May 4, 2010, 8:41pm UTC](https://www.ruby-forum.com/t/ar-dynamic-accessors-dont-always-work/188038 "2010-05-04T20:41:57Z")

</div>

This is curious. Consider ‘record’ below, derived from an SQL query. Notice that record.station\_id returns the station id properly, but record.start\_time returns nil. What’s the difference? (FWIW, I can access the …

---

## [Avoiding unnecessary queries in javascript/erb views](https://www.ruby-forum.com/t/avoiding-unnecessary-queries-in-javascript-erb-views/188045)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [May 4, 2010, 8:00pm UTC](https://www.ruby-forum.com/t/avoiding-unnecessary-queries-in-javascript-erb-views/188045 "2010-05-04T20:00:24Z")

</div>

Hello I have a js view, say, things/index.js.erb that looks like this: $(‘my-stuff’).update("\<%= escape\_javascript(render :partial =\> ‘shared/thing’, :collection =\> @things) %\>"); Effect.toggle(‘my-stuff’, ‘slide’); …

---

## [Getting class in /lib folder to see a model (const\_missing)?](https://www.ruby-forum.com/t/getting-class-in-lib-folder-to-see-a-model-const-missing/188011)

<div class="topic-metadata">

**Author:** [@mariachi77](https://www.ruby-forum.com/u/mariachi77)\
**Replies:** 5\
**Last updated:** [May 4, 2010, 7:37pm UTC](https://www.ruby-forum.com/t/getting-class-in-lib-folder-to-see-a-model-const-missing/188011 "2010-05-04T19:37:19Z")

</div>

Hello, I wrote a new class that I decided to put in the /app/lib folder. Part way through one of the methods, I call #new on the model, update some of the fields and then call #save (on the model). When I do this tho…

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

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