# Rails

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

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

---

## [PDF document viewer in rails](https://www.ruby-forum.com/t/pdf-document-viewer-in-rails/175524)

<div class="topic-metadata">

**Author:** [@mahesh\_s](https://www.ruby-forum.com/u/mahesh_s)\
**Replies:** 8\
**Last updated:** [September 17, 2009, 1:10pm UTC](https://www.ruby-forum.com/t/pdf-document-viewer-in-rails/175524 "2009-09-17T13:10:56Z")

</div>

Hai guys i would like to show my pdf document into my app like scribd site show the document in their site i need a help how to implement the viewer into my app give me some reference for implement the viewer

---

## [Captcha without imagemagick and RMagick](https://www.ruby-forum.com/t/captcha-without-imagemagick-and-rmagick/175668)

<div class="topic-metadata">

**Author:** [@akramwasim1234](https://www.ruby-forum.com/u/akramwasim1234)\
**Replies:** 1\
**Last updated:** [September 17, 2009, 12:45pm UTC](https://www.ruby-forum.com/t/captcha-without-imagemagick-and-rmagick/175668 "2009-09-17T12:45:09Z")

</div>

Hi All, Can anybody say me any plugins which works for captcha without using Imagemagick and Rmagick

---

## [Load Error Using Mechanize Gem](https://www.ruby-forum.com/t/load-error-using-mechanize-gem/175664)

<div class="topic-metadata">

**Author:** [@Gary\_Massing](https://www.ruby-forum.com/u/Gary_Massing)\
**Replies:** 1\
**Last updated:** [September 17, 2009, 12:42pm UTC](https://www.ruby-forum.com/t/load-error-using-mechanize-gem/175664 "2009-09-17T12:42:48Z")

</div>

Hi, I’m getting a “Could not open any of \[xml2, xslt, exslt\] (LoadError)” error when trying to run a simple Ruby program taken from the EXAMPLES.rdoc file of the Mechanize gem. The error is in this line of the Nokogi…

---

## [Recent Script.aculo.us tutorial](https://www.ruby-forum.com/t/recent-script-aculo-us-tutorial/175625)

<div class="topic-metadata">

**Author:** [@oldbug](https://www.ruby-forum.com/u/oldbug)\
**Replies:** 6\
**Last updated:** [September 17, 2009, 11:34am UTC](https://www.ruby-forum.com/t/recent-script-aculo-us-tutorial/175625 "2009-09-17T11:34:12Z")

</div>

I would like to add a visual effect to one of my web pages and in the stage where I don’t know what I don’t know. I’ve talked to my buddy Google about this and (s)he has pointed me at a number of different web pages…

---

## [Collection\_select on controller update actions](https://www.ruby-forum.com/t/collection-select-on-controller-update-actions/175628)

<div class="topic-metadata">

**Author:** [@tony](https://www.ruby-forum.com/u/tony)\
**Replies:** 1\
**Last updated:** [September 17, 2009, 10:34am UTC](https://www.ruby-forum.com/t/collection-select-on-controller-update-actions/175628 "2009-09-17T10:34:01Z")

</div>

When doing a controller update operation, missing parameters are treated as unchanged. This is a great convention but I’m not sure how to handle this when using a collection\_select. If a user deselects all items in a…

---

## [Best way to test for existence in a joined model](https://www.ruby-forum.com/t/best-way-to-test-for-existence-in-a-joined-model/175645)

<div class="topic-metadata">

**Author:** [@Dudebot](https://www.ruby-forum.com/u/Dudebot)\
**Replies:** 5\
**Last updated:** [September 17, 2009, 9:29am UTC](https://www.ruby-forum.com/t/best-way-to-test-for-existence-in-a-joined-model/175645 "2009-09-17T09:29:37Z")

</div>

Hi all, given these relationships class Order \< ActiveRecord::Base belongs\_to :item class Item \< ActiveRecord::Base has\_many :orders @items = Item.find( :all ) @items.each do |item| … What’s the best way to test …

---

## [Jruby and ruby on rails corelation](https://www.ruby-forum.com/t/jruby-and-ruby-on-rails-corelation/175506)

<div class="topic-metadata">

**Author:** [@lali](https://www.ruby-forum.com/u/lali)\
**Replies:** 3\
**Last updated:** [September 17, 2009, 9:23am UTC](https://www.ruby-forum.com/t/jruby-and-ruby-on-rails-corelation/175506 "2009-09-17T09:23:37Z")

</div>

j2ee is quite heavy and bogus not easily usable language. however j2ee can work with very heavy sun boxes, due to this reason ruby has a swing calss jruby. how can we use some of the features f jruby with ruby on rail…

---

## [2 submit buttons, how to identify which pressed in the controller?](https://www.ruby-forum.com/t/2-submit-buttons-how-to-identify-which-pressed-in-the-controller/175531)

<div class="topic-metadata">

**Author:** [@matt](https://www.ruby-forum.com/u/matt)\
**Replies:** 7\
**Last updated:** [September 17, 2009, 5:11am UTC](https://www.ruby-forum.com/t/2-submit-buttons-how-to-identify-which-pressed-in-the-controller/175531 "2009-09-17T05:11:30Z")

</div>

Hi I have the following code: \<%= f.submit ‘First’, :class =\> “mybutton”, :myid=\> “xx” %\> \<%= f.submit ‘Second’ %\> I would have expected to use params\[:myid\] to check which submit button was pressed but it does not …

---

## [Using \_url helper in unit test](https://www.ruby-forum.com/t/using-url-helper-in-unit-test/175652)

<div class="topic-metadata">

**Author:** [@drewB](https://www.ruby-forum.com/u/drewB)\
**Replies:** 0\
**Last updated:** [September 17, 2009, 4:48am UTC](https://www.ruby-forum.com/t/using-url-helper-in-unit-test/175652 "2009-09-17T04:48:05Z")

</div>

I have a actionmailer model that send the user a URL to the website for account activation. In my unit tests for the model I want to ensure that the correct URL is being generated. In the test I have the following: …

---

## [Rails Polymorphic conundrum](https://www.ruby-forum.com/t/rails-polymorphic-conundrum/175598)

<div class="topic-metadata">

**Author:** [@thelemcke](https://www.ruby-forum.com/u/thelemcke)\
**Replies:** 3\
**Last updated:** [September 17, 2009, 1:38am UTC](https://www.ruby-forum.com/t/rails-polymorphic-conundrum/175598 "2009-09-17T01:38:20Z")

</div>

I’m making a database that requires many-to-many associations. Here’s the design: There is a class called ‘Owner’ that owns many ‘Boxes’, ‘Things’, ‘Doodads’, and ‘Thingamabobs’ ‘Boxes’ can have many ‘Things’, ‘Dood…

---

## [Find\_by\_sql - multiple selects, same statement SQL error](https://www.ruby-forum.com/t/find-by-sql-multiple-selects-same-statement-sql-error/175635)

<div class="topic-metadata">

**Author:** [@Gee-off](https://www.ruby-forum.com/u/Gee-off)\
**Replies:** 3\
**Last updated:** [September 17, 2009, 1:36am UTC](https://www.ruby-forum.com/t/find-by-sql-multiple-selects-same-statement-sql-error/175635 "2009-09-17T01:36:17Z")

</div>

I’m trying to get the following statement to work using variable substitution (it works if hard-code the where (med\_type) param in the inner SQL statement): med\_type = ‘game’ @mediaformats = MediaFormat.find\_by\_sql(“…

---

## [OR conditions on has\_and\_belongs\_to\_many?](https://www.ruby-forum.com/t/or-conditions-on-has-and-belongs-to-many/175638)

<div class="topic-metadata">

**Author:** [@jamal](https://www.ruby-forum.com/u/jamal)\
**Replies:** 1\
**Last updated:** [September 16, 2009, 10:37pm UTC](https://www.ruby-forum.com/t/or-conditions-on-has-and-belongs-to-many/175638 "2009-09-16T22:37:51Z")

</div>

Hi, I wonder how I can insert “OR” in has\_and\_belongs\_to\_many conditions? Code: has\_and\_belongs\_to\_many :projects, :conditions =\> \[“projects\_users.user\_id = 0”\] Console: user.projects SQL: Project Load (0.3ms) …

---

## [Wrong number of arguments (0 for 1)](https://www.ruby-forum.com/t/wrong-number-of-arguments-0-for-1/175634)

<div class="topic-metadata">

**Author:** [@RubyonRails\_newbie](https://www.ruby-forum.com/u/RubyonRails_newbie)\
**Replies:** 2\
**Last updated:** [September 16, 2009, 9:55pm UTC](https://www.ruby-forum.com/t/wrong-number-of-arguments-0-for-1/175634 "2009-09-16T21:55:59Z")

</div>

Hi everyone, I am running through the RailsSpace tutorial. I’m trying to figure out the advanced login section, which in short creates a cookie and an authorization token in the users table in the database. My troubl…

---

## [Reading file multiple field](https://www.ruby-forum.com/t/reading-file-multiple-field/175620)

<div class="topic-metadata">

**Author:** [@prashanth\_hiremath](https://www.ruby-forum.com/u/prashanth_hiremath)\
**Replies:** 3\
**Last updated:** [September 16, 2009, 9:46pm UTC](https://www.ruby-forum.com/t/reading-file-multiple-field/175620 "2009-09-16T21:46:01Z")

</div>

Hi hassan, I have an file x.txt which have an DestinationID|Name|City|StateProvince|Country|Latitude|Longitude|Type there are the fileds i have and also the data i want to read the file line by line into 2D …

---

## [\[ADV\] Upcoming Advanced Ruby and Rails Studios](https://www.ruby-forum.com/t/adv-upcoming-advanced-ruby-and-rails-studios/175632)

<div class="topic-metadata">

**Author:** [@clarkware](https://www.ruby-forum.com/u/clarkware)\
**Replies:** 0\
**Last updated:** [September 16, 2009, 9:41pm UTC](https://www.ruby-forum.com/t/adv-upcoming-advanced-ruby-and-rails-studios/175632 "2009-09-16T21:41:55Z")

</div>

Pragmatic Studio’s Advanced Ruby training is coming up next month (early registration ends soon!), and folks often ask what to expect in our advanced classes. You might also be wondering how Rails developers will bene…

---

## [Active Merchant Error](https://www.ruby-forum.com/t/active-merchant-error/175612)

<div class="topic-metadata">

**Author:** [@ghanshyam\_6786](https://www.ruby-forum.com/u/ghanshyam_6786)\
**Replies:** 2\
**Last updated:** [September 16, 2009, 9:30pm UTC](https://www.ruby-forum.com/t/active-merchant-error/175612 "2009-09-16T21:30:13Z")

</div>

Hello friends, I m using Active Merchant(version = 1.4.2) gem. in billing calculator i m require ‘active\_merchant’ and when i m open the page it is throw error such “no such file to load – active\_merchant”. Can…

---

## [Redirect\_to and the missing session](https://www.ruby-forum.com/t/redirect-to-and-the-missing-session/175605)

<div class="topic-metadata">

**Author:** [@icke](https://www.ruby-forum.com/u/icke)\
**Replies:** 1\
**Last updated:** [September 16, 2009, 8:49pm UTC](https://www.ruby-forum.com/t/redirect-to-and-the-missing-session/175605 "2009-09-16T20:49:15Z")

</div>

Hi, My application responds to a URL along the lines of http://myapp/xxxx where routes.rb determines that xxxx is not an action but an affiliate code from a referral from another site. The affiliate is validated and…

---

## [Cucumber and Routing](https://www.ruby-forum.com/t/cucumber-and-routing/175615)

<div class="topic-metadata">

**Author:** [@DVG](https://www.ruby-forum.com/u/DVG)\
**Replies:** 0\
**Last updated:** [September 16, 2009, 3:48pm UTC](https://www.ruby-forum.com/t/cucumber-and-routing/175615 "2009-09-16T15:48:54Z")

</div>

Hi folks, I’ve made a simple rails app that reads the PDFs contained in /public/ files/, and creates links to those files. I’m doing this for the purpose of using cucumber to perform automated tests on PDFs as outlin…

---

## [Main Object error](https://www.ruby-forum.com/t/main-object-error/175604)

<div class="topic-metadata">

**Author:** [@prashanth\_hiremath](https://www.ruby-forum.com/u/prashanth_hiremath)\
**Replies:** 1\
**Last updated:** [September 16, 2009, 1:37pm UTC](https://www.ruby-forum.com/t/main-object-error/175604 "2009-09-16T13:37:12Z")

</div>

Hi i am applying the formula to find the surrounding distance within 10 km using ruby geokit x=((((acos(sin((’#{lat}’\*pi()/180)) \* sin((latitude\*pi()/180))+cos((’#{lat}’\*pi()/180)) \* cos((latitude\*pi()/180)) \* cos(…

---

## [Using 2 database into a single RoR application](https://www.ruby-forum.com/t/using-2-database-into-a-single-ror-application/175603)

<div class="topic-metadata">

**Author:** [@ialuronico](https://www.ruby-forum.com/u/ialuronico)\
**Replies:** 2\
**Last updated:** [September 16, 2009, 1:35pm UTC](https://www.ruby-forum.com/t/using-2-database-into-a-single-ror-application/175603 "2009-09-16T13:35:26Z")

</div>

Hi everybody, I’m trying to convert to Ror one of my old ASP classic project. the website is an e-commerce with a community In this website I have 2 separate database for products/BI and for user generated content so…

---

## [Flush buffer in rails](https://www.ruby-forum.com/t/flush-buffer-in-rails/80937)

<div class="topic-metadata">

**Author:** [@rinda](https://www.ruby-forum.com/u/rinda)\
**Replies:** 2\
**Last updated:** [September 16, 2009, 12:49pm UTC](https://www.ruby-forum.com/t/flush-buffer-in-rails/80937 "2009-09-16T12:49:44Z")

</div>

render :text =\> lambda { |resp, out| out.puts 'start' out.flush 2.times do out.puts '.' out.flush sleep 1 end out.puts 'done' } Hi, using that code (find in archive), I am only able to print the wh…

---

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

<div class="topic-metadata">

**Author:** [@prashanth\_hiremath](https://www.ruby-forum.com/u/prashanth_hiremath)\
**Replies:** 2\
**Last updated:** [September 16, 2009, 11:43am UTC](https://www.ruby-forum.com/t/no-subject/175592 "2009-09-16T11:43:38Z")

</div>

Hi I have an lat long for an example city name newyork with area ,my task is to find the 15 km surroundings for the given lat long. All the lat ,long ,area and city name is in another text file.I want to p…

---

## [Trouble trying rjs](https://www.ruby-forum.com/t/trouble-trying-rjs/175204)

<div class="topic-metadata">

**Author:** [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Replies:** 2\
**Last updated:** [September 16, 2009, 11:39am UTC](https://www.ruby-forum.com/t/trouble-trying-rjs/175204 "2009-09-16T11:39:45Z")

</div>

Hi guys, I’ve done a tiny bit of ajax before, but now I’m trying out rjs templates and functions. I’m trying to re-create something like http://live.lmgtfy.com with periodically\_call\_remote. The problem is when I tr…

---

## [Model validations failed..(as there are two model used)](https://www.ruby-forum.com/t/model-validations-failed-as-there-are-two-model-used/175526)

<div class="topic-metadata">

**Author:** [@preksha](https://www.ruby-forum.com/u/preksha)\
**Replies:** 32\
**Last updated:** [September 16, 2009, 10:21am UTC](https://www.ruby-forum.com/t/model-validations-failed-as-there-are-two-model-used/175526 "2009-09-16T10:21:45Z")

</div>

i have used two model club and user in one form but validation doesn’t call for child model even i have written validates\_associated :user in parent model…when i fill information for user and don’t fill for club then …

---

## [Testing exception notification plugin with rspec](https://www.ruby-forum.com/t/testing-exception-notification-plugin-with-rspec/173509)

<div class="topic-metadata">

**Author:** [@Yoann-Z](https://www.ruby-forum.com/u/Yoann-Z)\
**Replies:** 2\
**Last updated:** [September 16, 2009, 9:54am UTC](https://www.ruby-forum.com/t/testing-exception-notification-plugin-with-rspec/173509 "2009-09-16T09:54:11Z")

</div>

Hi, I’m trying to install exception notification plugin and test it with rspec. The problem that I have is that when running the server in production mode : at the end of the log i get this when I have a critical err…

---

## [Passing parameter in edirect\_to in Rails](https://www.ruby-forum.com/t/passing-parameter-in-edirect-to-in-rails/175597)

<div class="topic-metadata">

**Author:** [@sam](https://www.ruby-forum.com/u/sam)\
**Replies:** 1\
**Last updated:** [September 16, 2009, 9:54am UTC](https://www.ruby-forum.com/t/passing-parameter-in-edirect-to-in-rails/175597 "2009-09-16T09:54:11Z")

</div>

Hi all, I am a newbie trying to learn rails, How do we pass parameters in redirect\_to in rails??? I know we can pass using this redirect\_to :action =\> action\_name,:id =\> 3, :abc =\> ‘sdfdf’ but abc goes as parameter …

---

## [ClickPass tutorial](https://www.ruby-forum.com/t/clickpass-tutorial/175595)

<div class="topic-metadata">

**Author:** [@td919](https://www.ruby-forum.com/u/td919)\
**Replies:** 0\
**Last updated:** [September 16, 2009, 9:18am UTC](https://www.ruby-forum.com/t/clickpass-tutorial/175595 "2009-09-16T09:18:59Z")

</div>

Hi, I am trying to use clickpass for my new project so that visitor to my site could just log in with their existing account credentials. However, I can’t find any tutorial made for Ruby on Rails. Normally you can fi…

---

## [Strange error no idea -fileutils.rbThumbs.db (Errno::EACCES)](https://www.ruby-forum.com/t/strange-error-no-idea-fileutils-rbthumbs-db-errno-eacces/175584)

<div class="topic-metadata">

**Author:** [@artrat](https://www.ruby-forum.com/u/artrat)\
**Replies:** 1\
**Last updated:** [September 16, 2009, 3:58am UTC](https://www.ruby-forum.com/t/strange-error-no-idea-fileutils-rbthumbs-db-errno-eacces/175584 "2009-09-16T03:58:59Z")

</div>

I can not find a single post on this but trying to start mongrel\_rails after closing it down I get the strangest error I have ever seen. Nothing on Google anywhere at all - please can somebody give some expertise? D:…

---

## [Hidden fields](https://www.ruby-forum.com/t/hidden-fields/175508)

<div class="topic-metadata">

**Author:** [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Replies:** 3\
**Last updated:** [September 16, 2009, 2:11am UTC](https://www.ruby-forum.com/t/hidden-fields/175508 "2009-09-16T02:11:32Z")

</div>

Similar (but different) to another thread called ‘accessing post array’, I have some records that I need sent via an array but I don’t want to use a text field but rather a hidden field because I don’t want them tampe…

---

## [Validates\_uniqueness\_of :scope =\> association](https://www.ruby-forum.com/t/validates-uniqueness-of-scope-association/175581)

<div class="topic-metadata">

**Author:** [@oldbug](https://www.ruby-forum.com/u/oldbug)\
**Replies:** 2\
**Last updated:** [September 16, 2009, 1:57am UTC](https://www.ruby-forum.com/t/validates-uniqueness-of-scope-association/175581 "2009-09-16T01:57:11Z")

</div>

(How?) Is it possible to use validates\_uniqueness\_of with a scope that is a belongs\_to association? This is what I would like to do: class Lot \< ActiveRecord::Base belongs\_to :part, :include =\> true validates\_uniqu…

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

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