# Rails

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

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

---

## [Noob question: ruby script/generate BeforeAfter](https://www.ruby-forum.com/t/noob-question-ruby-script-generate-beforeafter/179893)

<div class="topic-metadata">

**Author:** [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Replies:** 3\
**Last updated:** [December 7, 2009, 4:04pm UTC](https://www.ruby-forum.com/t/noob-question-ruby-script-generate-beforeafter/179893 "2009-12-07T16:04:31Z")

</div>

I ran rails StresslessHomeStaging as well as webrick. Feeding http://localhost:3000 to Firefox works fine. I then ran ruby script/generate controller BeforeAfter This created BeforeAfterController I then did clas…

---

## [Best practice for resetting emails and passwords](https://www.ruby-forum.com/t/best-practice-for-resetting-emails-and-passwords/179851)

<div class="topic-metadata">

**Author:** [@scudco](https://www.ruby-forum.com/u/scudco)\
**Replies:** 3\
**Last updated:** [December 7, 2009, 10:19am UTC](https://www.ruby-forum.com/t/best-practice-for-resetting-emails-and-passwords/179851 "2009-12-07T10:19:04Z")

</div>

Users login into my app with their email and password. When they want to change these their details do should i send a “change xxxx request link” via email to their registered address for either a password or email ch…

---

## [Link\_to\_remote image toggle](https://www.ruby-forum.com/t/link-to-remote-image-toggle/179842)

<div class="topic-metadata">

**Author:** [@charley](https://www.ruby-forum.com/u/charley)\
**Replies:** 1\
**Last updated:** [December 7, 2009, 10:06am UTC](https://www.ruby-forum.com/t/link-to-remote-image-toggle/179842 "2009-12-07T10:06:28Z")

</div>

Wondering the best way to have a link that is an image, user clicks it, a controller is pinged, the image is flipped for another image. If the second image is clicked vice-versa etc. Just turning something on/off basi…

---

## [Ruby script/server -- Errno::EADDRINUSE](https://www.ruby-forum.com/t/ruby-script-server-errno-eaddrinuse/92316)

<div class="topic-metadata">

**Author:** [@thameem](https://www.ruby-forum.com/u/thameem)\
**Replies:** 6\
**Last updated:** [December 7, 2009, 6:40am UTC](https://www.ruby-forum.com/t/ruby-script-server-errno-eaddrinuse/92316 "2009-12-07T06:40:13Z")

</div>

hi flocks, plz help me… when i am trying to start the server i am getting the following error the address is already binded plz help me to release the address… there are no such application which takes the this addre…

---

## [Find method and Virtual Attributes](https://www.ruby-forum.com/t/find-method-and-virtual-attributes/179875)

<div class="topic-metadata">

**Author:** [@kinunt](https://www.ruby-forum.com/u/kinunt)\
**Replies:** 1\
**Last updated:** [December 6, 2009, 4:28pm UTC](https://www.ruby-forum.com/t/find-method-and-virtual-attributes/179875 "2009-12-06T16:28:05Z")

</div>

Hi, I have a model with some virtual attributes. I would like to use find as in invoce.lines.find(:conditions =\> ‘total = 100’) being total a virtual attribute. Is it possible? I would like to use find because in the …

---

## [Named scope on belongs\_to](https://www.ruby-forum.com/t/named-scope-on-belongs-to/179872)

<div class="topic-metadata">

**Author:** [@bingobob](https://www.ruby-forum.com/u/bingobob)\
**Replies:** 1\
**Last updated:** [December 6, 2009, 11:16am UTC](https://www.ruby-forum.com/t/named-scope-on-belongs-to/179872 "2009-12-06T11:16:27Z")

</div>

I have a Resort model and a Country model Resort belongs\_to :country Country has\_many :resorts I tried and failed yesterday to develop a named\_scope that would return all the resorts but sorted by country name and …

---

## [Upload problem](https://www.ruby-forum.com/t/upload-problem/179799)

<div class="topic-metadata">

**Author:** [@sithadmin](https://www.ruby-forum.com/u/sithadmin)\
**Replies:** 3\
**Last updated:** [December 6, 2009, 1:00am UTC](https://www.ruby-forum.com/t/upload-problem/179799 "2009-12-06T01:00:01Z")

</div>

Hey guys, I’m trying to make a really simple uploader and I’m having trouble… I’m trying to follow this tutorial: the view: \<% form\_for :profile, :url =\> { :controller =\> ‘profile’, :action =\> ‘update’ }, :multipar…

---

## [Turned down for Rails job - seeking code review of test](https://www.ruby-forum.com/t/turned-down-for-rails-job-seeking-code-review-of-test/179823)

<div class="topic-metadata">

**Author:** [@curious\_about\_rails](https://www.ruby-forum.com/u/curious_about_rails)\
**Replies:** 2\
**Last updated:** [December 5, 2009, 10:11am UTC](https://www.ruby-forum.com/t/turned-down-for-rails-job-seeking-code-review-of-test/179823 "2009-12-05T10:11:29Z")

</div>

I was recently turned down for a Rails developer position (I’m not really a Rails developer, but it’s something I’ve been playing with in my spare time, so I gave it a go). Part of the technical screen was to take an …

---

## [Viewing html rendered during a test](https://www.ruby-forum.com/t/viewing-html-rendered-during-a-test/179850)

<div class="topic-metadata">

**Author:** [@scudco](https://www.ruby-forum.com/u/scudco)\
**Replies:** 2\
**Last updated:** [December 5, 2009, 9:11am UTC](https://www.ruby-forum.com/t/viewing-html-rendered-during-a-test/179850 "2009-12-05T09:11:08Z")

</div>

Is it possible to view the html rendered in a test? Im testing an assert\_select and its not passing though in the broswer all is fine. The test tells me what the assert\_select expected but id like to see what was the…

---

## [Functional test puzzle with validates\_acceptance\_of](https://www.ruby-forum.com/t/functional-test-puzzle-with-validates-acceptance-of/179840)

<div class="topic-metadata">

**Author:** [@shalott](https://www.ruby-forum.com/u/shalott)\
**Replies:** 0\
**Last updated:** [December 5, 2009, 1:04am UTC](https://www.ruby-forum.com/t/functional-test-puzzle-with-validates-acceptance-of/179840 "2009-12-05T01:04:14Z")

</div>

Hi all, I can’t for the life of me figure out why this test is failing. The code which works just fine in practice in the browser: model: Virtual attribute for age check and terms of service attr\_accessor :age\_over\_1…

---

## [Using url\_for Outside of the Controller - extend vs include](https://www.ruby-forum.com/t/using-url-for-outside-of-the-controller-extend-vs-include/179827)

<div class="topic-metadata">

**Author:** [@mperham](https://www.ruby-forum.com/u/mperham)\
**Replies:** 2\
**Last updated:** [December 5, 2009, 12:45am UTC](https://www.ruby-forum.com/t/using-url-for-outside-of-the-controller-extend-vs-include/179827 "2009-12-05T00:45:36Z")

</div>

there is a lot of docs on the web on how to use url\_for outside of a controller. All the examples I saw use it within a class’ instance methods and they do this by “include” ActionController::UrlWriter. I want to use …

---

## [Nginx + modrails + gzip](https://www.ruby-forum.com/t/nginx-modrails-gzip/174055)

<div class="topic-metadata">

**Author:** [@vince](https://www.ruby-forum.com/u/vince)\
**Replies:** 2\
**Last updated:** [December 4, 2009, 10:45pm UTC](https://www.ruby-forum.com/t/nginx-modrails-gzip/174055 "2009-12-04T22:45:11Z")

</div>

I’m running a stack using modrails with the compiled version of nginx. I turned on gzip in my /opt/nginx/conf/nginx.conf file but Yslow still shows that we aren’t gzipping. Any hints as to what might be happening? He…

---

## [Disabling pasting in text fields](https://www.ruby-forum.com/t/disabling-pasting-in-text-fields/179776)

<div class="topic-metadata">

**Author:** [@mercurius](https://www.ruby-forum.com/u/mercurius)\
**Replies:** 17\
**Last updated:** [December 4, 2009, 10:39pm UTC](https://www.ruby-forum.com/t/disabling-pasting-in-text-fields/179776 "2009-12-04T22:39:01Z")

</div>

Is there a way that I can easily disable pasting into a text field?

---

## [Deployment problem](https://www.ruby-forum.com/t/deployment-problem/179777)

<div class="topic-metadata">

**Author:** [@palani](https://www.ruby-forum.com/u/palani)\
**Replies:** 1\
**Last updated:** [December 4, 2009, 10:35pm UTC](https://www.ruby-forum.com/t/deployment-problem/179777 "2009-12-04T22:35:58Z")

</div>

Hi when do the cap deploy for my Ruby on Rails application. i faced the following error. cap deploy executing \`deploy’ executing \`deploy:update’ \*\* transaction: start executing \`deploy:update\_code’ executing locall…

---

## [Functional test question](https://www.ruby-forum.com/t/functional-test-question/117222)

<div class="topic-metadata">

**Author:** [@curi](https://www.ruby-forum.com/u/curi)\
**Replies:** 5\
**Last updated:** [December 4, 2009, 10:29pm UTC](https://www.ruby-forum.com/t/functional-test-question/117222 "2009-12-04T22:29:56Z")

</div>

This test of my signups controller fails on the last line: it gets redirected to the account/login page. get :signup, :id =\> 1 # must be logged in to view this page assert\_redirected\_to :action =\> 'login' login\_as :que…

---

## [Disabling alpha characters in a text field?](https://www.ruby-forum.com/t/disabling-alpha-characters-in-a-text-field/179811)

<div class="topic-metadata">

**Author:** [@mercurius](https://www.ruby-forum.com/u/mercurius)\
**Replies:** 13\
**Last updated:** [December 4, 2009, 10:11pm UTC](https://www.ruby-forum.com/t/disabling-alpha-characters-in-a-text-field/179811 "2009-12-04T22:11:35Z")

</div>

I have a ‘Telephone’ text field in a simple form. I want to disable the user to write anything other than numeric characters in this field. I am aware that some international telephone numbers use alphabetical charact…

---

## [Problem with javascript\_include\_tag with :cache](https://www.ruby-forum.com/t/problem-with-javascript-include-tag-with-cache/128803)

<div class="topic-metadata">

**Author:** [@tnitsche](https://www.ruby-forum.com/u/tnitsche)\
**Replies:** 3\
**Last updated:** [December 4, 2009, 8:19pm UTC](https://www.ruby-forum.com/t/problem-with-javascript-include-tag-with-cache/128803 "2009-12-04T20:19:35Z")

</div>

Hi, I’m using the Rails 2 feature for asset packing, but I still can’t figure out how Rails decides when to expire a cached asset package. I’m using \<%= javascript\_include\_tag “prototype”, “application”, “effects”, …

---

## [Testing rails application](https://www.ruby-forum.com/t/testing-rails-application/179650)

<div class="topic-metadata">

**Author:** [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Replies:** 6\
**Last updated:** [December 4, 2009, 6:06pm UTC](https://www.ruby-forum.com/t/testing-rails-application/179650 "2009-12-04T18:06:10Z")

</div>

Hi Actually i am doing testing of a ROR project… So what i need now is that is there any way/ways by which i cam dump the data of an sql table (lets suppose abc) into its yml file which is located in “test/fixtures/a…

---

## [Regarding restful\_authentication](https://www.ruby-forum.com/t/regarding-restful-authentication/179767)

<div class="topic-metadata">

**Author:** [@hunt](https://www.ruby-forum.com/u/hunt)\
**Replies:** 9\
**Last updated:** [December 4, 2009, 5:29pm UTC](https://www.ruby-forum.com/t/regarding-restful-authentication/179767 "2009-12-04T17:29:01Z")

</div>

Hello friends, I have installed restful\_authentication plugins for signup, login, logoff etc. I don’t receive email after signing in. I don’t know why it is happenning? ANy clue.

---

## [Association.build doesn't make children visible immediately](https://www.ruby-forum.com/t/association-build-doesnt-make-children-visible-immediately/179820)

<div class="topic-metadata">

**Author:** [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Replies:** 0\
**Last updated:** [December 4, 2009, 5:15pm UTC](https://www.ruby-forum.com/t/association-build-doesnt-make-children-visible-immediately/179820 "2009-12-04T17:15:36Z")

</div>

I have a problem with a has\_many :through association: #in class Question has\_many :question\_assets, :class\_name =\> “MillionaireQuestionAsset”, :order =\> “position”, :dependent =\> :destroy has\_many :assets, :through …

---

## [Rake Spec without recreating database](https://www.ruby-forum.com/t/rake-spec-without-recreating-database/124889)

<div class="topic-metadata">

**Author:** [@bodikp](https://www.ruby-forum.com/u/bodikp)\
**Replies:** 15\
**Last updated:** [December 4, 2009, 2:12am UTC](https://www.ruby-forum.com/t/rake-spec-without-recreating-database/124889 "2009-12-04T02:12:38Z")

</div>

This has been asked several times on the list before, but the answer is always, “That’s dumb, don’t do that”. “How do I ‘rake spec’ without recreating database?” I need a real answer. I was hoping that this may be pa…

---

## [Syntax Help](https://www.ruby-forum.com/t/syntax-help/179785)

<div class="topic-metadata">

**Author:** [@scrozier](https://www.ruby-forum.com/u/scrozier)\
**Replies:** 4\
**Last updated:** [December 3, 2009, 9:59pm UTC](https://www.ruby-forum.com/t/syntax-help/179785 "2009-12-03T21:59:22Z")

</div>

Can someone please help me with the following syntax? I’m passing two arguments to a definition in my model (passing some session info to the model), and I can’t seem to get the multiple conditions down right. def se…

---

## [Ajax observer sending weird param](https://www.ruby-forum.com/t/ajax-observer-sending-weird-param/179759)

<div class="topic-metadata">

**Author:** [@sithadmin](https://www.ruby-forum.com/u/sithadmin)\
**Replies:** 2\
**Last updated:** [December 3, 2009, 9:48pm UTC](https://www.ruby-forum.com/t/ajax-observer-sending-weird-param/179759 "2009-12-03T21:48:35Z")

</div>

Hey guys, I’m trying to use Ruby on Rails w/ Ajax… I’m getting a funky little problem. So I’ve got an observer on a text field called username and I’m trying to just check to see if the username is already in the DB o…

---

## [No duplicate records to model with FasterCSV](https://www.ruby-forum.com/t/no-duplicate-records-to-model-with-fastercsv/179794)

<div class="topic-metadata">

**Author:** [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Replies:** 0\
**Last updated:** [December 3, 2009, 9:44pm UTC](https://www.ruby-forum.com/t/no-duplicate-records-to-model-with-fastercsv/179794 "2009-12-03T21:44:01Z")

</div>

Hello all, I’m not sure if this is the best place to post but… Here’s what I’m doing. I’m reading/saving a csv to a table. I have a user that will be doing this periodically. The next time we get a csv, how can we …

---

## [Complex find](https://www.ruby-forum.com/t/complex-find/179687)

<div class="topic-metadata">

**Author:** [@aftershock](https://www.ruby-forum.com/u/aftershock)\
**Replies:** 6\
**Last updated:** [December 3, 2009, 9:41pm UTC](https://www.ruby-forum.com/t/complex-find/179687 "2009-12-03T21:41:34Z")

</div>

I have the following models set up. Plugin has\_many :site\_plugins has\_many :sites, :through =\> :site\_plugins SitePlugin belongs\_to :plugin belongs\_to :site Site has\_many :site\_plugins has\_many :plugins, :through…

---

## [Re-render a partial when a form field is updated](https://www.ruby-forum.com/t/re-render-a-partial-when-a-form-field-is-updated/179782)

<div class="topic-metadata">

**Author:** [@scrozier](https://www.ruby-forum.com/u/scrozier)\
**Replies:** 4\
**Last updated:** [December 3, 2009, 9:19pm UTC](https://www.ruby-forum.com/t/re-render-a-partial-when-a-form-field-is-updated/179782 "2009-12-03T21:19:31Z")

</div>

I would like to learn how to update a partial when a text field is updated. What would be the best way to go about doing this? I’m sort of stuck on how to generally accomplish this. I’m basically creating a page wit…

---

## [Extend ActionController::UrlWriter results in NoMethodError:](https://www.ruby-forum.com/t/extend-actioncontroller-urlwriter-results-in-nomethoderror/179789)

<div class="topic-metadata">

**Author:** [@mperham](https://www.ruby-forum.com/u/mperham)\
**Replies:** 0\
**Last updated:** [December 3, 2009, 8:18pm UTC](https://www.ruby-forum.com/t/extend-actioncontroller-urlwriter-results-in-nomethoderror/179789 "2009-12-03T20:18:11Z")

</div>

I am using extend within a class to use ActionController::UrlWriter.url\_for outside of a controller. The intention is to add url\_for as a class method of my class (since its a class with only class methods). When I d…

---

## [Create folder](https://www.ruby-forum.com/t/create-folder/179781)

<div class="topic-metadata">

**Author:** [@laura\_cordoba](https://www.ruby-forum.com/u/laura_cordoba)\
**Replies:** 1\
**Last updated:** [December 3, 2009, 6:44pm UTC](https://www.ruby-forum.com/t/create-folder/179781 "2009-12-03T18:44:47Z")

</div>

Hello, I have a problem with create a folder in my model. I am using FileUtils.mkdir\_p but this not work. Any ideas? Thanks

---

## [Ruby, mysql & NetBeans (6.7.1)](https://www.ruby-forum.com/t/ruby-mysql-netbeans-6-7-1/179461)

<div class="topic-metadata">

**Author:** [@quark](https://www.ruby-forum.com/u/quark)\
**Replies:** 7\
**Last updated:** [December 3, 2009, 5:48pm UTC](https://www.ruby-forum.com/t/ruby-mysql-netbeans-6-7-1/179461 "2009-12-03T17:48:46Z")

</div>

Hello, Iâ€™m new on Ruby on NetBeans, Iâ€™m working with a windows XP. Iâ€™m tried to build mysql gem and Iâ€™ve got an error message: JRuby limited openssl loaded. gem install jruby-openssl for full support. http://…

---

## [Dynamically connecting to multiple databases](https://www.ruby-forum.com/t/dynamically-connecting-to-multiple-databases/179773)

<div class="topic-metadata">

**Author:** [@vamsi](https://www.ruby-forum.com/u/vamsi)\
**Replies:** 0\
**Last updated:** [December 3, 2009, 2:59pm UTC](https://www.ruby-forum.com/t/dynamically-connecting-to-multiple-databases/179773 "2009-12-03T14:59:13Z")

</div>

Hi All, In my app after logged in there 'll be 3 links like DEMO (set value for this link like D) DEMO1 (set value for this link like D1) DEMO2 (set value for this link like D2) Each link refers to different databas…

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

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