# Rails

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

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

---

## [Setting Quantity on Product within Shopping Cart](https://www.ruby-forum.com/t/setting-quantity-on-product-within-shopping-cart/148972)

<div class="topic-metadata">

**Author:** [@bobm](https://www.ruby-forum.com/u/bobm)\
**Replies:** 0\
**Last updated:** [September 18, 2008, 8:45pm UTC](https://www.ruby-forum.com/t/setting-quantity-on-product-within-shopping-cart/148972 "2008-09-18T20:45:56Z")

</div>

AWDR depot example always sets quantity to 1 when it adds a product to the cart. Is there an example anywhere which lets the user set quantity to whatever as it adds the product. I cant see letting a user add a produc…

---

## [How to loop through element after an inspect?](https://www.ruby-forum.com/t/how-to-loop-through-element-after-an-inspect/148885)

<div class="topic-metadata">

**Author:** [@jdunneuk](https://www.ruby-forum.com/u/jdunneuk)\
**Replies:** 4\
**Last updated:** [September 18, 2008, 8:14pm UTC](https://www.ruby-forum.com/t/how-to-loop-through-element-after-an-inspect/148885 "2008-09-18T20:14:56Z")

</div>

records = YAML.load\_file("myfile.yml") records.each do |record| puts record.inspect end I want to be able to read an arbitrary yml file, then print out each of the element one by one. In the above example, my output…

---

## [How to create hash of hash?](https://www.ruby-forum.com/t/how-to-create-hash-of-hash/148891)

<div class="topic-metadata">

**Author:** [@jdunneuk](https://www.ruby-forum.com/u/jdunneuk)\
**Replies:** 4\
**Last updated:** [September 18, 2008, 7:08pm UTC](https://www.ruby-forum.com/t/how-to-create-hash-of-hash/148891 "2008-09-18T19:08:35Z")

</div>

hashx = { key1 =\> {key1 =\> key1val1, key2 =\> key1val2}, key2 =\> {key1 =\> key2val1, key2 =\> key2val2} } If I want to insert a hash in the 1st level, how to do? key3\_hash = {key1 =\> key3val1, key2 =\> key3val2} hashx\[ke…

---

## [Routing.rb help please](https://www.ruby-forum.com/t/routing-rb-help-please/148963)

<div class="topic-metadata">

**Author:** [@spokra](https://www.ruby-forum.com/u/spokra)\
**Replies:** 0\
**Last updated:** [September 18, 2008, 7:02pm UTC](https://www.ruby-forum.com/t/routing-rb-help-please/148963 "2008-09-18T19:02:37Z")

</div>

I have the following URL the dist lat lng all can have a decimal point in them… I saw a really old post that suggested to use the map with a requirements list like in the rout statement. Well it doesn;t parse it…

---

## ["xxx\_id may not be null" when saving many to many joined objects](https://www.ruby-forum.com/t/xxx-id-may-not-be-null-when-saving-many-to-many-joined-objects/148941)

<div class="topic-metadata">

**Author:** [@pat.turner](https://www.ruby-forum.com/u/pat.turner)\
**Replies:** 1\
**Last updated:** [September 18, 2008, 5:53pm UTC](https://www.ruby-forum.com/t/xxx-id-may-not-be-null-when-saving-many-to-many-joined-objects/148941 "2008-09-18T17:53:55Z")

</div>

Hi, I have two model classes; Tune and Title and they are joined in a many to many relationship through a Variation class. Here’s some stub code of the models: class Tune \< ActiveRecord::Base has\_many :variations,…

---

## [Get a list of all foreign keys (with their respective tables](https://www.ruby-forum.com/t/get-a-list-of-all-foreign-keys-with-their-respective-tables/148849)

<div class="topic-metadata">

**Author:** [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Replies:** 6\
**Last updated:** [September 18, 2008, 5:41pm UTC](https://www.ruby-forum.com/t/get-a-list-of-all-foreign-keys-with-their-respective-tables/148849 "2008-09-18T17:41:11Z")

</div>

As a general speed-up, i want to index all of my foreign keys. Rather than hand-code them all into a migration (thus probably making some mistakes), i’d like to make a little script, or method to do it. I thought of …

---

## [Detect client time\_zone](https://www.ruby-forum.com/t/detect-client-time-zone/148959)

<div class="topic-metadata">

**Author:** [@jeanluca](https://www.ruby-forum.com/u/jeanluca)\
**Replies:** 0\
**Last updated:** [September 18, 2008, 5:21pm UTC](https://www.ruby-forum.com/t/detect-client-time-zone/148959 "2008-09-18T17:21:26Z")

</div>

Hi All How do I determine (on the server-side) for an incoming request the time zone of the client. I’ve studied the ‘request’ parameter but didn’t see anything like a TZ. Any suggestion how to do this ? Cheers LuC…

---

## [Jrails or jq4r](https://www.ruby-forum.com/t/jrails-or-jq4r/148949)

<div class="topic-metadata">

**Author:** [@pankaj](https://www.ruby-forum.com/u/pankaj)\
**Replies:** 1\
**Last updated:** [September 18, 2008, 4:40pm UTC](https://www.ruby-forum.com/t/jrails-or-jq4r/148949 "2008-09-18T16:40:48Z")

</div>

jrails or jq4r(http://jq4r.blogspot.com/ ) are 2 options i found to integrate jquery with rails. which one do u prefer n y?

---

## [Respond\_to js and redirect - inconsistent results forwarding JS requirement](https://www.ruby-forum.com/t/respond-to-js-and-redirect-inconsistent-results-forwarding-js-requirement/148942)

<div class="topic-metadata">

**Author:** [@reynar](https://www.ruby-forum.com/u/reynar)\
**Replies:** 1\
**Last updated:** [September 18, 2008, 4:26pm UTC](https://www.ruby-forum.com/t/respond-to-js-and-redirect-inconsistent-results-forwarding-js-requirement/148942 "2008-09-18T16:26:01Z")

</div>

Hi, I have the following simple piece of code in one of my actions: respond\_to do |format| format.js { redirect\_to basket\_url } end In Safari this works fine and the basket controller’s show action is called and re…

---

## [RESTful routes with :has\_many](https://www.ruby-forum.com/t/restful-routes-with-has-many/148951)

<div class="topic-metadata">

**Author:** [@Christoph\_Petschnig](https://www.ruby-forum.com/u/Christoph_Petschnig)\
**Replies:** 1\
**Last updated:** [September 18, 2008, 4:19pm UTC](https://www.ruby-forum.com/t/restful-routes-with-has-many/148951 "2008-09-18T16:19:28Z")

</div>

Hello, I don’t know if this is a bug or a feature. When defining routes like: map.resources :as, :has\_many =\> ‘bs’ map.resource :b, :has\_many =\> ‘cs’ map.resource :c I get: new\_b\_c GET /b/cs/new {:controller…

---

## [Serialize object and store into database](https://www.ruby-forum.com/t/serialize-object-and-store-into-database/134417)

<div class="topic-metadata">

**Author:** [@Tarscher](https://www.ruby-forum.com/u/Tarscher)\
**Replies:** 4\
**Last updated:** [September 18, 2008, 4:01pm UTC](https://www.ruby-forum.com/t/serialize-object-and-store-into-database/134417 "2008-09-18T16:01:14Z")

</div>

Hi all, I want to serialize an object and store it into the database. This seems a trivial task but Google gives me no useful hints. Can someone please give me a little help on what methods I can use to serialize and…

---

## [Problem with set\_table\_name](https://www.ruby-forum.com/t/problem-with-set-table-name/148932)

<div class="topic-metadata">

**Author:** [@martin\_mercy2001](https://www.ruby-forum.com/u/martin_mercy2001)\
**Replies:** 3\
**Last updated:** [September 18, 2008, 3:50pm UTC](https://www.ruby-forum.com/t/problem-with-set-table-name/148932 "2008-09-18T15:50:35Z")

</div>

Dear all, I am in process of interfacing web with a chat tool. Iam using rails 2.0.2 and mysql. i have created a database chat\_development, with table names userinfos, clientinfos. I dont want the defaults, i need t…

---

## [Change\_table is not working on production server](https://www.ruby-forum.com/t/change-table-is-not-working-on-production-server/148928)

<div class="topic-metadata">

**Author:** [@fipa](https://www.ruby-forum.com/u/fipa)\
**Replies:** 2\
**Last updated:** [September 18, 2008, 3:08pm UTC](https://www.ruby-forum.com/t/change-table-is-not-working-on-production-server/148928 "2008-09-18T15:08:52Z")

</div>

Hi, I have added to my migration a change\_table action. It works fine on my local dev machine, but on the production server the migration does not happen although the schema.rb file gets correctly updated. I am runn…

---

## [(no subject)](https://www.ruby-forum.com/t/no-subject/148934)

<div class="topic-metadata">

**Author:** [@gilbertsavier](https://www.ruby-forum.com/u/gilbertsavier)\
**Replies:** 2\
**Last updated:** [September 18, 2008, 2:51pm UTC](https://www.ruby-forum.com/t/no-subject/148934 "2008-09-18T14:51:13Z")

</div>

Hello all. I have been trying to develop an authentication program. I have been able to redirect a user to any page but have not been able to pesonalise it so that users can only access their personal accounts. thank…

---

## [Auto-complete in IE](https://www.ruby-forum.com/t/auto-complete-in-ie/148936)

<div class="topic-metadata">

**Author:** [@ravikanth](https://www.ruby-forum.com/u/ravikanth)\
**Replies:** 0\
**Last updated:** [September 18, 2008, 2:22pm UTC](https://www.ruby-forum.com/t/auto-complete-in-ie/148936 "2008-09-18T14:22:02Z")

</div>

auto-complete drop down is going behind the text boxes in IE and not visible in those areas and i used z-index, but IE is not recognizing z-index. any help ?

---

## [Schema.rb gotcha and how to load default entries in DB](https://www.ruby-forum.com/t/schema-rb-gotcha-and-how-to-load-default-entries-in-db/148254)

<div class="topic-metadata">

**Author:** [@fipa](https://www.ruby-forum.com/u/fipa)\
**Replies:** 3\
**Last updated:** [September 18, 2008, 1:53pm UTC](https://www.ruby-forum.com/t/schema-rb-gotcha-and-how-to-load-default-entries-in-db/148254 "2008-09-18T13:53:11Z")

</div>

Hi list, I just wanted to let you know: Yes you must check in the schema.rb into your SCM. Yes you must use db:schema:load Be careful schema.rb won’t allow you to load “default” entries into the DB My question is, i…

---

## [Mongrel cluster and threads](https://www.ruby-forum.com/t/mongrel-cluster-and-threads/148931)

<div class="topic-metadata">

**Author:** [@shaggyrd](https://www.ruby-forum.com/u/shaggyrd)\
**Replies:** 1\
**Last updated:** [September 18, 2008, 1:19pm UTC](https://www.ruby-forum.com/t/mongrel-cluster-and-threads/148931 "2008-09-18T13:19:11Z")

</div>

Hi guys, I’m running 6 instances of mongrel in a production environment and I have this preformance problem. I’m calling a web service that sometimes take up to 11 seconds to give me a response. In the meantime mongr…

---

## [Truncate problem](https://www.ruby-forum.com/t/truncate-problem/148925)

<div class="topic-metadata">

**Author:** [@sunfish](https://www.ruby-forum.com/u/sunfish)\
**Replies:** 4\
**Last updated:** [September 18, 2008, 12:49pm UTC](https://www.ruby-forum.com/t/truncate-problem/148925 "2008-09-18T12:49:29Z")

</div>

Hi, In my application I am using a list box where i am showing different groups name. I am using \<%=truncate\_html\_strip\_textual\_wrap(group.name,28,28)%\> for truncating the name but it gives me problem when group nam…

---

## [Help with object level roles & permissions](https://www.ruby-forum.com/t/help-with-object-level-roles-permissions/136913)

<div class="topic-metadata">

**Author:** [@chunkyslink](https://www.ruby-forum.com/u/chunkyslink)\
**Replies:** 2\
**Last updated:** [September 18, 2008, 12:23pm UTC](https://www.ruby-forum.com/t/help-with-object-level-roles-permissions/136913 "2008-09-18T12:23:00Z")

</div>

I have an authentication system set up via the activefx tutorial for restful\_authentication. I now need to implement roles and permissions on a per object basis, as opposed to site wide, ‘Is this user an administrator…

---

## [Scrape web sites with Mechanize and Hpricot](https://www.ruby-forum.com/t/scrape-web-sites-with-mechanize-and-hpricot/148904)

<div class="topic-metadata">

**Author:** [@David\_Cherner](https://www.ruby-forum.com/u/David_Cherner)\
**Replies:** 0\
**Last updated:** [September 18, 2008, 9:00am UTC](https://www.ruby-forum.com/t/scrape-web-sites-with-mechanize-and-hpricot/148904 "2008-09-18T09:00:14Z")

</div>

Hello, We are looking for someone to help complete a project, a rails app which scrapes job listings from numerous web sites. At this point, the bulk of the work to be completed is just telling Mechanize how to navig…

---

## [Remote\_form\_for not passing element parameters](https://www.ruby-forum.com/t/remote-form-for-not-passing-element-parameters/148880)

<div class="topic-metadata">

**Author:** [@deadinplastic](https://www.ruby-forum.com/u/deadinplastic)\
**Replies:** 2\
**Last updated:** [September 18, 2008, 1:58am UTC](https://www.ruby-forum.com/t/remote-form-for-not-passing-element-parameters/148880 "2008-09-18T01:58:55Z")

</div>

Hi, I am trying to get a remote\_form\_for to work, and I have it currently making the request and updating the div etc… but when it makes the request it is not passing the value of the collection select in the paramete…

---

## [Command Line Apps "Beach ball"](https://www.ruby-forum.com/t/command-line-apps-beach-ball/148875)

<div class="topic-metadata">

**Author:** [@sjames](https://www.ruby-forum.com/u/sjames)\
**Replies:** 1\
**Last updated:** [September 17, 2008, 11:59pm UTC](https://www.ruby-forum.com/t/command-line-apps-beach-ball/148875 "2008-09-17T23:59:20Z")

</div>

I find myself writing a lot of scripts at work lately that generate reports on the command line. I was thinking it might be kind of fun to have a “beach ball” effect on the cursor to let the user know stuff is happen…

---

## [Count optimization](https://www.ruby-forum.com/t/count-optimization/148719)

<div class="topic-metadata">

**Author:** [@surge](https://www.ruby-forum.com/u/surge)\
**Replies:** 19\
**Last updated:** [September 17, 2008, 11:45pm UTC](https://www.ruby-forum.com/t/count-optimization/148719 "2008-09-17T23:45:51Z")

</div>

Sorry if this has been asked before… I have a model named ticket (like a trouble ticket) and a ticket can have many issues. When I list tickets in a table I want to output the number of issues each ticket has. So, in …

---

## [Open Invitation to Join with DeveloperWiki Knowledge base](https://www.ruby-forum.com/t/open-invitation-to-join-with-developerwiki-knowledge-base/148881)

<div class="topic-metadata">

**Author:** [@Randika](https://www.ruby-forum.com/u/Randika)\
**Replies:** 0\
**Last updated:** [September 17, 2008, 11:41pm UTC](https://www.ruby-forum.com/t/open-invitation-to-join-with-developerwiki-knowledge-base/148881 "2008-09-17T23:41:44Z")

</div>

Dear Developers,IT Professionals, “We are building a online encyclopedia for developers” and we need your contribution to make it even better. So here is our invitation for those who happy to contribute as editors, re…

---

## [Ruby on Rails Resource required in NJ](https://www.ruby-forum.com/t/ruby-on-rails-resource-required-in-nj/148882)

<div class="topic-metadata">

**Author:** [@Chandra\_kant](https://www.ruby-forum.com/u/Chandra_kant)\
**Replies:** 0\
**Last updated:** [September 17, 2008, 11:41pm UTC](https://www.ruby-forum.com/t/ruby-on-rails-resource-required-in-nj/148882 "2008-09-17T23:41:44Z")

</div>

Hi, My name is ChandraKant, I am a working as team lead - recruitments with International Business Solutions. Ltd, NJ. My client in looking for a Ruby on rails resource (w/Java) work location will be New Jersey, this…

---

## [Fetcher/god script not working](https://www.ruby-forum.com/t/fetcher-god-script-not-working/148877)

<div class="topic-metadata">

**Author:** [@blinking\_bear](https://www.ruby-forum.com/u/blinking_bear)\
**Replies:** 0\
**Last updated:** [September 17, 2008, 10:44pm UTC](https://www.ruby-forum.com/t/fetcher-god-script-not-working/148877 "2008-09-17T22:44:54Z")

</div>

I’m trying to get a god script going to monitor a mail fetcher as outlined in Advanced rails recipse and mms2r peepcode. My script is: RAILS\_ROOT = “/Users/foobar/some-app” God.watch do |w| FETCHER\_SCRIPT = “#{RAILS…

---

## [Rails hook for post-processing after page is rendered?](https://www.ruby-forum.com/t/rails-hook-for-post-processing-after-page-is-rendered/148723)

<div class="topic-metadata">

**Author:** [@colinkelley](https://www.ruby-forum.com/u/colinkelley)\
**Replies:** 5\
**Last updated:** [September 17, 2008, 10:41pm UTC](https://www.ruby-forum.com/t/rails-hook-for-post-processing-after-page-is-rendered/148723 "2008-09-17T22:41:58Z")

</div>

We’re starting to notice a pattern in our Rails app that there are asynchronous actions we’d like to take after the response is rendered and shipped to the browser. Examples including queuing email and writing statis…

---

## [Problem with url\_for and namespaces (in in\_place\_editing)](https://www.ruby-forum.com/t/problem-with-url-for-and-namespaces-in-in-place-editing/148874)

<div class="topic-metadata">

**Author:** [@elioncho](https://www.ruby-forum.com/u/elioncho)\
**Replies:** 0\
**Last updated:** [September 17, 2008, 10:32pm UTC](https://www.ruby-forum.com/t/problem-with-url-for-and-namespaces-in-in-place-editing/148874 "2008-09-17T22:32:35Z")

</div>

Hello, Well I have been working with the in\_place\_editing plugin and have been running into the following error: Unknown action No action responded to 1 My code on my view is below: \<%= @permission.name %\> \<%= in\_…

---

## [Rails 2.1 cache problem](https://www.ruby-forum.com/t/rails-2-1-cache-problem/143987)

<div class="topic-metadata">

**Author:** [@Dmitrij\_S](https://www.ruby-forum.com/u/Dmitrij_S)\
**Replies:** 3\
**Last updated:** [September 17, 2008, 10:20pm UTC](https://www.ruby-forum.com/t/rails-2-1-cache-problem/143987 "2008-09-17T22:20:46Z")

</div>

Hi, class User \< ActiveRecord::Base def self.get\_cache(id) Rails.cache.fetch(“users/#{id}”) { find(id) } end end Accesing a cached model object immediately after caching works as expected: User.get\_cache(1).cache…

---

## [Permalink\_fu and classes with different primary\_key than id?](https://www.ruby-forum.com/t/permalink-fu-and-classes-with-different-primary-key-than-id/148869)

<div class="topic-metadata">

**Author:** [@phil](https://www.ruby-forum.com/u/phil)\
**Replies:** 0\
**Last updated:** [September 17, 2008, 8:56pm UTC](https://www.ruby-forum.com/t/permalink-fu-and-classes-with-different-primary-key-than-id/148869 "2008-09-17T20:56:25Z")

</div>

Has anyone else had problems with this scenario? class Team \< ActiveRecord::Base Primary key self.primary\_key = ‘team\_id’ has\_many :players, :foreign\_key =\> :team\_id has\_permalink :city, :param =\> true end I am get…

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

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