# Rails

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

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

---

## [Image thumbnails](https://www.ruby-forum.com/t/image-thumbnails/175580)

<div class="topic-metadata">

**Author:** [@camokatu](https://www.ruby-forum.com/u/camokatu)\
**Replies:** 1\
**Last updated:** [September 15, 2009, 11:59pm UTC](https://www.ruby-forum.com/t/image-thumbnails/175580 "2009-09-15T23:59:31Z")

</div>

Hi, I am trying to create image thumbnails and found this script: http://www.cleverleap.com/ruby-thumbnail-generator/. Looks like image is being scaled down and copied to cache folder, however nothing is being displa…

---

## [Class variables and servers](https://www.ruby-forum.com/t/class-variables-and-servers/175466)

<div class="topic-metadata">

**Author:** [@marmolin](https://www.ruby-forum.com/u/marmolin)\
**Replies:** 1\
**Last updated:** [September 15, 2009, 9:57pm UTC](https://www.ruby-forum.com/t/class-variables-and-servers/175466 "2009-09-15T21:57:45Z")

</div>

In my local development environment I define a class variabel @@has:flock? in a modele that is included in controllers so I can reset this variable in each controller that has to change it The code in the module is m…

---

## [Unit Testing of Routes](https://www.ruby-forum.com/t/unit-testing-of-routes/175547)

<div class="topic-metadata">

**Author:** [@icke](https://www.ruby-forum.com/u/icke)\
**Replies:** 3\
**Last updated:** [September 15, 2009, 8:33pm UTC](https://www.ruby-forum.com/t/unit-testing-of-routes/175547 "2009-09-15T20:33:27Z")

</div>

Hi, I am trying to pull together a unit testing for routes but I am getting confused. I have read AWDWR section 21.4 which explains how to code the assertions. also basically says the same. The problem I have is w…

---

## [Cruisecontrol.rb and metric\_fu](https://www.ruby-forum.com/t/cruisecontrol-rb-and-metric-fu/175572)

<div class="topic-metadata">

**Author:** [@phibo](https://www.ruby-forum.com/u/phibo)\
**Replies:** 0\
**Last updated:** [September 15, 2009, 6:45pm UTC](https://www.ruby-forum.com/t/cruisecontrol-rb-and-metric-fu/175572 "2009-09-15T18:45:10Z")

</div>

i want to use cruisecontrol.rb to run ‘rake test’ (every time a new revision is in the svn repo) and ‘rake metrics:all’ (let’s say every 24 hours). how do i have to configure cruisecontrol.rb? both rake tasks work. ho…

---

## [Finding unique matches between two tables](https://www.ruby-forum.com/t/finding-unique-matches-between-two-tables/175559)

<div class="topic-metadata">

**Author:** [@trevoke](https://www.ruby-forum.com/u/trevoke)\
**Replies:** 5\
**Last updated:** [September 15, 2009, 6:19pm UTC](https://www.ruby-forum.com/t/finding-unique-matches-between-two-tables/175559 "2009-09-15T18:19:08Z")

</div>

This may be very simple, but I’m getting my feet tangled within Rails. How do I find the unique matches (same name, dob, ssn) between two tables? CREATE TABLE “patientsingm” (“id” INTEGER PRIMARY KEY AUTOINCREMENT NO…

---

## [Flex plugin for rails](https://www.ruby-forum.com/t/flex-plugin-for-rails/175564)

<div class="topic-metadata">

**Author:** [@avinash\_y](https://www.ruby-forum.com/u/avinash_y)\
**Replies:** 0\
**Last updated:** [September 15, 2009, 5:55pm UTC](https://www.ruby-forum.com/t/flex-plugin-for-rails/175564 "2009-09-15T17:55:24Z")

</div>

Hi, Im pretty sure Im missing something terribly, I’ve been looking around for a flex plugin for rails which can work easily and which can optimize considerable amount of data transfer, and am confused between rubyam…

---

## [Form helpers and partial](https://www.ruby-forum.com/t/form-helpers-and-partial/175563)

<div class="topic-metadata">

**Author:** [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Replies:** 2\
**Last updated:** [September 15, 2009, 5:53pm UTC](https://www.ruby-forum.com/t/form-helpers-and-partial/175563 "2009-09-15T17:53:39Z")

</div>

Hi, I’m trying to use a partial in my form (Rails 2.3.4), and the docs I see say I can do this: edit.html.erb: \<% form\_for(@course) do |f| %\> \<%= render :partial =\> f %\> \<%= f.submit "Update" %\> \<% end %\> \_form.…

---

## [Constant error in active\_resource/base](https://www.ruby-forum.com/t/constant-error-in-active-resource-base/175562)

<div class="topic-metadata">

**Author:** [@quinn](https://www.ruby-forum.com/u/quinn)\
**Replies:** 0\
**Last updated:** [September 15, 2009, 5:15pm UTC](https://www.ruby-forum.com/t/constant-error-in-active-resource-base/175562 "2009-09-15T17:15:35Z")

</div>

I am using activeresource 2.3.3 I was using ActiveResource today and it seemed to be choking on namespaced xml, like this: media:group on line 1057 it erred with “Wrong constant name Media:group” first i tried on li…

---

## [Hypothetical Question about Views](https://www.ruby-forum.com/t/hypothetical-question-about-views/175505)

<div class="topic-metadata">

**Author:** [@mercurykjb](https://www.ruby-forum.com/u/mercurykjb)\
**Replies:** 5\
**Last updated:** [September 15, 2009, 5:01pm UTC](https://www.ruby-forum.com/t/hypothetical-question-about-views/175505 "2009-09-15T17:01:32Z")

</div>

This is purely for curiosity’s sake: If I have a simple controller method: def index @thing = Thing.all respond\_to do |format| format.js end end And I’d like to call the ‘index’ controller method from three diffe…

---

## [Before\_Filter question](https://www.ruby-forum.com/t/before-filter-question/175550)

<div class="topic-metadata">

**Author:** [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Replies:** 6\
**Last updated:** [September 15, 2009, 4:37pm UTC](https://www.ruby-forum.com/t/before-filter-question/175550 "2009-09-15T16:37:06Z")

</div>

Guyz, I am having a question for you… Scenario is i am using before\_filter in controller ABC to check that wheather user is administrator or not … and if not then it can show user only one page to user … did it like …

---

## [Rails & .ejs.erb](https://www.ruby-forum.com/t/rails-ejs-erb/175556)

<div class="topic-metadata">

**Author:** [@bbnnt](https://www.ruby-forum.com/u/bbnnt)\
**Replies:** 0\
**Last updated:** [September 15, 2009, 3:45pm UTC](https://www.ruby-forum.com/t/rails-ejs-erb/175556 "2009-09-15T15:45:39Z")

</div>

I have some trouble using this type of tools, the format.js from to the controllers to the {action}.js.erb in the view filesâ€¦ Trying to put some onubtrusiveness int my developpmentâ€¦ Everything’s working smoothlyâ€…

---

## [Paperclip attachment to AWS - ActiveRecord::AssociationTypeMismatch](https://www.ruby-forum.com/t/paperclip-attachment-to-aws-activerecord-associationtypemismatch/175263)

<div class="topic-metadata">

**Author:** [@jasongarber](https://www.ruby-forum.com/u/jasongarber)\
**Replies:** 4\
**Last updated:** [September 15, 2009, 2:42pm UTC](https://www.ruby-forum.com/t/paperclip-attachment-to-aws-activerecord-associationtypemismatch/175263 "2009-09-15T14:42:14Z")

</div>

Hi, I have been trying to do this for a few days now and cannot figure it out. I would be very grateful is anyone can help me I am trying to upload an attachment to AWS, S3 using paperclip, however every time I keep …

---

## [Association problem](https://www.ruby-forum.com/t/association-problem/175551)

<div class="topic-metadata">

**Author:** [@Doloo](https://www.ruby-forum.com/u/Doloo)\
**Replies:** 2\
**Last updated:** [September 15, 2009, 2:32pm UTC](https://www.ruby-forum.com/t/association-problem/175551 "2009-09-15T14:32:52Z")

</div>

Hi, I’m new to ruby on rails. So i think i have association problems. Given the three model classes with their associations: user.rb class User \< ActiveRecord::Base has\_many :product\_groups has\_many :products, :throu…

---

## [Liquid assign\_to](https://www.ruby-forum.com/t/liquid-assign-to/175552)

<div class="topic-metadata">

**Author:** [@pubclub](https://www.ruby-forum.com/u/pubclub)\
**Replies:** 0\
**Last updated:** [September 15, 2009, 2:32pm UTC](https://www.ruby-forum.com/t/liquid-assign-to/175552 "2009-09-15T14:32:09Z")

</div>

Hello using liquid markup i am trying to do the following. {{ ‘holiday’ | album\_thumbs | assign\_to ‘asset\_list’ }} {% for asset in asset\_list %} "link: " + {{ asset | asset\_path }} {% endfor %} It should return a li…

---

## [Adding a ruby library built using swig](https://www.ruby-forum.com/t/adding-a-ruby-library-built-using-swig/175477)

<div class="topic-metadata">

**Author:** [@lyes](https://www.ruby-forum.com/u/lyes)\
**Replies:** 3\
**Last updated:** [September 15, 2009, 2:29pm UTC](https://www.ruby-forum.com/t/adding-a-ruby-library-built-using-swig/175477 "2009-09-15T14:29:21Z")

</div>

Hello! I have wrapped a c library I have made into ruby using swig now I want to use it in a rails project I have already tested my library with a ruby script and it worked well I added the path to the swig generated…

---

## [Setup has\_many routes](https://www.ruby-forum.com/t/setup-has-many-routes/175546)

<div class="topic-metadata">

**Author:** [@jamal](https://www.ruby-forum.com/u/jamal)\
**Replies:** 1\
**Last updated:** [September 15, 2009, 1:46pm UTC](https://www.ruby-forum.com/t/setup-has-many-routes/175546 "2009-09-15T13:46:26Z")

</div>

Hi, I’m trying to accomplices this with REST :slight\_smile: http://localhost:3000/admin/projects/11/tasks/assigns/:user\_id This is my route config. map.namespace :admin do |admin| admin.resources :projects, :has\_man…

---

## [Nested Routes Best Practices](https://www.ruby-forum.com/t/nested-routes-best-practices/175465)

<div class="topic-metadata">

**Author:** [@AppleII717](https://www.ruby-forum.com/u/AppleII717)\
**Replies:** 2\
**Last updated:** [September 15, 2009, 1:20pm UTC](https://www.ruby-forum.com/t/nested-routes-best-practices/175465 "2009-09-15T13:20:17Z")

</div>

In a scaffold generated models, I have: List has\_many Items. I then modify the routing: map.resources :lists, :shallow =\> true, :has\_many =\> :items map.resources :items, :only =\> \[:index\] # thought was that admin may …

---

## [\[ANN\] Learnivore.com, ruby/rails screencasts aggregator](https://www.ruby-forum.com/t/ann-learnivore-com-ruby-rails-screencasts-aggregator/175535)

<div class="topic-metadata">

**Author:** [@thbar](https://www.ruby-forum.com/u/thbar)\
**Replies:** 2\
**Last updated:** [September 15, 2009, 1:00pm UTC](https://www.ruby-forum.com/t/ann-learnivore-com-ruby-rails-screencasts-aggregator/175535 "2009-09-15T13:00:22Z")

</div>

Hi, a project I’ve been building on the side: http://www.learnivore.com It’s a screencasts aggregator - so far I’ve indexed the most well- known ruby/rails screencasts publishers, including: pragprogs railscasts pe…

---

## [Multiple Nested Resources and Routes](https://www.ruby-forum.com/t/multiple-nested-resources-and-routes/175536)

<div class="topic-metadata">

**Author:** [@jayoshi13](https://www.ruby-forum.com/u/jayoshi13)\
**Replies:** 2\
**Last updated:** [September 15, 2009, 12:34pm UTC](https://www.ruby-forum.com/t/multiple-nested-resources-and-routes/175536 "2009-09-15T12:34:35Z")

</div>

Hi A noob question on using routes with multiple nested resources - The nested resources are as follows - -\> Projects -\> Assessments -\>Findings A Project has many Assessments, an Assessment has many Findings. At p…

---

## [Noob collection\_select question](https://www.ruby-forum.com/t/noob-collection-select-question/170493)

<div class="topic-metadata">

**Author:** [@spencer](https://www.ruby-forum.com/u/spencer)\
**Replies:** 2\
**Last updated:** [September 15, 2009, 11:31am UTC](https://www.ruby-forum.com/t/noob-collection-select-question/170493 "2009-09-15T11:31:45Z")

</div>

Hi, I have a question about the collection\_select helper and how it saves using the update\_attributes command. If I have a form\_for using a model instance such as @person and have elements inside it like: \<%= f.text\_…

---

## [Error "undefined method 'stringify\_keys' for "tag1":String" on multi-model form submission](https://www.ruby-forum.com/t/error-undefined-method-stringify-keys-for-tag1-string-on-multi-model-form-submission/175537)

<div class="topic-metadata">

**Author:** [@jonathan](https://www.ruby-forum.com/u/jonathan)\
**Replies:** 0\
**Last updated:** [September 15, 2009, 10:10am UTC](https://www.ruby-forum.com/t/error-undefined-method-stringify-keys-for-tag1-string-on-multi-model-form-submission/175537 "2009-09-15T10:10:00Z")

</div>

I’m following the tutorial on Getting Started with Rails — Ruby on Rails Guides, and got stuck on the very last section, “Building a Multi-Model Form”. I’m trying to do two models in the same form, and I get the follo…

---

## [Anyone using Lockdown?](https://www.ruby-forum.com/t/anyone-using-lockdown/175534)

<div class="topic-metadata">

**Author:** [@philswenson](https://www.ruby-forum.com/u/philswenson)\
**Replies:** 0\
**Last updated:** [September 15, 2009, 10:09am UTC](https://www.ruby-forum.com/t/anyone-using-lockdown/175534 "2009-09-15T10:09:24Z")

</div>

I’ve stumbled across this gem that seem to be quite complete for group permissions and rights. The only problem is that there are no examples of how to use it in a real world (eg how to assign permissions from a UI, c…

---

## [Right way to create a route](https://www.ruby-forum.com/t/right-way-to-create-a-route/175498)

<div class="topic-metadata">

**Author:** [@mlittle](https://www.ruby-forum.com/u/mlittle)\
**Replies:** 11\
**Last updated:** [September 15, 2009, 7:43am UTC](https://www.ruby-forum.com/t/right-way-to-create-a-route/175498 "2009-09-15T07:43:38Z")

</div>

I have users, children, events and parents (yes this is really the names). children and events belong to users. Parents belong to children. this is what I have now: map.resources :users do |user| user.resources :note…

---

## [Integrate moneybookers](https://www.ruby-forum.com/t/integrate-moneybookers/175528)

<div class="topic-metadata">

**Author:** [@saurabhpurnaye](https://www.ruby-forum.com/u/saurabhpurnaye)\
**Replies:** 0\
**Last updated:** [September 15, 2009, 7:31am UTC](https://www.ruby-forum.com/t/integrate-moneybookers/175528 "2009-09-15T07:31:20Z")

</div>

Hi All, I’m facing a problem with moneybookers api integration, I used the sample HTML application generated by moneybookers api and specified the return\_url variable as my localhost:3000, but not getting how to colle…

---

## [How to bind controller and model with different names?](https://www.ruby-forum.com/t/how-to-bind-controller-and-model-with-different-names/175521)

<div class="topic-metadata">

**Author:** [@anton](https://www.ruby-forum.com/u/anton)\
**Replies:** 0\
**Last updated:** [September 15, 2009, 6:09am UTC](https://www.ruby-forum.com/t/how-to-bind-controller-and-model-with-different-names/175521 "2009-09-15T06:09:41Z")

</div>

I’m quite new in ruby.I’m doing simple guestbook. There are feedback controller and message model with a scaffolding. I made scaffolding for “message” model for example reasons, but when I send some data via feedback/…

---

## [How to convert user input hours, minutes, seconds - both ways](https://www.ruby-forum.com/t/how-to-convert-user-input-hours-minutes-seconds-both-ways/175518)

<div class="topic-metadata">

**Author:** [@metanoize](https://www.ruby-forum.com/u/metanoize)\
**Replies:** 1\
**Last updated:** [September 15, 2009, 5:59am UTC](https://www.ruby-forum.com/t/how-to-convert-user-input-hours-minutes-seconds-both-ways/175518 "2009-09-15T05:59:37Z")

</div>

In my model I have an attribute “duration” (seconds as an integer) But the views new/edit have input for: hours, minutes, seconds. Should I have in model (attr\_accessor :hours, :minutes, :seconds) then how do I conver…

---

## [2 autocompleters](https://www.ruby-forum.com/t/2-autocompleters/174185)

<div class="topic-metadata">

**Author:** [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Replies:** 2\
**Last updated:** [September 15, 2009, 4:55am UTC](https://www.ruby-forum.com/t/2-autocompleters/174185 "2009-09-15T04:55:38Z")

</div>

Is there a way to get 2 autcompleters using the same fields to work on the same page? I have something similar to twitter autocomplete at the top of the form and I am also trying to get another one working for an inl…

---

## [Hash to URL](https://www.ruby-forum.com/t/hash-to-url/175514)

<div class="topic-metadata">

**Author:** [@rereis](https://www.ruby-forum.com/u/rereis)\
**Replies:** 0\
**Last updated:** [September 15, 2009, 2:48am UTC](https://www.ruby-forum.com/t/hash-to-url/175514 "2009-09-15T02:48:25Z")

</div>

I have the following hash myhash { “inter” =\> “team”, “shirt” =\> “stripe” } desired output inter=team&shirt=stripe I tried url\_for myhash but got undefined method \`url\_for’ for thanks

---

## [Inlining js responses from an action](https://www.ruby-forum.com/t/inlining-js-responses-from-an-action/175476)

<div class="topic-metadata">

**Author:** [@indigo0086](https://www.ruby-forum.com/u/indigo0086)\
**Replies:** 2\
**Last updated:** [September 15, 2009, 12:07am UTC](https://www.ruby-forum.com/t/inlining-js-responses-from-an-action/175476 "2009-09-15T00:07:06Z")

</div>

I am learning rails and encountered the respond\_to for a javascript response, and was wondering if there is a way to inline it within the actual respond\_to block as opposde to cluttering up my project directory with r…

---

## [Model.valid? = false, the model still saves](https://www.ruby-forum.com/t/model-valid-false-the-model-still-saves/175503)

<div class="topic-metadata">

**Author:** [@mercurykjb](https://www.ruby-forum.com/u/mercurykjb)\
**Replies:** 7\
**Last updated:** [September 14, 2009, 11:52pm UTC](https://www.ruby-forum.com/t/model-valid-false-the-model-still-saves/175503 "2009-09-14T23:52:48Z")

</div>

I have a model w/ three validations in PaymentApplication: validate :total\_applications\_cannot\_exceed\_payment\_amount validate :cannot\_exceed\_activity\_price validates\_numericality\_of :amount I can confirm that one of …

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

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