# Rails

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

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

---

## [Http Basic Authentication and AJAX](https://www.ruby-forum.com/t/http-basic-authentication-and-ajax/147747)

<div class="topic-metadata">

**Author:** [@bparanj](https://www.ruby-forum.com/u/bparanj)\
**Replies:** 3\
**Last updated:** [September 5, 2008, 12:17am UTC](https://www.ruby-forum.com/t/http-basic-authentication-and-ajax/147747 "2008-09-05T00:17:09Z")

</div>

Does anyone know how to make AJAX calls to admin name spaced controllers that requires http basic authentication? TIA.

---

## [Autotest error - \`slice': can't convert Regexp into Integer (TypeError)?](https://www.ruby-forum.com/t/autotest-error-slice-cant-convert-regexp-into-integer-typeerror/147743)

<div class="topic-metadata">

**Author:** [@greg](https://www.ruby-forum.com/u/greg)\
**Replies:** 0\
**Last updated:** [September 4, 2008, 11:07pm UTC](https://www.ruby-forum.com/t/autotest-error-slice-cant-convert-regexp-into-integer-typeerror/147743 "2008-09-04T23:07:27Z")

</div>

Hi, Just downloaded ZenTest and ran however I’m getting the following error. Any ideas? /Users/greg/.autotest:11:in slice': can't convert Regexp into Integer (TypeError) from /Users/greg/.autotest:11 from /opt/local/…

---

## [Record Count in AR using to\_xml Options](https://www.ruby-forum.com/t/record-count-in-ar-using-to-xml-options/147742)

<div class="topic-metadata">

**Author:** [@freephoneid](https://www.ruby-forum.com/u/freephoneid)\
**Replies:** 0\
**Last updated:** [September 4, 2008, 10:59pm UTC](https://www.ruby-forum.com/t/record-count-in-ar-using-to-xml-options/147742 "2008-09-04T22:59:15Z")

</div>

Hi, I’m new to Ruby & using ROR as a web service. I’m returning XML using statement: @persons = Person.find(:all) render :xml =\> persons.to\_xml() Now, this returns xml fine without any issues. However, it does not …

---

## [Rails/Apache/Mongrel/SSL](https://www.ruby-forum.com/t/rails-apache-mongrel-ssl/147739)

<div class="topic-metadata">

**Author:** [@bmcelhany](https://www.ruby-forum.com/u/bmcelhany)\
**Replies:** 5\
**Last updated:** [September 4, 2008, 10:58pm UTC](https://www.ruby-forum.com/t/rails-apache-mongrel-ssl/147739 "2008-09-04T22:58:40Z")

</div>

Hi all, I’m looking for a little guidance here in setting up my .htacces and/ or httpd.conf files. I’ve got a single Rails app that happens to have two domains pointing to it…let’s say www.domain1.com and www.domain2…

---

## [ActiveRecord.find.each do](https://www.ruby-forum.com/t/activerecord-find-each-do/147728)

<div class="topic-metadata">

**Author:** [@capnregex](https://www.ruby-forum.com/u/capnregex)\
**Replies:** 3\
**Last updated:** [September 4, 2008, 10:58pm UTC](https://www.ruby-forum.com/t/activerecord-find-each-do/147728 "2008-09-04T22:58:40Z")

</div>

I have noticed that when I use the construct… ActiveRecordChild.find(:all).each do |record| record.do\_something end That it still returns the array of all records. With larger datasets this can be murder on memory… …

---

## [About transaction do..end block (or critical section)](https://www.ruby-forum.com/t/about-transaction-do-end-block-or-critical-section/147730)

<div class="topic-metadata">

**Author:** [@difei](https://www.ruby-forum.com/u/difei)\
**Replies:** 4\
**Last updated:** [September 4, 2008, 9:48pm UTC](https://www.ruby-forum.com/t/about-transaction-do-end-block-or-critical-section/147730 "2008-09-04T21:48:48Z")

</div>

Greetings all, Does the transaction do…end block guaranteed a critical section or just a database transaction? I want to save some file to the file system and then save the file path to a DB table, there are race cond…

---

## [Error connecting to mysql](https://www.ruby-forum.com/t/error-connecting-to-mysql/147632)

<div class="topic-metadata">

**Author:** [@adolf](https://www.ruby-forum.com/u/adolf)\
**Replies:** 23\
**Last updated:** [September 4, 2008, 9:12pm UTC](https://www.ruby-forum.com/t/error-connecting-to-mysql/147632 "2008-09-04T21:12:25Z")

</div>

i was trying to setup an application checked out from svnin my local machine. i managed to do all that is required except when it came to the step of creating databases for the application, when i tried to connect t…

---

## [Hash#slice!](https://www.ruby-forum.com/t/hash-slice/147359)

<div class="topic-metadata">

**Author:** [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Replies:** 6\
**Last updated:** [September 4, 2008, 8:17pm UTC](https://www.ruby-forum.com/t/hash-slice/147359 "2008-09-04T20:17:32Z")

</div>

Hi, One of the fundamental methods share by both ActiveSupport and Facets is Hash#slice!. A few days ago, someone pointed out to me that the two libs in this case are not quite the same. Quote, “I got hosed by a lovel…

---

## [Unable to clear cached pages](https://www.ruby-forum.com/t/unable-to-clear-cached-pages/147727)

<div class="topic-metadata">

**Author:** [@mindtriggerz](https://www.ruby-forum.com/u/mindtriggerz)\
**Replies:** 2\
**Last updated:** [September 4, 2008, 7:45pm UTC](https://www.ruby-forum.com/t/unable-to-clear-cached-pages/147727 "2008-09-04T19:45:55Z")

</div>

I am trying to utilize page caching in my application, and have done the following: config.action\_controller.perform\_caching = true config.action\_view.cache\_template\_extensions = false (What is tha…

---

## [About transaction do..end block (or critical section)](https://www.ruby-forum.com/t/about-transaction-do-end-block-or-critical-section/147731)

<div class="topic-metadata">

**Author:** [@difei](https://www.ruby-forum.com/u/difei)\
**Replies:** 0\
**Last updated:** [September 4, 2008, 7:21pm UTC](https://www.ruby-forum.com/t/about-transaction-do-end-block-or-critical-section/147731 "2008-09-04T19:21:20Z")

</div>

Greetings all, Does the transaction do…end block guaranteed a critical section or just a database transaction? I want to save some file to the file system and then save the file path to a DB table, there are race cond…

---

## [In\_place\_editor\_field javaScript](https://www.ruby-forum.com/t/in-place-editor-field-javascript/147726)

<div class="topic-metadata">

**Author:** [@snantz](https://www.ruby-forum.com/u/snantz)\
**Replies:** 0\
**Last updated:** [September 4, 2008, 6:46pm UTC](https://www.ruby-forum.com/t/in-place-editor-field-javascript/147726 "2008-09-04T18:46:06Z")

</div>

I can’t find this anywhere, but is there a way to add some javaScript to an in\_place\_editor\_field. What I would like to do is make it so that certain characters cannot be entered into that field. Thanks, -S

---

## [Designer role in ROR development](https://www.ruby-forum.com/t/designer-role-in-ror-development/147683)

<div class="topic-metadata">

**Author:** [@tarakeshwarrao](https://www.ruby-forum.com/u/tarakeshwarrao)\
**Replies:** 6\
**Last updated:** [September 4, 2008, 5:37pm UTC](https://www.ruby-forum.com/t/designer-role-in-ror-development/147683 "2008-09-04T17:37:28Z")

</div>

I am just starting with rails or to be precise web development… I just want to know… wats the role of a designer in ROR development(the guy who works on dreamweaver and stuff)…?? does the designer works only on layout…

---

## [Some newbie help needed on validating a nested form/model](https://www.ruby-forum.com/t/some-newbie-help-needed-on-validating-a-nested-form-model/147691)

<div class="topic-metadata">

**Author:** [@rick](https://www.ruby-forum.com/u/rick)\
**Replies:** 1\
**Last updated:** [September 4, 2008, 5:35pm UTC](https://www.ruby-forum.com/t/some-newbie-help-needed-on-validating-a-nested-form-model/147691 "2008-09-04T17:35:08Z")

</div>

Been googling and coming up short on finding examples on the best practice for validating nested forms. I’m still a newb so any concrete code examples would be great. My application is going to allow one to record hoc…

---

## [Persist checked checkboxes in pagination](https://www.ruby-forum.com/t/persist-checked-checkboxes-in-pagination/84893)

<div class="topic-metadata">

**Author:** [@Jahnvi](https://www.ruby-forum.com/u/Jahnvi)\
**Replies:** 2\
**Last updated:** [September 4, 2008, 4:57pm UTC](https://www.ruby-forum.com/t/persist-checked-checkboxes-in-pagination/84893 "2008-09-04T16:57:38Z")

</div>

hi, i have used following code in controller for pagination def view page = (params\[:page\] ||= 1).to\_i items\_per\_page = 3 offset = (page - 1) \* items\_per\_page @prods=Item.find\_by\_sql(“select \* from items order by id…

---

## [Best server solution](https://www.ruby-forum.com/t/best-server-solution/147593)

<div class="topic-metadata">

**Author:** [@sigma](https://www.ruby-forum.com/u/sigma)\
**Replies:** 9\
**Last updated:** [September 4, 2008, 4:18pm UTC](https://www.ruby-forum.com/t/best-server-solution/147593 "2008-09-04T16:18:19Z")

</div>

Hi all I must set up a Dedicated Server for a large community which is based on ruby on rails. What is the best, fastest & most secure server solution/configuration for this? I found several different opinions on th…

---

## [How can i disable the named routes generated in a nestes route](https://www.ruby-forum.com/t/how-can-i-disable-the-named-routes-generated-in-a-nestes-route/147573)

<div class="topic-metadata">

**Author:** [@swachian](https://www.ruby-forum.com/u/swachian)\
**Replies:** 2\
**Last updated:** [September 4, 2008, 3:53pm UTC](https://www.ruby-forum.com/t/how-can-i-disable-the-named-routes-generated-in-a-nestes-route/147573 "2008-09-04T15:53:06Z")

</div>

in routes.rb, code like : map.resources :users do |user| user.resources :addressbooks end will generate routes like ‘/users/1/addressbooks/1’ and ‘/addressbooks/ 1’. My question is that how i can disable the later …

---

## [This is really strange... I need help plz](https://www.ruby-forum.com/t/this-is-really-strange-i-need-help-plz/147677)

<div class="topic-metadata">

**Author:** [@lpdahito](https://www.ruby-forum.com/u/lpdahito)\
**Replies:** 2\
**Last updated:** [September 4, 2008, 3:43pm UTC](https://www.ruby-forum.com/t/this-is-really-strange-i-need-help-plz/147677 "2008-09-04T15:43:05Z")

</div>

Hi everybody, Here’s the story… I’m making an application that’s gonna help me manage my money when i go to the grocery store…nothing complicated… Here’s how i did the first coding: script/generate scaffold Food name…

---

## [Cookies in custom class](https://www.ruby-forum.com/t/cookies-in-custom-class/147707)

<div class="topic-metadata">

**Author:** [@konstantin](https://www.ruby-forum.com/u/konstantin)\
**Replies:** 3\
**Last updated:** [September 4, 2008, 2:38pm UTC](https://www.ruby-forum.com/t/cookies-in-custom-class/147707 "2008-09-04T14:38:39Z")

</div>

Hello! I have created a custom class in my RoR application and put it into lib/ folder. How can I access cookies and session variables in this class? I need to set and read variables from them. Best regards.

---

## [Selenium IDE or Selenium on Rails? Is there a BIG difference?](https://www.ruby-forum.com/t/selenium-ide-or-selenium-on-rails-is-there-a-big-difference/147651)

<div class="topic-metadata">

**Author:** [@paco.onrails](https://www.ruby-forum.com/u/paco.onrails)\
**Replies:** 1\
**Last updated:** [September 4, 2008, 2:11pm UTC](https://www.ruby-forum.com/t/selenium-ide-or-selenium-on-rails-is-there-a-big-difference/147651 "2008-09-04T14:11:11Z")

</div>

Hello again. What I don’t finish to understand is what is the big difference between cases/suites that I can create and run in Selenium IDE and cases/suites that i can create and run using Selenium on Rails. Seeing R…

---

## [Module that adds same class & instance methods](https://www.ruby-forum.com/t/module-that-adds-same-class-instance-methods/147528)

<div class="topic-metadata">

**Author:** [@dean](https://www.ruby-forum.com/u/dean)\
**Replies:** 2\
**Last updated:** [September 4, 2008, 1:54pm UTC](https://www.ruby-forum.com/t/module-that-adds-same-class-instance-methods/147528 "2008-09-04T13:54:38Z")

</div>

I am writing a plugin that adds similar methods to a class and instances of that class. It is mostly a convenience and exercise to me. The idea behind the module is to tell the model what the name of its icon should…

---

## [Ar\_mailer not mailing](https://www.ruby-forum.com/t/ar-mailer-not-mailing/147706)

<div class="topic-metadata">

**Author:** [@fangheuschrecke](https://www.ruby-forum.com/u/fangheuschrecke)\
**Replies:** 0\
**Last updated:** [September 4, 2008, 1:27pm UTC](https://www.ruby-forum.com/t/ar-mailer-not-mailing/147706 "2008-09-04T13:27:01Z")

</div>

Hi all, i’ve set up ar\_mailer. It’s all working except the sending over smtp. Emails are showing up in the emails table. in enviroment.rb ActionMailer::Base.delivery\_method = :smtp ActionMailer::Base.smtp\_settings =…

---

## [Specifying a URI prefix for a route](https://www.ruby-forum.com/t/specifying-a-uri-prefix-for-a-route/146204)

<div class="topic-metadata">

**Author:** [@weyus](https://www.ruby-forum.com/u/weyus)\
**Replies:** 1\
**Last updated:** [September 4, 2008, 1:14pm UTC](https://www.ruby-forum.com/t/specifying-a-uri-prefix-for-a-route/146204 "2008-09-04T13:14:10Z")

</div>

All, I have an unusual requirement. I have two apps. deployed in a JEE container (one Rails, one Merb), and I am redirecting various requests between them. That is, from app. A, I am redirecting to a app. B URL and…

---

## [Adding a global path prefix in routes](https://www.ruby-forum.com/t/adding-a-global-path-prefix-in-routes/144156)

<div class="topic-metadata">

**Author:** [@nini](https://www.ruby-forum.com/u/nini)\
**Replies:** 1\
**Last updated:** [September 4, 2008, 1:12pm UTC](https://www.ruby-forum.com/t/adding-a-global-path-prefix-in-routes/144156 "2008-09-04T13:12:59Z")

</div>

I’m having some trouble figuring out how to add a path prefix to all paths in a site. I see the option to use :path\_prefix when using resources, but this isn’t exactly what I want. I would simply like to add a stati…

---

## [Disable timestamps (scaffold.css?82563531) for wget?](https://www.ruby-forum.com/t/disable-timestamps-scaffold-css-82563531-for-wget/147653)

<div class="topic-metadata">

**Author:** [@josh](https://www.ruby-forum.com/u/josh)\
**Replies:** 4\
**Last updated:** [September 4, 2008, 12:36pm UTC](https://www.ruby-forum.com/t/disable-timestamps-scaffold-css-82563531-for-wget/147653 "2008-09-04T12:36:46Z")

</div>

Hi all I’m trying to make a copy of my whole Rails website using wget: wget -rkpl 5 localhost:3000 Sadly all the references to images, stylesheets, javascripts etc. don’t work, I guess because of the timestamps that …

---

## [What's the problem with paginate?](https://www.ruby-forum.com/t/whats-the-problem-with-paginate/147700)

<div class="topic-metadata">

**Author:** [@Murray](https://www.ruby-forum.com/u/Murray)\
**Replies:** 0\
**Last updated:** [September 4, 2008, 12:07pm UTC](https://www.ruby-forum.com/t/whats-the-problem-with-paginate/147700 "2008-09-04T12:07:18Z")

</div>

I’m new in rails, but it attracts me so much. When i learn “Agile Web Development with Rails, 2nd Edition”, i find that ‘pagniate’ is very useful. But when i try to make a sample by myself, the pagniate seems uneffec…

---

## [LoadError when installing RubyGems on Red Hat Linux](https://www.ruby-forum.com/t/loaderror-when-installing-rubygems-on-red-hat-linux/147604)

<div class="topic-metadata">

**Author:** [@gers32](https://www.ruby-forum.com/u/gers32)\
**Replies:** 2\
**Last updated:** [September 4, 2008, 12:02pm UTC](https://www.ruby-forum.com/t/loaderror-when-installing-rubygems-on-red-hat-linux/147604 "2008-09-04T12:02:35Z")

</div>

Hi, I’m trying to install a RoR application in a Red Hat Linux environment, when I was working in Windows up to now… The Ruby installation was successful and I set the PATH to include the directory containing the rub…

---

## [Can I have a model being populated from an rss feed instad of a db table?](https://www.ruby-forum.com/t/can-i-have-a-model-being-populated-from-an-rss-feed-instad-of-a-db-table/147698)

<div class="topic-metadata">

**Author:** [@HaNNiBaL80](https://www.ruby-forum.com/u/HaNNiBaL80)\
**Replies:** 0\
**Last updated:** [September 4, 2008, 11:39am UTC](https://www.ruby-forum.com/t/can-i-have-a-model-being-populated-from-an-rss-feed-instad-of-a-db-table/147698 "2008-09-04T11:39:43Z")

</div>

I’m developing an app, that will read data from a db, but in a few months I have to change it to read from xml feeds . If anyone has done something similar or has some ideas on this, I would apreciate some hints. Tha…

---

## [Strftime and 10th of a second?](https://www.ruby-forum.com/t/strftime-and-10th-of-a-second/147620)

<div class="topic-metadata">

**Author:** [@Birgit\_A](https://www.ruby-forum.com/u/Birgit_A)\
**Replies:** 2\
**Last updated:** [September 4, 2008, 11:28am UTC](https://www.ruby-forum.com/t/strftime-and-10th-of-a-second/147620 "2008-09-04T11:28:34Z")

</div>

Hi all, I’m using JRuby on Rails 2.x One of the requirements of my project is to create a recordings filename that includes date and time. This is what I’ve got so far. now = Time.new @record\_filename = “” @record\_…

---

## [Lang/en.yaml Need your help](https://www.ruby-forum.com/t/lang-en-yaml-need-your-help/147696)

<div class="topic-metadata">

**Author:** [@Abhishek\_shukla](https://www.ruby-forum.com/u/Abhishek_shukla)\
**Replies:** 0\
**Last updated:** [September 4, 2008, 11:22am UTC](https://www.ruby-forum.com/t/lang-en-yaml-need-your-help/147696 "2008-09-04T11:22:40Z")

</div>

Hello friend, Just need a help like i have a requirement when in a single file i have to save all the messages and from controller n view need to call those message, so for this i had seen somewhere like we can crea…

---

## [Eager loading, like column names, and conditions](https://www.ruby-forum.com/t/eager-loading-like-column-names-and-conditions/147676)

<div class="topic-metadata">

**Author:** [@technodolt](https://www.ruby-forum.com/u/technodolt)\
**Replies:** 2\
**Last updated:** [September 4, 2008, 10:04am UTC](https://www.ruby-forum.com/t/eager-loading-like-column-names-and-conditions/147676 "2008-09-04T10:04:44Z")

</div>

Hi all, The setup: I’ve got a Candidate model, and it has two associations like: has\_many :next\_tasks, :class\_name =\> ‘Task’, :foreign\_key =\> ‘candidate\_id’, :conditions =\> \[‘start\_time \> now() and not deleted = 0’\]…

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

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