# Rails

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

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

---

## [Swf\_tag like image\_tag](https://www.ruby-forum.com/t/swf-tag-like-image-tag/178679)

<div class="topic-metadata">

**Author:** [@Mehmet\_Davut](https://www.ruby-forum.com/u/Mehmet_Davut)\
**Replies:** 1\
**Last updated:** [November 9, 2009, 12:58pm UTC](https://www.ruby-forum.com/t/swf-tag-like-image-tag/178679 "2009-11-09T12:58:29Z")

</div>

Hi, I am trying to access public/swf folder like image\_tag. But i couldn’t connect any folder in public folder, some methods goes to public/image folder. How can i write a helper method like swf\_tag to acces public/s…

---

## [Is AR find(:all) a 100% named\_scope?](https://www.ruby-forum.com/t/is-ar-find-all-a-100-named-scope/178680)

<div class="topic-metadata">

**Author:** [@joahking](https://www.ruby-forum.com/u/joahking)\
**Replies:** 4\
**Last updated:** [November 9, 2009, 12:56pm UTC](https://www.ruby-forum.com/t/is-ar-find-all-a-100-named-scope/178680 "2009-11-09T12:56:43Z")

</div>

hi there, I have a method in a model that concatenates named\_scopes at later points in the method if certain conditions given. The concatenations go ok when all that concatenation is done with named\_scopes, but it b…

---

## [E-Mail Header with SMTP Configuration](https://www.ruby-forum.com/t/e-mail-header-with-smtp-configuration/178678)

<div class="topic-metadata">

**Author:** [@adammontgomery](https://www.ruby-forum.com/u/adammontgomery)\
**Replies:** 0\
**Last updated:** [November 9, 2009, 12:30pm UTC](https://www.ruby-forum.com/t/e-mail-header-with-smtp-configuration/178678 "2009-11-09T12:30:59Z")

</div>

Hi everyone My app is sending mails with ActionMailer with smtp sending through google. When I set up the E-Mail I set the @from paramter @from = “Administrator \<#{APP\_CONFIG\[‘admin\_email’\]}\>” But the emails …

---

## [Force app to use www only](https://www.ruby-forum.com/t/force-app-to-use-www-only/178647)

<div class="topic-metadata">

**Author:** [@adammontgomery](https://www.ruby-forum.com/u/adammontgomery)\
**Replies:** 3\
**Last updated:** [November 9, 2009, 12:22pm UTC](https://www.ruby-forum.com/t/force-app-to-use-www-only/178647 "2009-11-09T12:22:56Z")

</div>

Hi everyone, I want to go live with my application. But something is wrong with my site when using www.domain.com or domain.com. It seems that it use different instances of the app and create different sessions. How …

---

## [Atomic INSERT or UPDATE with activerecord](https://www.ruby-forum.com/t/atomic-insert-or-update-with-activerecord/178630)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 4\
**Last updated:** [November 9, 2009, 12:20pm UTC](https://www.ruby-forum.com/t/atomic-insert-or-update-with-activerecord/178630 "2009-11-09T12:20:44Z")

</div>

what i need: if :record is in the database -\> upgrade his counter else create :record (with his counter on 1) this should be done with an atomic operation, to avoid race conditions. What is the best way to do this w…

---

## [How to generate sql eports](https://www.ruby-forum.com/t/how-to-generate-sql-eports/178668)

<div class="topic-metadata">

**Author:** [@mgatri](https://www.ruby-forum.com/u/mgatri)\
**Replies:** 0\
**Last updated:** [November 9, 2009, 9:04am UTC](https://www.ruby-forum.com/t/how-to-generate-sql-eports/178668 "2009-11-09T09:04:38Z")

</div>

Dear all, Iâ€™m developing an application dedicated to generate statistical reports, I would like that user after saving their stat report they save sql queries too. To do that I wrote the following module: module Sq…

---

## [I am looking for RoR Webrat Selenium Install Recipe](https://www.ruby-forum.com/t/i-am-looking-for-ror-webrat-selenium-install-recipe/178625)

<div class="topic-metadata">

**Author:** [@audreylee88](https://www.ruby-forum.com/u/audreylee88)\
**Replies:** 3\
**Last updated:** [November 9, 2009, 7:58am UTC](https://www.ruby-forum.com/t/i-am-looking-for-ror-webrat-selenium-install-recipe/178625 "2009-11-09T07:58:09Z")

</div>

Hi there, I’m trying to follow the ch 22 of the RSpec book. \[ copy is (B11.0 printing, October 28, 2009) \] I want to use selenium and cucumber. Ordinary webrat seems to be working well. Here is info about my RoR: S…

---

## [Link\_to\_remote with image\_tag using Paperclip](https://www.ruby-forum.com/t/link-to-remote-with-image-tag-using-paperclip/178624)

<div class="topic-metadata">

**Author:** [@bluehandtalking](https://www.ruby-forum.com/u/bluehandtalking)\
**Replies:** 1\
**Last updated:** [November 9, 2009, 6:23am UTC](https://www.ruby-forum.com/t/link-to-remote-with-image-tag-using-paperclip/178624 "2009-11-09T06:23:12Z")

</div>

I am creating a layout of images with links. In Photo model: has\_attached\_file :mainimg, :styles =\> {:original =\> “465x365”, :thumb =\> “80x70”} In my Front controller: def index @photos = Photo.find(:all) @photos …

---

## [New column in ActiveRecord object, method\_missing() called intermittently](https://www.ruby-forum.com/t/new-column-in-activerecord-object-method-missing-called-intermittently/178545)

<div class="topic-metadata">

**Author:** [@jenna\_s](https://www.ruby-forum.com/u/jenna_s)\
**Replies:** 7\
**Last updated:** [November 9, 2009, 6:07am UTC](https://www.ruby-forum.com/t/new-column-in-activerecord-object-method-missing-called-intermittently/178545 "2009-11-09T06:07:38Z")

</div>

Hi, I’m using the geokit plugin to provide a “find-locations-on-radius” feature in my app. When a location is added to the database, the actual address is translated (geocoded) into a longitude & latitude. The longit…

---

## [How can I improve a Ruby on Rails code that hast a lot of SQL as strings?](https://www.ruby-forum.com/t/how-can-i-improve-a-ruby-on-rails-code-that-hast-a-lot-of-sql-as-strings/178658)

<div class="topic-metadata">

**Author:** [@JSPablo\_FernSSSSnd](https://www.ruby-forum.com/u/JSPablo_FernSSSSnd)\
**Replies:** 3\
**Last updated:** [November 9, 2009, 5:26am UTC](https://www.ruby-forum.com/t/how-can-i-improve-a-ruby-on-rails-code-that-hast-a-lot-of-sql-as-strings/178658 "2009-11-09T05:26:02Z")

</div>

Hello Railists, I have a piece of Ruby on Rails code that has a complex SQL query (well, not that complex, but as far as I know beyond the ORM capabilities) and for my taste it has too many strings and harcoded valu…

---

## [Problems with sqlserver 2000 and ActiveRecord](https://www.ruby-forum.com/t/problems-with-sqlserver-2000-and-activerecord/126340)

<div class="topic-metadata">

**Author:** [@Miguel\_angel\_G](https://www.ruby-forum.com/u/Miguel_angel_G)\
**Replies:** 6\
**Last updated:** [November 9, 2009, 4:46am UTC](https://www.ruby-forum.com/t/problems-with-sqlserver-2000-and-activerecord/126340 "2009-11-09T04:46:24Z")

</div>

Hi, I’m getting some trouble in connecting to a sql server 2000 database with ActiveRecord-2.0.1 and ruby 186-26, from win XP. Using the next conenction config: ActiveRecord::Base.establish\_connection( :adapter =\> …

---

## [Send\_data with jpeg not working](https://www.ruby-forum.com/t/send-data-with-jpeg-not-working/178650)

<div class="topic-metadata">

**Author:** [@flag](https://www.ruby-forum.com/u/flag)\
**Replies:** 2\
**Last updated:** [November 9, 2009, 3:07am UTC](https://www.ruby-forum.com/t/send-data-with-jpeg-not-working/178650 "2009-11-09T03:07:16Z")

</div>

I’m a newbie having trouble using send\_data to send a jpeg file to the browser for display in an html img tag. This is the relevant code from my controller (photos\_controller.rb): def retrieve @photo = Photo.find(pa…

---

## [STI, Namespaces, REST and link\_to](https://www.ruby-forum.com/t/sti-namespaces-rest-and-link-to/178643)

<div class="topic-metadata">

**Author:** [@bluething](https://www.ruby-forum.com/u/bluething)\
**Replies:** 1\
**Last updated:** [November 8, 2009, 9:38pm UTC](https://www.ruby-forum.com/t/sti-namespaces-rest-and-link-to/178643 "2009-11-08T21:38:05Z")

</div>

hello, i’ve got the STI-hierarchy Dictionary, InternalDictionary \< Dictionary and OnlineDictionary \< Dictionary. Every submodel has its own controller. E.g. InternalDictionary is handled by Voc::InternalDictionaryCo…

---

## [Authlogic Reset Password](https://www.ruby-forum.com/t/authlogic-reset-password/178641)

<div class="topic-metadata">

**Author:** [@sunny36](https://www.ruby-forum.com/u/sunny36)\
**Replies:** 0\
**Last updated:** [November 8, 2009, 8:56pm UTC](https://www.ruby-forum.com/t/authlogic-reset-password/178641 "2009-11-08T20:56:11Z")

</div>

I’ve implemented password reset using Authlogic basically following this tutorial http://www.binarylogic.com/2008/11/16/tutorial-reset-passwords-with-authlogic/ Everything works fine except if the user leaves both the…

---

## [Time.now "stuck" in Javascript Function](https://www.ruby-forum.com/t/time-now-stuck-in-javascript-function/178636)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 3\
**Last updated:** [November 8, 2009, 6:17pm UTC](https://www.ruby-forum.com/t/time-now-stuck-in-javascript-function/178636 "2009-11-08T18:17:25Z")

</div>

Novice RoR programmer here, I’ve run into a bit of a stumbling block, concerning Time.now seemingly not updating in between JS function calls. My code is as follows: function test() { document.getElementById(“chatb…

---

## [Installing Ruby on 64 bit Windows 7](https://www.ruby-forum.com/t/installing-ruby-on-64-bit-windows-7/178632)

<div class="topic-metadata">

**Author:** [@tobyr](https://www.ruby-forum.com/u/tobyr)\
**Replies:** 1\
**Last updated:** [November 8, 2009, 5:23pm UTC](https://www.ruby-forum.com/t/installing-ruby-on-64-bit-windows-7/178632 "2009-11-08T17:23:46Z")

</div>

Is there anything I need to know about in order to install Ruby on a 64bit Windows 7 system? For example, can I just use the 1-click installer for 1.8.6 and get a simple and reliable system? Or do I need to download…

---

## [Rails Best Practices](https://www.ruby-forum.com/t/rails-best-practices/178637)

<div class="topic-metadata">

**Author:** [@flyerhzm](https://www.ruby-forum.com/u/flyerhzm)\
**Replies:** 0\
**Last updated:** [November 8, 2009, 4:56pm UTC](https://www.ruby-forum.com/t/rails-best-practices/178637 "2009-11-08T16:56:46Z")

</div>

Hi all, Last month, there’s a Kungfu Rails Conf in Shanghai, China. And there’s an awesome presentation “Rails Best Practices” Rails Best Practices | PPT . Yehuda K. also likes this presentation. Now I’m writing a g…

---

## [Comparing data](https://www.ruby-forum.com/t/comparing-data/178633)

<div class="topic-metadata">

**Author:** [@introvert](https://www.ruby-forum.com/u/introvert)\
**Replies:** 7\
**Last updated:** [November 8, 2009, 4:55pm UTC](https://www.ruby-forum.com/t/comparing-data/178633 "2009-11-08T16:55:36Z")

</div>

Hello, I’m trying to implement Rails functionality which would allow to compare Model records (in my case different plans). I’m unsure what would be the proper approach towards this with Rails, is there any tutorial …

---

## [How to write an binary file to ftp](https://www.ruby-forum.com/t/how-to-write-an-binary-file-to-ftp/178623)

<div class="topic-metadata">

**Author:** [@daociyiyou](https://www.ruby-forum.com/u/daociyiyou)\
**Replies:** 9\
**Last updated:** [November 8, 2009, 4:48pm UTC](https://www.ruby-forum.com/t/how-to-write-an-binary-file-to-ftp/178623 "2009-11-08T16:48:09Z")

</div>

Net::FTP#putbinaryfile(binary\_file, remotefile) binary\_file is not a local file from some directory,but a dynamic generation from codes. The above codes not work,how to write it to ftp?

---

## [Running C processes, where do I put the C file?](https://www.ruby-forum.com/t/running-c-processes-where-do-i-put-the-c-file/178600)

<div class="topic-metadata">

**Author:** [@eltercero](https://www.ruby-forum.com/u/eltercero)\
**Replies:** 4\
**Last updated:** [November 8, 2009, 10:20am UTC](https://www.ruby-forum.com/t/running-c-processes-where-do-i-put-the-c-file/178600 "2009-11-08T10:20:38Z")

</div>

Hi there I make a call jsut like this: value = ./simulated\_annealing Which is a C Object file, but Rails tells me it cannot find that file. I put it in the same dir that the rest of the models files (since it’s call…

---

## [Partials in rails](https://www.ruby-forum.com/t/partials-in-rails/178599)

<div class="topic-metadata">

**Author:** [@aashishkiran](https://www.ruby-forum.com/u/aashishkiran)\
**Replies:** 4\
**Last updated:** [November 8, 2009, 9:51am UTC](https://www.ruby-forum.com/t/partials-in-rails/178599 "2009-11-08T09:51:37Z")

</div>

I am new to rails. can anyone explain in detail about partials in rails. my rails version is 2.3.4. How to use them?

---

## [Multiple Model Form](https://www.ruby-forum.com/t/multiple-model-form/178612)

<div class="topic-metadata">

**Author:** [@eggie5](https://www.ruby-forum.com/u/eggie5)\
**Replies:** 2\
**Last updated:** [November 8, 2009, 6:00am UTC](https://www.ruby-forum.com/t/multiple-model-form/178612 "2009-11-08T06:00:08Z")

</div>

I created scaffolding for my Model x, but I want to modify the new view so that I can create multiple (3) x objects in the DB instead of just 1 at a time. How can I do this?

---

## [Rio + Rake](https://www.ruby-forum.com/t/rio-rake/178617)

<div class="topic-metadata">

**Author:** [@Nash](https://www.ruby-forum.com/u/Nash)\
**Replies:** 0\
**Last updated:** [November 8, 2009, 2:31am UTC](https://www.ruby-forum.com/t/rio-rake/178617 "2009-11-08T02:31:11Z")

</div>

Hi, I’m using RIO (http://rio.rubyforge.org/) in some of my models and it seems like Rake doesn’t like it very much. The two conflict with each other. Has anyone figured out how to have RIO work as expected in rake? …

---

## [First App- Error 500](https://www.ruby-forum.com/t/first-app-error-500/174008)

<div class="topic-metadata">

**Author:** [@mgpowers](https://www.ruby-forum.com/u/mgpowers)\
**Replies:** 27\
**Last updated:** [November 8, 2009, 1:40am UTC](https://www.ruby-forum.com/t/first-app-error-500/174008 "2009-11-08T01:40:47Z")

</div>

I’ve created a simple hello world app that doesnt appear to serve up the view greeting.rhtml. :\< Any ideas ? The error message is from development.log is… Logfile created on Tue Aug 18 16:49:55 -0400 2009/!\\ FAILSA…

---

## [Mini\_magick - 2 clarifications](https://www.ruby-forum.com/t/mini-magick-2-clarifications/178536)

<div class="topic-metadata">

**Author:** [@djames](https://www.ruby-forum.com/u/djames)\
**Replies:** 2\
**Last updated:** [November 8, 2009, 12:37am UTC](https://www.ruby-forum.com/t/mini-magick-2-clarifications/178536 "2009-11-08T00:37:39Z")

</div>

I have seen examples similar to the following: image = MiniMagick::Image.from\_file(“input.jpg”) image.resize “100x100” image.write(“output.jpg”) I’m assuming that image.resize is a method. Is there any significance …

---

## [Table inheritance in rails](https://www.ruby-forum.com/t/table-inheritance-in-rails/178527)

<div class="topic-metadata">

**Author:** [@introvert](https://www.ruby-forum.com/u/introvert)\
**Replies:** 7\
**Last updated:** [November 7, 2009, 10:40pm UTC](https://www.ruby-forum.com/t/table-inheritance-in-rails/178527 "2009-11-07T22:40:36Z")

</div>

Hello, Suppose I have 2 models Human and Person and I want to inherit one from another so that I could use ‘human’ model/migration as a generic builder for smiliar objects as ‘person’, for instance this with the follo…

---

## [How to params from a method to partial in rails](https://www.ruby-forum.com/t/how-to-params-from-a-method-to-partial-in-rails/178601)

<div class="topic-metadata">

**Author:** [@aashishkiran](https://www.ruby-forum.com/u/aashishkiran)\
**Replies:** 3\
**Last updated:** [November 7, 2009, 9:38pm UTC](https://www.ruby-forum.com/t/how-to-params-from-a-method-to-partial-in-rails/178601 "2009-11-07T21:38:16Z")

</div>

hi, can anyone tell how to pass params to a partial.

---

## [Wrong argument type Mysql (expected Struct) running rake with Ruby 1.9 / Rails 2.3.3](https://www.ruby-forum.com/t/wrong-argument-type-mysql-expected-struct-running-rake-with-ruby-1-9-rails-2-3-3/178610)

<div class="topic-metadata">

**Author:** [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Replies:** 0\
**Last updated:** [November 7, 2009, 8:34pm UTC](https://www.ruby-forum.com/t/wrong-argument-type-mysql-expected-struct-running-rake-with-ruby-1-9-rails-2-3-3/178610 "2009-11-07T20:34:46Z")

</div>

I’m use Ruby 1.9 via rvm and Rails 2.3.3. I’m on OS X 10.5 and I have the mysql 2.8.1 gem installed. When I run rake on my rails app, I get the error “wrong argument type Mysql (expected Struct)”. I can run the app…

---

## [Choose a directory path](https://www.ruby-forum.com/t/choose-a-directory-path/178540)

<div class="topic-metadata">

**Author:** [@salil](https://www.ruby-forum.com/u/salil)\
**Replies:** 4\
**Last updated:** [November 7, 2009, 8:34pm UTC](https://www.ruby-forum.com/t/choose-a-directory-path/178540 "2009-11-07T20:34:11Z")

</div>

Hello everyone, How to give the functionality to choose a directory path to save a file by a user? Thanks in advance…

---

## [Using will\_paginate with arbitrary sql queries](https://www.ruby-forum.com/t/using-will-paginate-with-arbitrary-sql-queries/178588)

<div class="topic-metadata">

**Author:** [@C\_K\_Kashyap](https://www.ruby-forum.com/u/C_K_Kashyap)\
**Replies:** 2\
**Last updated:** [November 7, 2009, 7:14pm UTC](https://www.ruby-forum.com/t/using-will-paginate-with-arbitrary-sql-queries/178588 "2009-11-07T19:14:00Z")

</div>

Hi All, I have a situation where I have a task model, tag model and a link table task\_tags. In a particular view, I need to display a list of task that have a certain tags - For this, I’d need to run a query and get…

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

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