# Rails

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

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

---

## [Converting a ruby array to javascript array](https://www.ruby-forum.com/t/converting-a-ruby-array-to-javascript-array/149133)

<div class="topic-metadata">

**Author:** [@david](https://www.ruby-forum.com/u/david)\
**Replies:** 3\
**Last updated:** [September 22, 2008, 5:05am UTC](https://www.ruby-forum.com/t/converting-a-ruby-array-to-javascript-array/149133 "2008-09-22T05:05:05Z")

</div>

I have this code within a javascript function: function load(test) { var coordinates = new Array(); coordinates = \<%= params\[:coordinates\] %\> } the params contains an array with double digit numbers such as \[24,45\]…

---

## [:has\_many :through form validation messages problem](https://www.ruby-forum.com/t/has-many-through-form-validation-messages-problem/144283)

<div class="topic-metadata">

**Author:** [@ajaonchat](https://www.ruby-forum.com/u/ajaonchat)\
**Replies:** 7\
**Last updated:** [September 22, 2008, 3:41am UTC](https://www.ruby-forum.com/t/has-many-through-form-validation-messages-problem/144283 "2008-09-22T03:41:25Z")

</div>

kindly help with this Im stuck below are the models class Listing \< ActiveRecord::Base has\_one :template has\_many :lvalues, :dependent=\>:delete\_all has\_many :custom\_fields, :through =\> :lvalues has\_and\_belongs\_to\_m…

---

## [Webrick mount app](https://www.ruby-forum.com/t/webrick-mount-app/148003)

<div class="topic-metadata">

**Author:** [@samrus](https://www.ruby-forum.com/u/samrus)\
**Replies:** 5\
**Last updated:** [September 22, 2008, 2:05am UTC](https://www.ruby-forum.com/t/webrick-mount-app/148003 "2008-09-22T02:05:00Z")

</div>

Hi All, I am currently developing against webrick and as such my application appears under http://localhost:3000/ but in my continuous integration environment (jruby war deployed to tomcat) the application appears un…

---

## [Application URL prefixes in the File Column plug-in](https://www.ruby-forum.com/t/application-url-prefixes-in-the-file-column-plug-in/149125)

<div class="topic-metadata">

**Author:** [@dschruth](https://www.ruby-forum.com/u/dschruth)\
**Replies:** 3\
**Last updated:** [September 22, 2008, 12:23am UTC](https://www.ruby-forum.com/t/application-url-prefixes-in-the-file-column-plug-in/149125 "2008-09-22T00:23:45Z")

</div>

I love this plugin (I’m able to get it working mostly) but I’m running into an issue with using it in an application with an mongrel/apache specified application level URL prefix. This is a problem for both uploadin…

---

## [How Do You Replace Snippet Tags in a Page's Body?](https://www.ruby-forum.com/t/how-do-you-replace-snippet-tags-in-a-pages-body/149096)

<div class="topic-metadata">

**Author:** [@adistarmid](https://www.ruby-forum.com/u/adistarmid)\
**Replies:** 2\
**Last updated:** [September 21, 2008, 11:29pm UTC](https://www.ruby-forum.com/t/how-do-you-replace-snippet-tags-in-a-pages-body/149096 "2008-09-21T23:29:44Z")

</div>

I’m trying to replicate the Snippet functionality in typical CMSs. I have a table called “Pages” and “Snippets”, where the latter is inserted into the former. I want the @page.body to replace anything between these ta…

---

## [Problems freezing rails](https://www.ruby-forum.com/t/problems-freezing-rails/149039)

<div class="topic-metadata">

**Author:** [@cam295](https://www.ruby-forum.com/u/cam295)\
**Replies:** 5\
**Last updated:** [September 21, 2008, 10:32pm UTC](https://www.ruby-forum.com/t/problems-freezing-rails/149039 "2008-09-21T22:32:43Z")

</div>

I’ve got a site at Dreamhost, and am trying to freeze rails, but am getting this error message: \[larchmont\]$ rake rails:freeze:gems --trace (in /home/.input/cmills/fsilg.dreamhosters.com) rake aborted! Don’t know ho…

---

## [Rspec, Rails 2.1.0, rubygems, Mac OS X Leopard - rubygems does not recognize latest version](https://www.ruby-forum.com/t/rspec-rails-2-1-0-rubygems-mac-os-x-leopard-rubygems-does-not-recognize-latest-version/148772)

<div class="topic-metadata">

**Author:** [@jfrankov](https://www.ruby-forum.com/u/jfrankov)\
**Replies:** 8\
**Last updated:** [September 21, 2008, 10:32pm UTC](https://www.ruby-forum.com/t/rspec-rails-2-1-0-rubygems-mac-os-x-leopard-rubygems-does-not-recognize-latest-version/148772 "2008-09-21T22:32:31Z")

</div>

I’m trying to run some specs on my Mac OS/Leopard machine (10.5.5) but rubygems won’t allow it: $ spec spec/models/my\_spec.rb Rails requires RubyGems \>= 0.9.4 (you have 0.9.3). Please gem update --system and try again…

---

## [MPM -- prefork or worker?](https://www.ruby-forum.com/t/mpm-prefork-or-worker/149139)

<div class="topic-metadata">

**Author:** [@david](https://www.ruby-forum.com/u/david)\
**Replies:** 3\
**Last updated:** [September 21, 2008, 9:52pm UTC](https://www.ruby-forum.com/t/mpm-prefork-or-worker/149139 "2008-09-21T21:52:41Z")

</div>

We are running apache 2.2, mongrel and RoR 2.1.1. One of the issues we are seeing is the speed apache takes to load images out of the / public folder. The app flies and the response times from mysql and the queries …

---

## [Inheriting model detail](https://www.ruby-forum.com/t/inheriting-model-detail/148981)

<div class="topic-metadata">

**Author:** [@jonas\_s](https://www.ruby-forum.com/u/jonas_s)\
**Replies:** 4\
**Last updated:** [September 21, 2008, 8:20pm UTC](https://www.ruby-forum.com/t/inheriting-model-detail/148981 "2008-09-21T20:20:07Z")

</div>

Hello, I want to create models with child models. As an example, one model Event and submodels OneTimeEvent and RecurringEvent. How should I do this? One possibility would be to use class Event \< Activerecord clas…

---

## [ActiveRecord (2.1.1) and time columns](https://www.ruby-forum.com/t/activerecord-2-1-1-and-time-columns/149062)

<div class="topic-metadata">

**Author:** [@jacib](https://www.ruby-forum.com/u/jacib)\
**Replies:** 4\
**Last updated:** [September 21, 2008, 8:18pm UTC](https://www.ruby-forum.com/t/activerecord-2-1-1-and-time-columns/149062 "2008-09-21T20:18:22Z")

</div>

Hi all, I’m building an application that will allow store owners to keep track of the opening and closing times of their shops. For example, a store owner might input that their shop is open Monday, Wednesday, and F…

---

## [Table with selectable rows](https://www.ruby-forum.com/t/table-with-selectable-rows/149134)

<div class="topic-metadata">

**Author:** [@AdamT](https://www.ruby-forum.com/u/AdamT)\
**Replies:** 2\
**Last updated:** [September 21, 2008, 4:37pm UTC](https://www.ruby-forum.com/t/table-with-selectable-rows/149134 "2008-09-21T16:37:12Z")

</div>

I need a table with selectable rows (there is a check box in every row). All selected rows should be displayed with different style than rows which are not selected. I implemented this behavior by assigning the css-de…

---

## [Reverse Ajax with RoR - what is the best option?](https://www.ruby-forum.com/t/reverse-ajax-with-ror-what-is-the-best-option/148757)

<div class="topic-metadata">

**Author:** [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Replies:** 6\
**Last updated:** [September 21, 2008, 2:10pm UTC](https://www.ruby-forum.com/t/reverse-ajax-with-ror-what-is-the-best-option/148757 "2008-09-21T14:10:40Z")

</div>

Hi, I would like to introduce reverse ajax to one of my projects. Anyone has any opinions on what is the best approach for a serious deployment? Comet, Juggernaut, orbitd, cometd, …? I would appreciate opinions on th…

---

## [Routes and spacename](https://www.ruby-forum.com/t/routes-and-spacename/149137)

<div class="topic-metadata">

**Author:** [@pandabeer](https://www.ruby-forum.com/u/pandabeer)\
**Replies:** 0\
**Last updated:** [September 21, 2008, 12:19pm UTC](https://www.ruby-forum.com/t/routes-and-spacename/149137 "2008-09-21T12:19:50Z")

</div>

Hello, I have some ressources such as “systems”, “tags”, “categories”, and I would like to customize them path by adding just before a directory like ‘admin/’. In order to do that, I had editing my routes.rb file with…

---

## [RESTful design question](https://www.ruby-forum.com/t/restful-design-question/149093)

<div class="topic-metadata">

**Author:** [@snowbird122](https://www.ruby-forum.com/u/snowbird122)\
**Replies:** 1\
**Last updated:** [September 21, 2008, 9:24am UTC](https://www.ruby-forum.com/t/restful-design-question/149093 "2008-09-21T09:24:49Z")

</div>

Hello- I’m working on an e-commerce app. Specifically, I’m working on how addresses are managed. An Order has\_one Address. A User has\_many Addresses. I defined some routes that look like this: map.resources :orders, …

---

## [Reporting tools](https://www.ruby-forum.com/t/reporting-tools/149131)

<div class="topic-metadata">

**Author:** [@srinivasan](https://www.ruby-forum.com/u/srinivasan)\
**Replies:** 0\
**Last updated:** [September 21, 2008, 8:15am UTC](https://www.ruby-forum.com/t/reporting-tools/149131 "2008-09-21T08:15:14Z")

</div>

Hi every body, Can any one suggest, which way we can generate reports in rails, is there any tools?

---

## [How to make logout link appear everywhere](https://www.ruby-forum.com/t/how-to-make-logout-link-appear-everywhere/149098)

<div class="topic-metadata">

**Author:** [@Commander\_J](https://www.ruby-forum.com/u/Commander_J)\
**Replies:** 4\
**Last updated:** [September 21, 2008, 7:24am UTC](https://www.ruby-forum.com/t/how-to-make-logout-link-appear-everywhere/149098 "2008-09-21T07:24:58Z")

</div>

Hi, When users are logged in, they should always have a ‘Logout’ function handy somewhere. Users control Forms and Elements using two controllers, FormsController and ElementsController. What at least works is to …

---

## [Truncate Bug?](https://www.ruby-forum.com/t/truncate-bug/149073)

<div class="topic-metadata">

**Author:** [@Sav](https://www.ruby-forum.com/u/Sav)\
**Replies:** 1\
**Last updated:** [September 21, 2008, 7:06am UTC](https://www.ruby-forum.com/t/truncate-bug/149073 "2008-09-21T07:06:15Z")

</div>

Any idea why the truncate() function returns the wrong number of characters when using HTML as the 3rd (truncate\_string) parameter?.. \<%= truncate(body, 100) %\> Lorem ipsum dolor sit amet, consectetuer adipiscing elit…

---

## [Saving dependent objects in a has\_many relationship](https://www.ruby-forum.com/t/saving-dependent-objects-in-a-has-many-relationship/149126)

<div class="topic-metadata">

**Author:** [@surge](https://www.ruby-forum.com/u/surge)\
**Replies:** 0\
**Last updated:** [September 21, 2008, 2:22am UTC](https://www.ruby-forum.com/t/saving-dependent-objects-in-a-has-many-relationship/149126 "2008-09-21T02:22:40Z")

</div>

Hello everybody, Quick question. Let’s say I have two models: Trouble\_Ticket and Issues. Trouble\_Ticket has\_many Issues and Issue belongs\_to Trouble\_Ticket – a classic has\_many. When I do Trouble\_Ticket \<\< Issue, Iss…

---

## [Move to namespace](https://www.ruby-forum.com/t/move-to-namespace/149103)

<div class="topic-metadata">

**Author:** [@Commander\_J](https://www.ruby-forum.com/u/Commander_J)\
**Replies:** 10\
**Last updated:** [September 21, 2008, 2:19am UTC](https://www.ruby-forum.com/t/move-to-namespace/149103 "2008-09-21T02:19:45Z")

</div>

Hi, I’ve built the Admin section of my project first, and would like to move it to its own Admin namespace. I have four resources: Form, Element, Admin and User. Old URL would be: localhost:3000/forms New URL woul…

---

## [NameError: uninitialized constant Inflector](https://www.ruby-forum.com/t/nameerror-uninitialized-constant-inflector/149083)

<div class="topic-metadata">

**Author:** [@dschruth](https://www.ruby-forum.com/u/dschruth)\
**Replies:** 2\
**Last updated:** [September 21, 2008, 12:41am UTC](https://www.ruby-forum.com/t/nameerror-uninitialized-constant-inflector/149083 "2008-09-21T00:41:30Z")

</div>

I follwed the example here: http://dekstop.de/weblog/2005/12/rails\_inflector\_in\_ruby\_scripts/ #!/usr/bin/ruby require ‘rubygems’ require ‘active\_support/inflector’ puts Inflector.singularize(‘inflections’) I loaded…

---

## [Dynamically adding and removing routes](https://www.ruby-forum.com/t/dynamically-adding-and-removing-routes/149087)

<div class="topic-metadata">

**Author:** [@mjand](https://www.ruby-forum.com/u/mjand)\
**Replies:** 2\
**Last updated:** [September 20, 2008, 9:33pm UTC](https://www.ruby-forum.com/t/dynamically-adding-and-removing-routes/149087 "2008-09-20T21:33:32Z")

</div>

Hello, Is it possible to alter a Rails app’s routing table at runtime? I want to be able to add and remove routes from an admin application. Thanks. Michael

---

## [Rspec problem stubbing with ActiveRecord assiociations](https://www.ruby-forum.com/t/rspec-problem-stubbing-with-activerecord-assiociations/149114)

<div class="topic-metadata">

**Author:** [@berlin\_2.0](https://www.ruby-forum.com/u/berlin_2.0)\
**Replies:** 0\
**Last updated:** [September 20, 2008, 8:52pm UTC](https://www.ruby-forum.com/t/rspec-problem-stubbing-with-activerecord-assiociations/149114 "2008-09-20T20:52:58Z")

</div>

Hi everybody, my name is Olaf, I’m living in Berlin and this is my first post. I’m quite new to rpsec, so please forgive my Newbieness! I’ve a problem stubbing a simple update action in a controller. I use a little ha…

---

## [Using Rails on MAMP via Passenger?](https://www.ruby-forum.com/t/using-rails-on-mamp-via-passenger/149056)

<div class="topic-metadata">

**Author:** [@Action](https://www.ruby-forum.com/u/Action)\
**Replies:** 2\
**Last updated:** [September 20, 2008, 8:52pm UTC](https://www.ruby-forum.com/t/using-rails-on-mamp-via-passenger/149056 "2008-09-20T20:52:58Z")

</div>

I’m new Ruby as well as the Rails Framework. I want to install Passenger so that I can develop in MAMP (Leopard), but I can’t find any instructions specific to installing Passenger on MAMP. Can anyone provide with me …

---

## [Report tool](https://www.ruby-forum.com/t/report-tool/149110)

<div class="topic-metadata">

**Author:** [@srinivasan](https://www.ruby-forum.com/u/srinivasan)\
**Replies:** 0\
**Last updated:** [September 20, 2008, 6:35pm UTC](https://www.ruby-forum.com/t/report-tool/149110 "2008-09-20T18:35:59Z")

</div>

Hi all, I want to know what are the reporting tools available with rails Plese help.

---

## [Preventing users from using your app name in their name](https://www.ruby-forum.com/t/preventing-users-from-using-your-app-name-in-their-name/149101)

<div class="topic-metadata">

**Author:** [@chunkyslink](https://www.ruby-forum.com/u/chunkyslink)\
**Replies:** 4\
**Last updated:** [September 20, 2008, 5:44pm UTC](https://www.ruby-forum.com/t/preventing-users-from-using-your-app-name-in-their-name/149101 "2008-09-20T17:44:48Z")

</div>

Is there a Rails validation helper or an easy way of preventing attributes from containing a certain word match, e.g. you have a User model, the user has a name attribute, and you don’t want the @user.name to == ‘MyRa…

---

## ["Nil object": really?](https://www.ruby-forum.com/t/nil-object-really/148916)

<div class="topic-metadata">

**Author:** [@vahagn](https://www.ruby-forum.com/u/vahagn)\
**Replies:** 9\
**Last updated:** [September 20, 2008, 5:07pm UTC](https://www.ruby-forum.com/t/nil-object-really/148916 "2008-09-20T17:07:48Z")

</div>

Hello,- I am developing a rails app with this method in it: PUT /newsletters/1;send def sendmails newsletter = Newsletter.find\_by\_id\_and\_sent(params\[:id\], false) users = User.find(:all) raise users.to\_yaml #debugge…

---

## [Stubbing Paperclip calls to Amazon S3 (for Rspec)](https://www.ruby-forum.com/t/stubbing-paperclip-calls-to-amazon-s3-for-rspec/148868)

<div class="topic-metadata">

**Author:** [@chunkyslink](https://www.ruby-forum.com/u/chunkyslink)\
**Replies:** 1\
**Last updated:** [September 20, 2008, 2:53pm UTC](https://www.ruby-forum.com/t/stubbing-paperclip-calls-to-amazon-s3-for-rspec/148868 "2008-09-20T14:53:04Z")

</div>

Would anyone happen to know how to stub a call to S3 from Paperclip? I’ve searched every where and no one seems to have posted anything about this. I’ve done very little in the way of spec’ing dependencies on external…

---

## [Agile Web Development with Rails Second vs Third edition](https://www.ruby-forum.com/t/agile-web-development-with-rails-second-vs-third-edition/148974)

<div class="topic-metadata">

**Author:** [@eipipuz](https://www.ruby-forum.com/u/eipipuz)\
**Replies:** 8\
**Last updated:** [September 20, 2008, 1:40pm UTC](https://www.ruby-forum.com/t/agile-web-development-with-rails-second-vs-third-edition/148974 "2008-09-20T13:40:57Z")

</div>

Hello guys, I am starting with Rails and I have bought the book “Agile Web Development with Rails Second”. The book is very good but I’ve found out already that there are some differences between rails 1.2 and the cu…

---

## [Observer doesn't work properly... in development?](https://www.ruby-forum.com/t/observer-doesnt-work-properly-in-development/149100)

<div class="topic-metadata">

**Author:** [@ramontayag](https://www.ruby-forum.com/u/ramontayag)\
**Replies:** 3\
**Last updated:** [September 20, 2008, 1:35pm UTC](https://www.ruby-forum.com/t/observer-doesnt-work-properly-in-development/149100 "2008-09-20T13:35:04Z")

</div>

Hey all! Ok, weird problem with observer. Most of the time, the after\_create of UserObserver isn’t called. It’s like it just skips it altogether. However, when I stop the server, add a line “debugger” in the after\_c…

---

## [Best DB structure - any advice?](https://www.ruby-forum.com/t/best-db-structure-any-advice/149099)

<div class="topic-metadata">

**Author:** [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Replies:** 1\
**Last updated:** [September 20, 2008, 12:34pm UTC](https://www.ruby-forum.com/t/best-db-structure-any-advice/149099 "2008-09-20T12:34:43Z")

</div>

Hi, I have a basic question about how to setup my models and DB structure. I will have an app that allow users to upload pictures. Pictures are related to cities. Users can upload pictures for many cities. The visito…

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

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