# Rails

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

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

---

## [How would I find all "players" on an "active team"?](https://www.ruby-forum.com/t/how-would-i-find-all-players-on-an-active-team/155926)

<div class="topic-metadata">

**Author:** [@adistarmid](https://www.ruby-forum.com/u/adistarmid)\
**Replies:** 3\
**Last updated:** [December 18, 2008, 8:34am UTC](https://www.ruby-forum.com/t/how-would-i-find-all-players-on-an-active-team/155926 "2008-12-18T08:34:07Z")

</div>

I’m trying to find all players on an active team, and this is just stumping me. I defined the “active team” by: @active\_team = Team.find(:all, :conditions =\> \[“active=?”, true\]) Now, I’m trying to use in my loop: @a…

---

## [Redirect\_to with post parameter](https://www.ruby-forum.com/t/redirect-to-with-post-parameter/155927)

<div class="topic-metadata">

**Author:** [@ukarick](https://www.ruby-forum.com/u/ukarick)\
**Replies:** 0\
**Last updated:** [December 18, 2008, 8:29am UTC](https://www.ruby-forum.com/t/redirect-to-with-post-parameter/155927 "2008-12-18T08:29:47Z")

</div>

So now I’m working with the system which I’ve to selected about 10000 items (which location bar cannot handle all of them)and send all of selected parameters to another page. so I need to send parameter by POST metho…

---

## [Render a view from console](https://www.ruby-forum.com/t/render-a-view-from-console/155898)

<div class="topic-metadata">

**Author:** [@konstantin](https://www.ruby-forum.com/u/konstantin)\
**Replies:** 2\
**Last updated:** [December 18, 2008, 8:28am UTC](https://www.ruby-forum.com/t/render-a-view-from-console/155898 "2008-12-18T08:28:51Z")

</div>

Hello! In my application I’m trying to render a view from a class in /lib folder. I have found that it’s very similar to render a view from console. So, I have tried different methods: string = ActionView::Base.new…

---

## [Multiple top level domains and one session](https://www.ruby-forum.com/t/multiple-top-level-domains-and-one-session/155923)

<div class="topic-metadata">

**Author:** [@vineire77](https://www.ruby-forum.com/u/vineire77)\
**Replies:** 0\
**Last updated:** [December 18, 2008, 7:47am UTC](https://www.ruby-forum.com/t/multiple-top-level-domains-and-one-session/155923 "2008-12-18T07:47:30Z")

</div>

Hello all, I’ve been struggling with this for quite awhile and haven’t been able to find a solution. I need a user to be able to view multiple top level domains with a single login. My understanding is that this need…

---

## [Generation of migration file](https://www.ruby-forum.com/t/generation-of-migration-file/155921)

<div class="topic-metadata">

**Author:** [@kumar\_a](https://www.ruby-forum.com/u/kumar_a)\
**Replies:** 0\
**Last updated:** [December 18, 2008, 7:40am UTC](https://www.ruby-forum.com/t/generation-of-migration-file/155921 "2008-12-18T07:40:14Z")

</div>

Hi, Migration file will be generated automatically by the generation of scaffold or model. Is there any other way to generate migration file. Please send me information regarding this. Thanks in Advance, kumar

---

## [Rake command to drop a table using migration file](https://www.ruby-forum.com/t/rake-command-to-drop-a-table-using-migration-file/155920)

<div class="topic-metadata">

**Author:** [@kumar\_a](https://www.ruby-forum.com/u/kumar_a)\
**Replies:** 0\
**Last updated:** [December 18, 2008, 7:32am UTC](https://www.ruby-forum.com/t/rake-command-to-drop-a-table-using-migration-file/155920 "2008-12-18T07:32:25Z")

</div>

Hi, Please send me the information regarding rake command to drop a table. Thanks in Advace, kumar

---

## [Distributing a rails application](https://www.ruby-forum.com/t/distributing-a-rails-application/155911)

<div class="topic-metadata">

**Author:** [@littleknown](https://www.ruby-forum.com/u/littleknown)\
**Replies:** 5\
**Last updated:** [December 18, 2008, 6:12am UTC](https://www.ruby-forum.com/t/distributing-a-rails-application/155911 "2008-12-18T06:12:32Z")

</div>

What are the standard best practices for sharing your rails application on the web? As far as I can tell, you just delete the logs directory and clear out the database.yml What am I forgetting?

---

## [Max-width attachment\_fu and Image Science](https://www.ruby-forum.com/t/max-width-attachment-fu-and-image-science/155910)

<div class="topic-metadata">

**Author:** [@birdwatcher](https://www.ruby-forum.com/u/birdwatcher)\
**Replies:** 1\
**Last updated:** [December 18, 2008, 6:06am UTC](https://www.ruby-forum.com/t/max-width-attachment-fu-and-image-science/155910 "2008-12-18T06:06:06Z")

</div>

Hi - Curious, how can I configure attachment\_fu to only resize my images if they exceed a certain width/height. Then if they do, resize them proportionally. Any help appreciated, thanks. -BW

---

## [Override helper (observe\_field) and put JS at the bottom](https://www.ruby-forum.com/t/override-helper-observe-field-and-put-js-at-the-bottom/155913)

<div class="topic-metadata">

**Author:** [@artchrst](https://www.ruby-forum.com/u/artchrst)\
**Replies:** 1\
**Last updated:** [December 18, 2008, 5:43am UTC](https://www.ruby-forum.com/t/override-helper-observe-field-and-put-js-at-the-bottom/155913 "2008-12-18T05:43:29Z")

</div>

Is it possible to override a helper function and put its javascripts at the bottom (using yield)? I tried the follows in helper: override observe field to put js at the bottom def observe\_field(field\_id, options = {…

---

## [More than one submit\_tag in a single form](https://www.ruby-forum.com/t/more-than-one-submit-tag-in-a-single-form/155742)

<div class="topic-metadata">

**Author:** [@indu](https://www.ruby-forum.com/u/indu)\
**Replies:** 6\
**Last updated:** [December 18, 2008, 5:07am UTC](https://www.ruby-forum.com/t/more-than-one-submit-tag-in-a-single-form/155742 "2008-12-18T05:07:39Z")

</div>

Hai everyone , I have a list of users(each user in a row)and an Approve button for each user. I wish to change the status of the user to be approved when I click on the Approve button of a user. When I tried getting a…

---

## [How to do "special queries" ala The Rails Way on "associated" conditions?](https://www.ruby-forum.com/t/how-to-do-special-queries-ala-the-rails-way-on-associated-conditions/155539)

<div class="topic-metadata">

**Author:** [@lunaclaire](https://www.ruby-forum.com/u/lunaclaire)\
**Replies:** 3\
**Last updated:** [December 18, 2008, 5:02am UTC](https://www.ruby-forum.com/t/how-to-do-special-queries-ala-the-rails-way-on-associated-conditions/155539 "2008-12-18T05:02:23Z")

</div>

I have the following in a model class: class Game \< ActiveRecord::Base has\_many :player\_stats has\_many :players, :through =\> :player\_stats def visitor\_stats stats = \[\] player\_stats.each do |stat| stats \<\< stat if…

---

## [Assign object](https://www.ruby-forum.com/t/assign-object/155818)

<div class="topic-metadata">

**Author:** [@selva\_rails](https://www.ruby-forum.com/u/selva_rails)\
**Replies:** 2\
**Last updated:** [December 18, 2008, 3:44am UTC](https://www.ruby-forum.com/t/assign-object/155818 "2008-12-18T03:44:52Z")

</div>

Hi all, I am trying to do little bit beyond params… means I try to assign one active record object to another object as update attributes both have same field. Before that I want to remove id field from old object. Is …

---

## [Callback when objects connect as a habtm relationship](https://www.ruby-forum.com/t/callback-when-objects-connect-as-a-habtm-relationship/155772)

<div class="topic-metadata">

**Author:** [@Kazim\_Z](https://www.ruby-forum.com/u/Kazim_Z)\
**Replies:** 1\
**Last updated:** [December 18, 2008, 3:00am UTC](https://www.ruby-forum.com/t/callback-when-objects-connect-as-a-habtm-relationship/155772 "2008-12-18T03:00:04Z")

</div>

If Product and Category models are in a habtm relationship, i.e. class Product \< ActiveRecord::Base has\_and\_belongs\_to\_many :categories end class Category \< ActiveRecord::Base has\_and\_belongs\_to\_many :products end …

---

## [Strange behavior when override a default attribute, maybe a bug?](https://www.ruby-forum.com/t/strange-behavior-when-override-a-default-attribute-maybe-a-bug/155886)

<div class="topic-metadata">

**Author:** [@liberte](https://www.ruby-forum.com/u/liberte)\
**Replies:** 2\
**Last updated:** [December 18, 2008, 2:51am UTC](https://www.ruby-forum.com/t/strange-behavior-when-override-a-default-attribute-maybe-a-bug/155886 "2008-12-18T02:51:18Z")

</div>

Hello, I have a strange behavior and don’t know why. If I override attributes from AcitveRecord object like below: def end\_date=(date) date = date.to\_date unless date.blank? write\_attribute(:end\_date,date) end def …

---

## [Override a default attribute don't behave like expected in form\_for](https://www.ruby-forum.com/t/override-a-default-attribute-dont-behave-like-expected-in-form-for/196861)

<div class="topic-metadata">

**Author:** [@liberte](https://www.ruby-forum.com/u/liberte)\
**Replies:** 2\
**Last updated:** [December 18, 2008, 2:50am UTC](https://www.ruby-forum.com/t/override-a-default-attribute-dont-behave-like-expected-in-form-for/196861 "2008-12-18T02:50:43Z")

</div>

Hello, I have a strange behavior and don’t know why. If I override attributes from AcitveRecord object like below: def end\_date=(date) date = date.to\_date unless date.blank? write\_attribute(:end\_date,date) end def …

---

## [How to generate a layout for a controller](https://www.ruby-forum.com/t/how-to-generate-a-layout-for-a-controller/155824)

<div class="topic-metadata">

**Author:** [@youhaodeyi](https://www.ruby-forum.com/u/youhaodeyi)\
**Replies:** 8\
**Last updated:** [December 18, 2008, 2:49am UTC](https://www.ruby-forum.com/t/how-to-generate-a-layout-for-a-controller/155824 "2008-12-18T02:49:50Z")

</div>

I use ruby script/generate controller mycontroller to create a controller. There app/views/mycontroller/\* include all the view files. But I didn’t find there is any layout files associated with these views. How can I …

---

## [A question about text\_field\_tag value](https://www.ruby-forum.com/t/a-question-about-text-field-tag-value/155904)

<div class="topic-metadata">

**Author:** [@youhaodeyi](https://www.ruby-forum.com/u/youhaodeyi)\
**Replies:** 0\
**Last updated:** [December 18, 2008, 2:47am UTC](https://www.ruby-forum.com/t/a-question-about-text-field-tag-value/155904 "2008-12-18T02:47:51Z")

</div>

This is my rails code: \<%= label\_tag ‘user\_name\_label’, ‘User Name:’ %\> \<%= text\_field\_tag ‘user\_name’, ‘’%\> \<%= label\_tag ‘view\_name\_label’, ‘View Name:’%\> \<%= text\_field\_tag ‘view\_name’, ‘’ %\> I defined a user nam…

---

## [Dynamic Drop Down Submit problem](https://www.ruby-forum.com/t/dynamic-drop-down-submit-problem/155868)

<div class="topic-metadata">

**Author:** [@junsha](https://www.ruby-forum.com/u/junsha)\
**Replies:** 1\
**Last updated:** [December 18, 2008, 2:41am UTC](https://www.ruby-forum.com/t/dynamic-drop-down-submit-problem/155868 "2008-12-18T02:41:21Z")

</div>

Hi all, I have a little bit problem with my code here. basically, i want to have a drop down list, and if i select one value of the drop down list, the value of the text field that i have will change its value. what…

---

## [Conditional delete of a session](https://www.ruby-forum.com/t/conditional-delete-of-a-session/155705)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 1\
**Last updated:** [December 18, 2008, 2:39am UTC](https://www.ruby-forum.com/t/conditional-delete-of-a-session/155705 "2008-12-18T02:39:01Z")

</div>

Rails 2.2.2 Ruby 1.8.6 ActiveRecord Session Store enabled For testing purposes I wish to ensure that no session exists. To accomplish this I wrote: session.delete if session But this fails if session == nil and I …

---

## [Require file in rails](https://www.ruby-forum.com/t/require-file-in-rails/155629)

<div class="topic-metadata">

**Author:** [@Kaushik\_katari](https://www.ruby-forum.com/u/Kaushik_katari)\
**Replies:** 1\
**Last updated:** [December 18, 2008, 2:15am UTC](https://www.ruby-forum.com/t/require-file-in-rails/155629 "2008-12-18T02:15:38Z")

</div>

Hi, I have a file called dbcon.rb that I put in the config directory. I want to call it from rake, and I was using require ‘config/dbcon.rb’ This was allowing me to access the classes in this file. Somehow, the requ…

---

## [One association from two](https://www.ruby-forum.com/t/one-association-from-two/155526)

<div class="topic-metadata">

**Author:** [@dschruth](https://www.ruby-forum.com/u/dschruth)\
**Replies:** 1\
**Last updated:** [December 18, 2008, 1:38am UTC](https://www.ruby-forum.com/t/one-association-from-two/155526 "2008-12-18T01:38:11Z")

</div>

I’m working on a two-to-many relationship that works fine from the child object’s perspective but not from the parent’s. The imperfect, yet functional code looks like this: class PrimaryTable \< ActiveRecord::Base h…

---

## [Rails 2.2.2 and globalize - undefined method \`render\_file' for class \`ActionView::Base' (NameError)](https://www.ruby-forum.com/t/rails-2-2-2-and-globalize-undefined-method-render-file-for-class-actionview-base-nameerror/155830)

<div class="topic-metadata">

**Author:** [@clemens](https://www.ruby-forum.com/u/clemens)\
**Replies:** 9\
**Last updated:** [December 18, 2008, 1:04am UTC](https://www.ruby-forum.com/t/rails-2-2-2-and-globalize-undefined-method-render-file-for-class-actionview-base-nameerror/155830 "2008-12-18T01:04:16Z")

</div>

Looks like globalize (1.2) is not compatible with rails 2.2.2. I am getting: ’ =\> Booting Mongrel (use ‘script/server webrick’ to force WEBrick) =\> Rails 2.2.2 application starting on http://0.0.0.0:3003 =\> Call wit…

---

## [Host configuration questions](https://www.ruby-forum.com/t/host-configuration-questions/155888)

<div class="topic-metadata">

**Author:** [@jasonwold](https://www.ruby-forum.com/u/jasonwold)\
**Replies:** 1\
**Last updated:** [December 18, 2008, 12:28am UTC](https://www.ruby-forum.com/t/host-configuration-questions/155888 "2008-12-18T00:28:31Z")

</div>

Hello All, I have gotten through installing Ruby, Rails, and Passenger with all of your help. I’m configuring the host, and keep getting hung up on the details. i have edited the /etc/apache2/apache2.conf and added t…

---

## [Video on Rails?](https://www.ruby-forum.com/t/video-on-rails/155831)

<div class="topic-metadata">

**Author:** [@remco](https://www.ruby-forum.com/u/remco)\
**Replies:** 6\
**Last updated:** [December 18, 2008, 12:25am UTC](https://www.ruby-forum.com/t/video-on-rails/155831 "2008-12-18T00:25:34Z")

</div>

Hi, Looking for a gem/plugins with the purpose of uploading/encode/decode video’s to flash. Someone ideas? Grtz…remco

---

## [Best way to collect child rows](https://www.ruby-forum.com/t/best-way-to-collect-child-rows/155875)

<div class="topic-metadata">

**Author:** [@jeff](https://www.ruby-forum.com/u/jeff)\
**Replies:** 4\
**Last updated:** [December 18, 2008, 12:18am UTC](https://www.ruby-forum.com/t/best-way-to-collect-child-rows/155875 "2008-12-18T00:18:33Z")

</div>

I’m trying to find the best way to handle this task, and I’m not having much luck. I think I lack knowledge of the terminology to research this. I have these models: Account, which has many Pages Page, has many Items …

---

## [Restful auth problem](https://www.ruby-forum.com/t/restful-auth-problem/155887)

<div class="topic-metadata">

**Author:** [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Replies:** 1\
**Last updated:** [December 18, 2008, 12:09am UTC](https://www.ruby-forum.com/t/restful-auth-problem/155887 "2008-12-18T00:09:44Z")

</div>

Hi folks, I have been working on a website and I used restful auth as a starting point for the authentication. Suddenly (I don’t think I broke it but I don’t know) it has started throwing me a weird problem. I have …

---

## [Text\_field\_with\_auto\_complete and Safari browsers](https://www.ruby-forum.com/t/text-field-with-auto-complete-and-safari-browsers/155782)

<div class="topic-metadata">

**Author:** [@snantz](https://www.ruby-forum.com/u/snantz)\
**Replies:** 2\
**Last updated:** [December 17, 2008, 11:04pm UTC](https://www.ruby-forum.com/t/text-field-with-auto-complete-and-safari-browsers/155782 "2008-12-17T23:04:59Z")

</div>

I have a text field with auto complete that allows a user to choose a name from the list and when that name is selected that name is taken out of the list of available username to select from. Today I got notification…

---

## [With\_scope not working in 2.0](https://www.ruby-forum.com/t/with-scope-not-working-in-2-0/155881)

<div class="topic-metadata">

**Author:** [@remco](https://www.ruby-forum.com/u/remco)\
**Replies:** 1\
**Last updated:** [December 17, 2008, 10:42pm UTC](https://www.ruby-forum.com/t/with-scope-not-working-in-2-0/155881 "2008-12-17T22:42:28Z")

</div>

Hi, I just donwload some code. There are some upgrade issue in case off the with\_scope method. This is the code in tje controller: Video.with\_scope(:find =\> { :conditions =\> CONDITIONS }) How can i make this work in…

---

## [Access from common class](https://www.ruby-forum.com/t/access-from-common-class/155863)

<div class="topic-metadata">

**Author:** [@konstantin](https://www.ruby-forum.com/u/konstantin)\
**Replies:** 3\
**Last updated:** [December 17, 2008, 10:38pm UTC](https://www.ruby-forum.com/t/access-from-common-class/155863 "2008-12-17T22:38:21Z")

</div>

Hello! I have made a common class and put it to the /lib folder of my Rails application. Now I have some problems with access to: Mailers Call to SupportMailer.send\_activation\_email gives an error: NoMethodError (…

---

## [Cli server restart](https://www.ruby-forum.com/t/cli-server-restart/155883)

<div class="topic-metadata">

**Author:** [@spacechurro](https://www.ruby-forum.com/u/spacechurro)\
**Replies:** 0\
**Last updated:** [December 17, 2008, 10:00pm UTC](https://www.ruby-forum.com/t/cli-server-restart/155883 "2008-12-17T22:00:56Z")

</div>

at some point, things changed in the way the server works… i am not sure where… but i used to use “mongrel\_rails start|stop” at the command line to restart the server… it used to keep the pid in log/mongrel.pid now,…

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

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