# Rails

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

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

---

## [Comments belonging to two different models](https://www.ruby-forum.com/t/comments-belonging-to-two-different-models/171143)

<div class="topic-metadata">

**Author:** [@Toushi](https://www.ruby-forum.com/u/Toushi)\
**Replies:** 1\
**Last updated:** [June 27, 2009, 12:19am UTC](https://www.ruby-forum.com/t/comments-belonging-to-two-different-models/171143 "2009-06-27T00:19:31Z")

</div>

Hello, I am building a project management application, and I want my clients to be able to comment on multiple things. For instance I have 2 models: milestones, and tickets, I have the foreign keys for both of them i…

---

## [AR inheritance and class methods](https://www.ruby-forum.com/t/ar-inheritance-and-class-methods/171136)

<div class="topic-metadata">

**Author:** [@nickh](https://www.ruby-forum.com/u/nickh)\
**Replies:** 5\
**Last updated:** [June 26, 2009, 11:46pm UTC](https://www.ruby-forum.com/t/ar-inheritance-and-class-methods/171136 "2009-06-26T23:46:10Z")

</div>

In the code below, p.comments.foobar calls #foobar on every comment. Is there a way to call #foobar only on the comments that belong to post “p”? class Comment \< ActiveRecord::Base belongs\_to :post def self.foobar;…

---

## [Mapserver, postgis, ruby mapscript](https://www.ruby-forum.com/t/mapserver-postgis-ruby-mapscript/171133)

<div class="topic-metadata">

**Author:** [@Jedrin](https://www.ruby-forum.com/u/Jedrin)\
**Replies:** 1\
**Last updated:** [June 26, 2009, 10:11pm UTC](https://www.ruby-forum.com/t/mapserver-postgis-ruby-mapscript/171133 "2009-06-26T22:11:59Z")

</div>

Does anyone know some good blogs on mapserver, postgis, and ruby mapscript for ruby ? This website seems to say that there is not alot of good support in ruby geo libraries: http://geospatial.nomad-labs.com

---

## [ActionMailer Sends Multiple Messages](https://www.ruby-forum.com/t/actionmailer-sends-multiple-messages/163913)

<div class="topic-metadata">

**Author:** [@indigoi](https://www.ruby-forum.com/u/indigoi)\
**Replies:** 1\
**Last updated:** [June 26, 2009, 10:09pm UTC](https://www.ruby-forum.com/t/actionmailer-sends-multiple-messages/163913 "2009-06-26T22:09:20Z")

</div>

When i use “MyMailer.deliver\_reply()” in my console, I send an email exactly as i would expect, but when i call “MyMailer.deliver\_reply()” inside of my receive method, my app sends multiple duplicate messages, Do you …

---

## [Consecutive event triggering in RJS](https://www.ruby-forum.com/t/consecutive-event-triggering-in-rjs/171129)

<div class="topic-metadata">

**Author:** [@No\_BS](https://www.ruby-forum.com/u/No_BS)\
**Replies:** 1\
**Last updated:** [June 26, 2009, 8:35pm UTC](https://www.ruby-forum.com/t/consecutive-event-triggering-in-rjs/171129 "2009-06-26T20:35:16Z")

</div>

I know I’ve actually done this before, but I’ve spent the past couple hours searching Google and my own code and have come up with nothing. Does anyone know how to trigger events consecutively in RJS? For instance, if…

---

## [Inside or outside of Rails::Initializer block](https://www.ruby-forum.com/t/inside-or-outside-of-rails-initializer-block/170986)

<div class="topic-metadata">

**Author:** [@Learn\_by\_D](https://www.ruby-forum.com/u/Learn_by_D)\
**Replies:** 4\
**Last updated:** [June 26, 2009, 6:25pm UTC](https://www.ruby-forum.com/t/inside-or-outside-of-rails-initializer-block/170986 "2009-06-26T18:25:49Z")

</div>

Please help me figure out whether to put the application configuration below inside or outside of the Rails::Initializer in environment.rb. The application runs regardless of the position of the application configurat…

---

## [Updating instance variable](https://www.ruby-forum.com/t/updating-instance-variable/171085)

<div class="topic-metadata">

**Author:** [@vishy](https://www.ruby-forum.com/u/vishy)\
**Replies:** 1\
**Last updated:** [June 26, 2009, 6:16pm UTC](https://www.ruby-forum.com/t/updating-instance-variable/171085 "2009-06-26T18:16:27Z")

</div>

I am currently working on an app in which I a list of tasks displayed under a particular project. These tasks get displayed when the application first loads. I am setting this project as the current project. I have a …

---

## [Fields\_for with div\_for](https://www.ruby-forum.com/t/fields-for-with-div-for/171123)

<div class="topic-metadata">

**Author:** [@mdaoust](https://www.ruby-forum.com/u/mdaoust)\
**Replies:** 0\
**Last updated:** [June 26, 2009, 5:52pm UTC](https://www.ruby-forum.com/t/fields-for-with-div-for/171123 "2009-06-26T17:52:32Z")

</div>

Hi there. I have a parent/child relationship/form and using the swanky accepts\_nested\_attributes\_for to submit the data for the child. Now this is really great, but when I come to editing an existing child through par…

---

## [Getting started with Cucumber ... problem](https://www.ruby-forum.com/t/getting-started-with-cucumber-problem/171095)

<div class="topic-metadata">

**Author:** [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Replies:** 2\
**Last updated:** [June 26, 2009, 5:20pm UTC](https://www.ruby-forum.com/t/getting-started-with-cucumber-problem/171095 "2009-06-26T17:20:28Z")

</div>

Hi All, I’m following the guidance in http://lcd.weblog.glam.ac.uk/2009/2/16/cucumber-tutorial-ruby-on-rails. Everything worked fine through the command “Ruby Script/Generate cucumber mate .”, including starting the…

---

## [TMail + Receing mail and extract attachments](https://www.ruby-forum.com/t/tmail-receing-mail-and-extract-attachments/97247)

<div class="topic-metadata">

**Author:** [@Socheat\_Yi](https://www.ruby-forum.com/u/Socheat_Yi)\
**Replies:** 1\
**Last updated:** [June 26, 2009, 4:09pm UTC](https://www.ruby-forum.com/t/tmail-receing-mail-and-extract-attachments/97247 "2009-06-26T16:09:22Z")

</div>

Hi guys, I have a hard time with action mailer and TMail, I always get the following error… My code: \<\< pop = Net::POP3.new(‘pop.mydomain.com’) pop.start(‘xxx’, ‘xxxxx’) # (1) if pop.mails.empty? puts…

---

## [Putting models into Gems (not plugins)](https://www.ruby-forum.com/t/putting-models-into-gems-not-plugins/171061)

<div class="topic-metadata">

**Author:** [@murfhy](https://www.ruby-forum.com/u/murfhy)\
**Replies:** 1\
**Last updated:** [June 26, 2009, 4:08pm UTC](https://www.ruby-forum.com/t/putting-models-into-gems-not-plugins/171061 "2009-06-26T16:08:30Z")

</div>

Hi, we internally are creating gems out of particular sets of models, both to share them among multiple Rails apps, but also to use them within background scripts. If possible, I’d like for the models to function with…

---

## [Validates\_uniqueness\_of and MySQL enum type](https://www.ruby-forum.com/t/validates-uniqueness-of-and-mysql-enum-type/171112)

<div class="topic-metadata">

**Author:** [@hayafirst](https://www.ruby-forum.com/u/hayafirst)\
**Replies:** 0\
**Last updated:** [June 26, 2009, 3:52pm UTC](https://www.ruby-forum.com/t/validates-uniqueness-of-and-mysql-enum-type/171112 "2009-06-26T15:52:05Z")

</div>

I tried to check validates\_uniqueness\_of for a MySql enum type column with a scope given, like this: validates\_uniqueness\_of :phone\_type, :scope =\> :user\_id And It didn’t work. When I check the SQL statement for doing…

---

## [\[ANN/ADV\] Rails Rescue Handbook](https://www.ruby-forum.com/t/ann-adv-rails-rescue-handbook/171110)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [June 26, 2009, 3:50pm UTC](https://www.ruby-forum.com/t/ann-adv-rails-rescue-handbook/171110 "2009-06-26T15:50:19Z")

</div>

I’ve run into quite a number of Rails projects over the last two years that weren’t quite up to the highest standards. I finally took the time to compile my experiences with coming in to clean up the mess into an eboo…

---

## [Weird behavior with ruby 1.9.1](https://www.ruby-forum.com/t/weird-behavior-with-ruby-1-9-1/171109)

<div class="topic-metadata">

**Author:** [@sdesbure](https://www.ruby-forum.com/u/sdesbure)\
**Replies:** 0\
**Last updated:** [June 26, 2009, 3:26pm UTC](https://www.ruby-forum.com/t/weird-behavior-with-ruby-1-9-1/171109 "2009-06-26T15:26:47Z")

</div>

Hi all, I’m using rails 2.3.2 on ruby 1.9.1 and also on ruby ee 1.8.7 In one of my view, I have radio buttons to select a file. When the file is selected, I update some links via the "onclick =\> remote\_function). It…

---

## [Aurigma Image uploader](https://www.ruby-forum.com/t/aurigma-image-uploader/171103)

<div class="topic-metadata">

**Author:** [@pravinhmhatre](https://www.ruby-forum.com/u/pravinhmhatre)\
**Replies:** 4\
**Last updated:** [June 26, 2009, 2:54pm UTC](https://www.ruby-forum.com/t/aurigma-image-uploader/171103 "2009-06-26T14:54:58Z")

</div>

Hi, Any one have any idea about using aurigma image uploader in rails. I am trying to implement it in my application. I followed following steps: Copied HTML source in index.rb to index.html.erb Installed paperclip …

---

## [Pagination problem](https://www.ruby-forum.com/t/pagination-problem/171100)

<div class="topic-metadata">

**Author:** [@newb](https://www.ruby-forum.com/u/newb)\
**Replies:** 0\
**Last updated:** [June 26, 2009, 1:19pm UTC](https://www.ruby-forum.com/t/pagination-problem/171100 "2009-06-26T13:19:47Z")

</div>

Dear all… i m using rails paginator class in my application. i can able to see my pagination working but its not providing me the current page number in my view it displays like below PREVIOUS 2 3 4 5 6 7 8 …

---

## [Choosing RoR or CMS for a customer which wants to customize](https://www.ruby-forum.com/t/choosing-ror-or-cms-for-a-customer-which-wants-to-customize/171031)

<div class="topic-metadata">

**Author:** [@o\_topaz](https://www.ruby-forum.com/u/o_topaz)\
**Replies:** 7\
**Last updated:** [June 26, 2009, 12:28pm UTC](https://www.ruby-forum.com/t/choosing-ror-or-cms-for-a-customer-which-wants-to-customize/171031 "2009-06-26T12:28:53Z")

</div>

Hello All, PLEASE HELP I am starting the challenge of developing a business data site for a customer. As I heard RoR is so much object oriented and as I did lots of Java programming in the past, I have started to lea…

---

## [Radio button issue](https://www.ruby-forum.com/t/radio-button-issue/171093)

<div class="topic-metadata">

**Author:** [@martin\_mercy2001](https://www.ruby-forum.com/u/martin_mercy2001)\
**Replies:** 0\
**Last updated:** [June 26, 2009, 11:16am UTC](https://www.ruby-forum.com/t/radio-button-issue/171093 "2009-06-26T11:16:42Z")

</div>

Dear all, I have used radio button for enable/disable option. While clicking the radio button i have submitted a form. I was able to submit the form successfully but i have a issue like, My code, \<%= radio\_button :u…

---

## [Will\_paginate and remember checkboxes](https://www.ruby-forum.com/t/will-paginate-and-remember-checkboxes/139214)

<div class="topic-metadata">

**Author:** [@anka](https://www.ruby-forum.com/u/anka)\
**Replies:** 9\
**Last updated:** [June 26, 2009, 10:18am UTC](https://www.ruby-forum.com/t/will-paginate-and-remember-checkboxes/139214 "2009-06-26T10:18:59Z")

</div>

How can I remeber which checkbox-es was checked or unchecked when I use paginate (will\_paginate). I don’t want to save checked and unchecked checkboxes (positions) when I change page, but I want to save at the end, wh…

---

## [rSpec Newbie Question - Testing controller](https://www.ruby-forum.com/t/rspec-newbie-question-testing-controller/171078)

<div class="topic-metadata">

**Author:** [@rzolkos](https://www.ruby-forum.com/u/rzolkos)\
**Replies:** 1\
**Last updated:** [June 26, 2009, 9:48am UTC](https://www.ruby-forum.com/t/rspec-newbie-question-testing-controller/171078 "2009-06-26T09:48:27Z")

</div>

Hi I am very new to rspec and would like to learn more. I have googled around and asked in irc with no firm answers. I have the following controller : class ProductsController \< ApplicationController before\_filter…

---

## [Ruby on Rails Guides](https://www.ruby-forum.com/t/ruby-on-rails-guides/171081)

<div class="topic-metadata">

**Author:** [@bruparel](https://www.ruby-forum.com/u/bruparel)\
**Replies:** 1\
**Last updated:** [June 26, 2009, 9:46am UTC](https://www.ruby-forum.com/t/ruby-on-rails-guides/171081 "2009-06-26T09:46:42Z")

</div>

The Rails Guides are at the following address: They look really good. I am particularly interested in learning how to create the nice looking pop-up menu when you click on the “Guides Index” link. Does anyone know…

---

## [Determine if a time is within a certain range](https://www.ruby-forum.com/t/determine-if-a-time-is-within-a-certain-range/171083)

<div class="topic-metadata">

**Author:** [@jasonb](https://www.ruby-forum.com/u/jasonb)\
**Replies:** 1\
**Last updated:** [June 26, 2009, 9:40am UTC](https://www.ruby-forum.com/t/determine-if-a-time-is-within-a-certain-range/171083 "2009-06-26T09:40:49Z")

</div>

Is there a way to determine if a timestamp is between 2 times of the day? For example, I need to know if a time is between 12:00 am and 4:00 am. The field I’m looking at has a full timestamp (i.e. 2009-06-25 19:58:37)…

---

## [Fixture data not saved into test database](https://www.ruby-forum.com/t/fixture-data-not-saved-into-test-database/171084)

<div class="topic-metadata">

**Author:** [@pixelhandler](https://www.ruby-forum.com/u/pixelhandler)\
**Replies:** 0\
**Last updated:** [June 26, 2009, 9:08am UTC](https://www.ruby-forum.com/t/fixture-data-not-saved-into-test-database/171084 "2009-06-26T09:08:01Z")

</div>

I am using Authlogic for user authentecation and create a users.yml for fuctional testing. My unit tests pass, but functional tests fail; since the fixture data wasn’t saved to the test database. I get errors like: S…

---

## [Admin link in application helper](https://www.ruby-forum.com/t/admin-link-in-application-helper/170890)

<div class="topic-metadata">

**Author:** [@Bob\_O](https://www.ruby-forum.com/u/Bob_O)\
**Replies:** 1\
**Last updated:** [June 26, 2009, 7:53am UTC](https://www.ruby-forum.com/t/admin-link-in-application-helper/170890 "2009-06-26T07:53:09Z")

</div>

hello, Im trying to create a helper method for my admin links. in quite a few views i have the code \<% if current\_user %\> \<%= link\_to “Edit”, edit\_model\_path(model) %\> \<%= link\_to “New”, new\_model\_path %\> \<%= link\_…

---

## [Problem getting handle to a model attribute](https://www.ruby-forum.com/t/problem-getting-handle-to-a-model-attribute/171086)

<div class="topic-metadata">

**Author:** [@vishy](https://www.ruby-forum.com/u/vishy)\
**Replies:** 0\
**Last updated:** [June 26, 2009, 7:08am UTC](https://www.ruby-forum.com/t/problem-getting-handle-to-a-model-attribute/171086 "2009-06-26T07:08:10Z")

</div>

I am currently working on an app in which I a list of tasks displayed under a particular project. These tasks get displayed when the application first loads. I am setting this project as the current project. I have a …

---

## [Embedded HTML validation in a RoR app?](https://www.ruby-forum.com/t/embedded-html-validation-in-a-ror-app/171070)

<div class="topic-metadata">

**Author:** [@weyus](https://www.ruby-forum.com/u/weyus)\
**Replies:** 3\
**Last updated:** [June 26, 2009, 6:49am UTC](https://www.ruby-forum.com/t/embedded-html-validation-in-a-ror-app/171070 "2009-06-26T06:49:28Z")

</div>

Anyone ever done HTML validation of an arbitrary piece of HTML within their RoR app.? Any gems/plugins that would work? Would Hpricot do the trick? Thanks, Wes

---

## [Session cleanup](https://www.ruby-forum.com/t/session-cleanup/171002)

<div class="topic-metadata">

**Author:** [@Xiahong\_G](https://www.ruby-forum.com/u/Xiahong_G)\
**Replies:** 6\
**Last updated:** [June 26, 2009, 4:19am UTC](https://www.ruby-forum.com/t/session-cleanup/171002 "2009-06-26T04:19:17Z")

</div>

Hi everyone, I am a newb. Can anyone tell me how to do session cleanup? I want to cleanup those sessions which haven’t been modified in recent 5 minutes. How to make it a background process in my rails application? t…

---

## [Performance improvement in method to strip non-numeral characters from string?](https://www.ruby-forum.com/t/performance-improvement-in-method-to-strip-non-numeral-characters-from-string/170867)

<div class="topic-metadata">

**Author:** [@Vipin](https://www.ruby-forum.com/u/Vipin)\
**Replies:** 3\
**Last updated:** [June 26, 2009, 3:18am UTC](https://www.ruby-forum.com/t/performance-improvement-in-method-to-strip-non-numeral-characters-from-string/170867 "2009-06-26T03:18:56Z")

</div>

I need to write a method such that when we pass on a string to it, it returns a substring out of it. returned string is such that it consists of numerals only. All the characters other than numerals are stripped away. …

---

## [Select for boolean attribute](https://www.ruby-forum.com/t/select-for-boolean-attribute/171062)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 2\
**Last updated:** [June 26, 2009, 12:31am UTC](https://www.ruby-forum.com/t/select-for-boolean-attribute/171062 "2009-06-26T00:31:44Z")

</div>

I would like to use a select box to display and edit a boolean model attribute. I realize that perhaps checkboxes or radio buttons are a more idomatic way to do this in html but I would like to use a select box. Wha…

---

## [RJS and drop down menu](https://www.ruby-forum.com/t/rjs-and-drop-down-menu/171046)

<div class="topic-metadata">

**Author:** [@fireknite](https://www.ruby-forum.com/u/fireknite)\
**Replies:** 3\
**Last updated:** [June 25, 2009, 8:25pm UTC](https://www.ruby-forum.com/t/rjs-and-drop-down-menu/171046 "2009-06-25T20:25:55Z")

</div>

Trying to update a text field on a page with the value from a drop down select menu. Having a hard time accessing the value in the menu. Any help would be great! :slight\_smile:

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

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