# Rails

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

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

---

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

<div class="topic-metadata">

**Author:** [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Replies:** 12\
**Last updated:** [July 7, 2010, 1:44am UTC](https://www.ruby-forum.com/t/before-filter-question/191169 "2010-07-07T01:44:18Z")

</div>

If one places a before\_filter in class ApplicationController, when is the before filter called and for which methods. I believe it gets called before any “action” … but how does rails know that the method is an action…

---

## [Sessions and authorization](https://www.ruby-forum.com/t/sessions-and-authorization/191172)

<div class="topic-metadata">

**Author:** [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Replies:** 2\
**Last updated:** [July 7, 2010, 12:54am UTC](https://www.ruby-forum.com/t/sessions-and-authorization/191172 "2010-07-07T00:54:13Z")

</div>

I’m looking at page 162 in Agile Web D. with Rails and in there they do the following once they find that a user has logged in with the right name and password: def login if request.post? user = User.authenticate(p…

---

## [Helper in Initializer: Is it possible?](https://www.ruby-forum.com/t/helper-in-initializer-is-it-possible/191161)

<div class="topic-metadata">

**Author:** [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Replies:** 4\
**Last updated:** [July 6, 2010, 11:53pm UTC](https://www.ruby-forum.com/t/helper-in-initializer-is-it-possible/191161 "2010-07-06T23:53:03Z")

</div>

Hi there, is there a way in Rails to use helpers in an Initializer ? If yes, how ? If no, where else to put the code needed in the Initializer (as well as in views) ? In the application\_controller.rb ? Thanks for an…

---

## [Polymorphic abstraction of Models, design help needed](https://www.ruby-forum.com/t/polymorphic-abstraction-of-models-design-help-needed/191170)

<div class="topic-metadata">

**Author:** [@ayanb](https://www.ruby-forum.com/u/ayanb)\
**Replies:** 0\
**Last updated:** [July 6, 2010, 11:10pm UTC](https://www.ruby-forum.com/t/polymorphic-abstraction-of-models-design-help-needed/191170 "2010-07-06T23:10:54Z")

</div>

We have Models like Supplier, Distributor, Vendor, Buyer in our schema. These entities have some common attributes ( like name, description, sales offices etc.) but mostly they have a divergent schema with different h…

---

## [How to create virtual domain name for RoR application?](https://www.ruby-forum.com/t/how-to-create-virtual-domain-name-for-ror-application/197141)

<div class="topic-metadata">

**Author:** [@sumantacaptain](https://www.ruby-forum.com/u/sumantacaptain)\
**Replies:** 3\
**Last updated:** [July 6, 2010, 10:24pm UTC](https://www.ruby-forum.com/t/how-to-create-virtual-domain-name-for-ror-application/197141 "2010-07-06T22:24:53Z")

</div>

Hi, I have a application for our internal office use. Platform is Ubuntu 9.04 sever edition. with Ruby version 1.8.7 (i486-linux) RubyGems version 1.3.7 Rack version 1.0 Rails version 2.3.5 Active Record versi…

---

## [Using ajax in nested attributes form](https://www.ruby-forum.com/t/using-ajax-in-nested-attributes-form/191162)

<div class="topic-metadata">

**Author:** [@Mlle](https://www.ruby-forum.com/u/Mlle)\
**Replies:** 3\
**Last updated:** [July 6, 2010, 10:19pm UTC](https://www.ruby-forum.com/t/using-ajax-in-nested-attributes-form/191162 "2010-07-06T22:19:06Z")

</div>

How can I use ajax to add nested attributes dynamically into the form of an object? I followed the railscast : but I’d like to use Ajax instead because the method above is sort of ugly.

---

## [Generated By handling CRUD Scaffold](https://www.ruby-forum.com/t/generated-by-handling-crud-scaffold/191079)

<div class="topic-metadata">

**Author:** [@Adriano\_Dias\_da\_Sil](https://www.ruby-forum.com/u/Adriano_Dias_da_Sil)\
**Replies:** 3\
**Last updated:** [July 6, 2010, 9:21pm UTC](https://www.ruby-forum.com/t/generated-by-handling-crud-scaffold/191079 "2010-07-06T21:21:26Z")

</div>

Good afternoon. I have two questions: First question: Can be defined at the time that I’m generating the scaffold the size of a string? For example name:string (50)? Second question: I wonder how to proceed corre…

---

## [Rails 3.0 + Lighttpd + FCGI = RAGE](https://www.ruby-forum.com/t/rails-3-0-lighttpd-fcgi-rage/191100)

<div class="topic-metadata">

**Author:** [@Maccy](https://www.ruby-forum.com/u/Maccy)\
**Replies:** 3\
**Last updated:** [July 6, 2010, 8:52pm UTC](https://www.ruby-forum.com/t/rails-3-0-lighttpd-fcgi-rage/191100 "2010-07-06T20:52:42Z")

</div>

Hi all hopefully someone has already gone through my pain. Firstly the setup. I am running Lighttpd(latest) + FastCGI + Rails 2.3.8 and it works brilliantly and very fast. When trying the deploy the Rails 3.0 beta i…

---

## [How to make confirm boxes conditional?](https://www.ruby-forum.com/t/how-to-make-confirm-boxes-conditional/191148)

<div class="topic-metadata">

**Author:** [@Lille](https://www.ruby-forum.com/u/Lille)\
**Replies:** 4\
**Last updated:** [July 6, 2010, 6:28pm UTC](https://www.ruby-forum.com/t/how-to-make-confirm-boxes-conditional/191148 "2010-07-06T18:28:08Z")

</div>

Hi, I’d like to make the :confirm option in my link\_to/button\_to erb elements conditional. So, if the page is in some state, no confirmation is requested, but not otherwise, etc. So far, my only (ugly) approach is to…

---

## [Schema.rb parser available?](https://www.ruby-forum.com/t/schema-rb-parser-available/191156)

<div class="topic-metadata">

**Author:** [@tomtt](https://www.ruby-forum.com/u/tomtt)\
**Replies:** 1\
**Last updated:** [July 6, 2010, 6:01pm UTC](https://www.ruby-forum.com/t/schema-rb-parser-available/191156 "2010-07-06T18:01:06Z")

</div>

hi, is there a parser avaliable to create all MVC-files based on the schema.rb or an exisiting db? thx

---

## [Respond partial content](https://www.ruby-forum.com/t/respond-partial-content/191157)

<div class="topic-metadata">

**Author:** [@jarl](https://www.ruby-forum.com/u/jarl)\
**Replies:** 0\
**Last updated:** [July 6, 2010, 5:56pm UTC](https://www.ruby-forum.com/t/respond-partial-content/191157 "2010-07-06T17:56:29Z")

</div>

Hi. This may seem like an absurd request. However it is becausy I integrate with a legacy system. I am in the need to respond partial content (flush) before the action is fully complete. This should prevent the legac…

---

## [Rails 3: link\_to :remote =\> true with spinner](https://www.ruby-forum.com/t/rails-3-link-to-remote-true-with-spinner/191155)

<div class="topic-metadata">

**Author:** [@sharkie](https://www.ruby-forum.com/u/sharkie)\
**Replies:** 0\
**Last updated:** [July 6, 2010, 5:46pm UTC](https://www.ruby-forum.com/t/rails-3-link-to-remote-true-with-spinner/191155 "2010-07-06T17:46:27Z")

</div>

How is this most efficiently done? link\_to\_remote is gone. I am using jQuery and am wondering how I could bind beforeSend call back with my link\_to :remote =\> true call. So that I can use it to draw spinner. Sharkie

---

## [Flash message not clear](https://www.ruby-forum.com/t/flash-message-not-clear/191089)

<div class="topic-metadata">

**Author:** [@Florent2](https://www.ruby-forum.com/u/Florent2)\
**Replies:** 1\
**Last updated:** [July 6, 2010, 5:17pm UTC](https://www.ruby-forum.com/t/flash-message-not-clear/191089 "2010-07-06T17:17:51Z")

</div>

Hello, I have a Rails 3 beta 4 where flash messages are not cleared when they should be. Please note that on a freshly created Rails 3 beta 4 application I do not face the problem. I searched for something flash spec…

---

## [Order form: quantity fields](https://www.ruby-forum.com/t/order-form-quantity-fields/191140)

<div class="topic-metadata">

**Author:** [@mercurius](https://www.ruby-forum.com/u/mercurius)\
**Replies:** 13\
**Last updated:** [July 6, 2010, 4:23pm UTC](https://www.ruby-forum.com/t/order-form-quantity-fields/191140 "2010-07-06T16:23:27Z")

</div>

The situation is: I have a Product table with data. I require a form. The form requires a list of Products that have a text field opposite where the user can specify a limitless amount of each product. The form will n…

---

## [Update file field](https://www.ruby-forum.com/t/update-file-field/191150)

<div class="topic-metadata">

**Author:** [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Replies:** 0\
**Last updated:** [July 6, 2010, 3:41pm UTC](https://www.ruby-forum.com/t/update-file-field/191150 "2010-07-06T15:41:15Z")

</div>

Hello champs, I have uploaded a file and saved it in tmp/ location. But now i need to update this file field. I mean i need to replace that file with another file. While uploading, i used this:- @Resume = Resume.new…

---

## [Nested routes with has\_many associations via a :foreign\_key](https://www.ruby-forum.com/t/nested-routes-with-has-many-associations-via-a-foreign-key/191114)

<div class="topic-metadata">

**Author:** [@dee](https://www.ruby-forum.com/u/dee)\
**Replies:** 1\
**Last updated:** [July 6, 2010, 12:55pm UTC](https://www.ruby-forum.com/t/nested-routes-with-has-many-associations-via-a-foreign-key/191114 "2010-07-06T12:55:10Z")

</div>

My app calls for the use of :foreign\_key into a model that it should be nested with. I can’t get the routes set up the way I want them. Here is an example: People buy and sell from each other. The purchase or sale is …

---

## [\[Rails3\] Displaying the full stack trace for test errors?](https://www.ruby-forum.com/t/rails3-displaying-the-full-stack-trace-for-test-errors/190595)

<div class="topic-metadata">

**Author:** [@Isak](https://www.ruby-forum.com/u/Isak)\
**Replies:** 1\
**Last updated:** [July 6, 2010, 12:26pm UTC](https://www.ruby-forum.com/t/rails3-displaying-the-full-stack-trace-for-test-errors/190595 "2010-07-06T12:26:49Z")

</div>

I’m porting an app from 2.3 to 3.0, have errors in my test suite, and don’t get enough info to figure out where these occur. See the example below; that’s all the feedback I get for an exception raised in a view. Sug…

---

## [Issue with listing a form\_for a collection](https://www.ruby-forum.com/t/issue-with-listing-a-form-for-a-collection/191132)

<div class="topic-metadata">

**Author:** [@theprojectabot](https://www.ruby-forum.com/u/theprojectabot)\
**Replies:** 2\
**Last updated:** [July 6, 2010, 11:53am UTC](https://www.ruby-forum.com/t/issue-with-listing-a-form-for-a-collection/191132 "2010-07-06T11:53:56Z")

</div>

I have a @people instance variable that is the return from Person.find(:all) I then want to have a revise.html that allows me to fill out one textfield with a number that I can then @people.update\_all(:revision) I tr…

---

## [Active Scaffold on rails 3?](https://www.ruby-forum.com/t/active-scaffold-on-rails-3/190042)

<div class="topic-metadata">

**Author:** [@sivakumar](https://www.ruby-forum.com/u/sivakumar)\
**Replies:** 1\
**Last updated:** [July 6, 2010, 11:38am UTC](https://www.ruby-forum.com/t/active-scaffold-on-rails-3/190042 "2010-07-06T11:38:47Z")

</div>

Hello guys, Do anyone know whether active scaffold works on rails3? If so…can someone give the documentation of it as well plz… Thank you dudes… TC

---

## [Bundle install =\> using from system gems](https://www.ruby-forum.com/t/bundle-install-using-from-system-gems/191137)

<div class="topic-metadata">

**Author:** [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Replies:** 0\
**Last updated:** [July 6, 2010, 11:18am UTC](https://www.ruby-forum.com/t/bundle-install-using-from-system-gems/191137 "2010-07-06T11:18:18Z")

</div>

I got an issue when running bundle install in a Rails3 app I am using rvm and a specific gemset rvm gemset list info: gemsets : for ruby-1.8.7-p248 (found in /Users/yves/.rvm/gems/) Rails3 global rails --version R…

---

## [How can I hide my Ruby code?](https://www.ruby-forum.com/t/how-can-i-hide-my-ruby-code/197050)

<div class="topic-metadata">

**Author:** [@sumantacaptain](https://www.ruby-forum.com/u/sumantacaptain)\
**Replies:** 0\
**Last updated:** [July 6, 2010, 10:09am UTC](https://www.ruby-forum.com/t/how-can-i-hide-my-ruby-code/197050 "2010-07-06T10:09:48Z")

</div>

Hi, I have my application on a Ubuntu 9.04 server edition. now i want to hide my application some how, like a setup file creation on .net or through any other way. so that nobody can use my code without my permission…

---

## [How to create virtual domain name for RoR application?](https://www.ruby-forum.com/t/how-to-create-virtual-domain-name-for-ror-application/191133)

<div class="topic-metadata">

**Author:** [@sumantacaptain](https://www.ruby-forum.com/u/sumantacaptain)\
**Replies:** 0\
**Last updated:** [July 6, 2010, 9:53am UTC](https://www.ruby-forum.com/t/how-to-create-virtual-domain-name-for-ror-application/191133 "2010-07-06T09:53:33Z")

</div>

Hi, I have a application for our internal office use. Platform is Ubuntu 9.04 sever edition. with Ruby version 1.8.7 (i486-linux) RubyGems version 1.3.7 Rack version 1.0 Rails version 2.3.5 Active Record versi…

---

## [About "Rails Recipes", Fowler, 2006](https://www.ruby-forum.com/t/about-rails-recipes-fowler-2006/191085)

<div class="topic-metadata">

**Author:** [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Replies:** 11\
**Last updated:** [July 6, 2010, 6:57am UTC](https://www.ruby-forum.com/t/about-rails-recipes-fowler-2006/191085 "2010-07-06T06:57:23Z")

</div>

Hi, I’m following Chad’s Recipe 31, “Authenticating your Users”. After getting some of it working, I noticed that he had put some of his models and controllers under a separate Authentication directory under the di…

---

## [How to user PDF::Toolkit.pdftk?](https://www.ruby-forum.com/t/how-to-user-pdf-toolkit-pdftk/191023)

<div class="topic-metadata">

**Author:** [@mamadoutoure](https://www.ruby-forum.com/u/mamadoutoure)\
**Replies:** 1\
**Last updated:** [July 6, 2010, 1:15am UTC](https://www.ruby-forum.com/t/how-to-user-pdf-toolkit-pdftk/191023 "2010-07-06T01:15:24Z")

</div>

Hi, I tried to fill a PDF fill template with an xdp file by using PDF::Toolkit.pdftk(“C:/pdf/fic2028.xdp”, “fill\_form”, “C:/pdf/fic2028.pdf”) But I got the following error Errno::ENOENT (No such file or directory - …

---

## [Installing Ferret](https://www.ruby-forum.com/t/installing-ferret/191033)

<div class="topic-metadata">

**Author:** [@mamadoutoure](https://www.ruby-forum.com/u/mamadoutoure)\
**Replies:** 8\
**Last updated:** [July 6, 2010, 1:12am UTC](https://www.ruby-forum.com/t/installing-ferret/191033 "2010-07-06T01:12:46Z")

</div>

Hi, I try to install the ferret gem (in my windows 7), I got this : gem install ferret -v 0.11.6 --source http://gems.rubyforge.org/ Building native extensions. This could take a while… ERROR: Error installing ferr…

---

## [Serialized JSON object importation](https://www.ruby-forum.com/t/serialized-json-object-importation/191120)

<div class="topic-metadata">

**Author:** [@judge](https://www.ruby-forum.com/u/judge)\
**Replies:** 0\
**Last updated:** [July 6, 2010, 12:05am UTC](https://www.ruby-forum.com/t/serialized-json-object-importation/191120 "2010-07-06T00:05:03Z")

</div>

Hi, I would like to import a serialized object (from a JSON export) inside my database. It work fine if for instance I do: l = Yea.create(:title =\> “foo bar”) =\> #\<Yea id: 3, title: “foo bar”, created\_at: “2010-07…

---

## [3 things: n00b](https://www.ruby-forum.com/t/3-things-n00b/191097)

<div class="topic-metadata">

**Author:** [@angel](https://www.ruby-forum.com/u/angel)\
**Replies:** 2\
**Last updated:** [July 5, 2010, 10:02pm UTC](https://www.ruby-forum.com/t/3-things-n00b/191097 "2010-07-05T22:02:09Z")

</div>

On a remote server I am running the command below using the restful\_authentication plugin and receiving the following error. ruby script/generate authenticated user sessions /usr/lib64/ruby/site\_ruby/1.8/rubygems/cu…

---

## [Fields\_for and form\_remote\_for not work properly](https://www.ruby-forum.com/t/fields-for-and-form-remote-for-not-work-properly/191077)

<div class="topic-metadata">

**Author:** [@fmh](https://www.ruby-forum.com/u/fmh)\
**Replies:** 6\
**Last updated:** [July 5, 2010, 5:56pm UTC](https://www.ruby-forum.com/t/fields-for-and-form-remote-for-not-work-properly/191077 "2010-07-05T17:56:17Z")

</div>

I think I’m not the first to ask this question. I have a fields\_for within a form\_remote\_for and this not work properly , the remote\_form\_for serialize strangely all params passed by fields\_for. with a form\_for it’s …

---

## [Ror with MongoDB problems and questions](https://www.ruby-forum.com/t/ror-with-mongodb-problems-and-questions/191099)

<div class="topic-metadata">

**Author:** [@fell](https://www.ruby-forum.com/u/fell)\
**Replies:** 1\
**Last updated:** [July 5, 2010, 3:56pm UTC](https://www.ruby-forum.com/t/ror-with-mongodb-problems-and-questions/191099 "2010-07-05T15:56:58Z")

</div>

Hi Ok what i want to do is work with MongoDB using standard ActiveRecord methods like Model.all Model.find and so on but whithout ActiveRecord itself. First to notice Ror using database.yml where we create connection…

---

## [Count the hits on page](https://www.ruby-forum.com/t/count-the-hits-on-page/191039)

<div class="topic-metadata">

**Author:** [@mailtorajuit](https://www.ruby-forum.com/u/mailtorajuit)\
**Replies:** 1\
**Last updated:** [July 5, 2010, 2:58pm UTC](https://www.ruby-forum.com/t/count-the-hits-on-page/191039 "2010-07-05T14:58:52Z")

</div>

Hi, I want to count the hits on my web site. how to do this by using ror application

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

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