# Rails

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

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

---

## [Help with schedule and pdf](https://www.ruby-forum.com/t/help-with-schedule-and-pdf/132515)

<div class="topic-metadata">

**Author:** [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Replies:** 3\
**Last updated:** [March 21, 2008, 10:57am UTC](https://www.ruby-forum.com/t/help-with-schedule-and-pdf/132515 "2008-03-21T10:57:59Z")

</div>

I would like to be able to do this: I want to generate a pdf all Fridays at an specific time. This pdf should be stored in an specific place too. So I think something that makes the application able to look at what ti…

---

## [\[ActiveRecord::validations\] check CNAME or Empty](https://www.ruby-forum.com/t/activerecord-validations-check-cname-or-empty/132545)

<div class="topic-metadata">

**Author:** [@evaisse](https://www.ruby-forum.com/u/evaisse)\
**Replies:** 0\
**Last updated:** [March 21, 2008, 9:32am UTC](https://www.ruby-forum.com/t/activerecord-validations-check-cname-or-empty/132545 "2008-03-21T09:32:06Z")

</div>

Hi I wanna check in my model if the field is conform to a CNAME OR is empty I’ve put something like this in my model : validates\_format\_of :cname, :with =\> /^\[a-z0-9-\]+$/i, :unless =\> :cname.strip == ‘’

---

## [Problems with attachment\_fo and images update](https://www.ruby-forum.com/t/problems-with-attachment-fo-and-images-update/132546)

<div class="topic-metadata">

**Author:** [@stratboy](https://www.ruby-forum.com/u/stratboy)\
**Replies:** 0\
**Last updated:** [March 21, 2008, 9:27am UTC](https://www.ruby-forum.com/t/problems-with-attachment-fo-and-images-update/132546 "2008-03-21T09:27:41Z")

</div>

I have installed attachment\_fu and i have use this tutorial for change the path\_prefix: http://the.railsi.st/2007/8/21/how-to-customize-attachment\_fu-file-names the path of images+thumbnail are: /images/cores/fullsiz…

---

## [\[ANN\] RailsMan for Leopard](https://www.ruby-forum.com/t/ann-railsman-for-leopard/132544)

<div class="topic-metadata">

**Author:** [@daver](https://www.ruby-forum.com/u/daver)\
**Replies:** 0\
**Last updated:** [March 21, 2008, 8:50am UTC](https://www.ruby-forum.com/t/ann-railsman-for-leopard/132544 "2008-03-21T08:50:53Z")

</div>

Hello all! I was disappointed to see Locomotive retired when Leopard was released; I was using it less because of it’s Rails bundles and more because it’s convenient to see all of my development sites and whether the…

---

## [(basic sql) search datetime column by date](https://www.ruby-forum.com/t/basic-sql-search-datetime-column-by-date/132429)

<div class="topic-metadata">

**Author:** [@jko170](https://www.ruby-forum.com/u/jko170)\
**Replies:** 5\
**Last updated:** [March 21, 2008, 7:45am UTC](https://www.ruby-forum.com/t/basic-sql-search-datetime-column-by-date/132429 "2008-03-21T07:45:49Z")

</div>

I have a datetime column and I need to search by a date, not datetime. So obviously, I cannot do this: find(:all, :conditions =\> \[‘my\_datetime\_column = ?’, Date.today\]) All I want to do is find the records on a dateti…

---

## [Validate That Certain Tags Are Not Apart Of Input](https://www.ruby-forum.com/t/validate-that-certain-tags-are-not-apart-of-input/132541)

<div class="topic-metadata">

**Author:** [@johnk](https://www.ruby-forum.com/u/johnk)\
**Replies:** 0\
**Last updated:** [March 21, 2008, 7:39am UTC](https://www.ruby-forum.com/t/validate-that-certain-tags-are-not-apart-of-input/132541 "2008-03-21T07:39:22Z")

</div>

Is there a gem/plugin that can be used to validate that no tags where submitted as part of a field? A blacklist for XHTML tags. Thanks :-). – John K. removed\_email\_address@domain.invalid Blog: http://www.kopanas.c…

---

## [Acts\_as\_cached missing](https://www.ruby-forum.com/t/acts-as-cached-missing/132542)

<div class="topic-metadata">

**Author:** [@grayson](https://www.ruby-forum.com/u/grayson)\
**Replies:** 0\
**Last updated:** [March 21, 2008, 7:25am UTC](https://www.ruby-forum.com/t/acts-as-cached-missing/132542 "2008-03-21T07:25:50Z")

</div>

I can’t seem to be able to get a very basic cache working on my user model. I have the following in the user model class User \< ActiveRecord::Base acts\_as\_cached :include =\> \[:user\_videos, :user\_images, :user\_interes…

---

## [Acts\_as\_list error - help!](https://www.ruby-forum.com/t/acts-as-list-error-help/132539)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [March 21, 2008, 6:33am UTC](https://www.ruby-forum.com/t/acts-as-list-error-help/132539 "2008-03-21T06:33:08Z")

</div>

I’m having a problem with acts\_as\_list, and I’m stumped. I have two models: page and item. A page contains a list of items: class Page \< ActiveRecord::Base has\_many :items, :dependent =\> :destroy, :order =\> :position …

---

## [MVC Design Question - dependent objects](https://www.ruby-forum.com/t/mvc-design-question-dependent-objects/132403)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 3\
**Last updated:** [March 21, 2008, 4:06am UTC](https://www.ruby-forum.com/t/mvc-design-question-dependent-objects/132403 "2008-03-21T04:06:20Z")

</div>

Given entity has\_one, :client client belongs\_to :entity When creating a new client and an instance of entity.name does not exist then I want to add an entity and a client. (This is done and works) If entity.name exi…

---

## [Backend Clustering solution, recommendations](https://www.ruby-forum.com/t/backend-clustering-solution-recommendations/131966)

<div class="topic-metadata">

**Author:** [@divotdave](https://www.ruby-forum.com/u/divotdave)\
**Replies:** 2\
**Last updated:** [March 21, 2008, 3:05am UTC](https://www.ruby-forum.com/t/backend-clustering-solution-recommendations/131966 "2008-03-21T03:05:39Z")

</div>

Hi, I was wondering if anyone could recommend a database clustering solution for a massive warehouse. Rails/flex being the main front end. Talking a few million rows, with queries that may touch a million rows every f…

---

## [How to unit test Rails itself (API)?](https://www.ruby-forum.com/t/how-to-unit-test-rails-itself-api/132459)

<div class="topic-metadata">

**Author:** [@liuxlsh](https://www.ruby-forum.com/u/liuxlsh)\
**Replies:** 5\
**Last updated:** [March 21, 2008, 3:01am UTC](https://www.ruby-forum.com/t/how-to-unit-test-rails-itself-api/132459 "2008-03-21T03:01:33Z")

</div>

Hello, I searched unit test for Rails on internet, but all the results are for testing Rails APPLICATION generated by Rails. But I think Rails itself needs unit test, too. I need to make sure that all APIs/methods of…

---

## [Info: \_flash.html.erb partial a bad idea](https://www.ruby-forum.com/t/info-flash-html-erb-partial-a-bad-idea/132528)

<div class="topic-metadata">

**Author:** [@pedz](https://www.ruby-forum.com/u/pedz)\
**Replies:** 0\
**Last updated:** [March 21, 2008, 2:47am UTC](https://www.ruby-forum.com/t/info-flash-html-erb-partial-a-bad-idea/132528 "2008-03-21T02:47:54Z")

</div>

I guess a partial creates a variable by the same name. I wrote a simple partial called \_flash.html.erb in which I display the flash errors and warnings. But, inside that partial, flash was defined but set to nil. Re…

---

## [New install on Mac server start error](https://www.ruby-forum.com/t/new-install-on-mac-server-start-error/132519)

<div class="topic-metadata">

**Author:** [@jeremysarda](https://www.ruby-forum.com/u/jeremysarda)\
**Replies:** 2\
**Last updated:** [March 21, 2008, 2:17am UTC](https://www.ruby-forum.com/t/new-install-on-mac-server-start-error/132519 "2008-03-21T02:17:50Z")

</div>

Hi, I have installed a Macports Ruby on Rails with MySQL and Mongrel following the instructions from:http://wiki.rubyonrails.org/rails/pages/Installation The server did start fine but now exits with the following Ter…

---

## [Where to set a variable so it's loaded only once and available for all controllers?](https://www.ruby-forum.com/t/where-to-set-a-variable-so-its-loaded-only-once-and-available-for-all-controllers/131627)

<div class="topic-metadata">

**Author:** [@g0nzo](https://www.ruby-forum.com/u/g0nzo)\
**Replies:** 3\
**Last updated:** [March 21, 2008, 1:57am UTC](https://www.ruby-forum.com/t/where-to-set-a-variable-so-its-loaded-only-once-and-available-for-all-controllers/131627 "2008-03-21T01:57:41Z")

</div>

Hi, I’m using GeoIP that loads database file with countries when the GeoIP object is created. Where should I initialize this object, so it would be loaded only once (not for every request) and available for all contr…

---

## [Creating print preview button?](https://www.ruby-forum.com/t/creating-print-preview-button/132324)

<div class="topic-metadata">

**Author:** [@casid](https://www.ruby-forum.com/u/casid)\
**Replies:** 3\
**Last updated:** [March 21, 2008, 1:34am UTC](https://www.ruby-forum.com/t/creating-print-preview-button/132324 "2008-03-21T01:34:48Z")

</div>

Hi everyone, do you have any idea about how to create print preview button? thanks…

---

## [Filter on a Related Table](https://www.ruby-forum.com/t/filter-on-a-related-table/132520)

<div class="topic-metadata">

**Author:** [@wickie](https://www.ruby-forum.com/u/wickie)\
**Replies:** 1\
**Last updated:** [March 21, 2008, 12:46am UTC](https://www.ruby-forum.com/t/filter-on-a-related-table/132520 "2008-03-21T00:46:45Z")

</div>

I have an application with two related tables as follows User has\_many :items Item belongs\_to :user The description of the item table includes the following columns: user\_id int not null, itemDate date For a view…

---

## [Pros and cons of ActiveScaffold 1.1.1](https://www.ruby-forum.com/t/pros-and-cons-of-activescaffold-1-1-1/132510)

<div class="topic-metadata">

**Author:** [@menestra](https://www.ruby-forum.com/u/menestra)\
**Replies:** 1\
**Last updated:** [March 20, 2008, 11:58pm UTC](https://www.ruby-forum.com/t/pros-and-cons-of-activescaffold-1-1-1/132510 "2008-03-20T23:58:36Z")

</div>

Dear, i’m using this plugin on Rails 2.0.2 for a small project (about 30 tables in MySQL) but i would know your feedbacks about ActiveScaffold. And what are the best plugin for it? Are There any examples other than t…

---

## [Ruby have include like php and refresh?](https://www.ruby-forum.com/t/ruby-have-include-like-php-and-refresh/132370)

<div class="topic-metadata">

**Author:** [@megax](https://www.ruby-forum.com/u/megax)\
**Replies:** 4\
**Last updated:** [March 20, 2008, 11:56pm UTC](https://www.ruby-forum.com/t/ruby-have-include-like-php-and-refresh/132370 "2008-03-20T23:56:15Z")

</div>

Im starting to get tired of putting all the information on my layouts for links to my pages. I was wondering if ruby on rails had an include function like php where I could put the links in one file and put one li…

---

## [Javascript](https://www.ruby-forum.com/t/javascript/132356)

<div class="topic-metadata">

**Author:** [@sijo](https://www.ruby-forum.com/u/sijo)\
**Replies:** 1\
**Last updated:** [March 20, 2008, 11:40pm UTC](https://www.ruby-forum.com/t/javascript/132356 "2008-03-20T23:40:16Z")

</div>

Hi I have a form \<%= form\_remote\_tag :url =\> { :action =\> ‘sd\_resolution\_save’, :id =\> @sd\_ticket.id, },%\> Resolution Code \<%= select( "sd\_resolution", "service\_desk\_resolution\_code\_id", ServiceDeskResolu…

---

## [About id in the url](https://www.ruby-forum.com/t/about-id-in-the-url/132436)

<div class="topic-metadata">

**Author:** [@daociyiyou](https://www.ruby-forum.com/u/daociyiyou)\
**Replies:** 1\
**Last updated:** [March 20, 2008, 11:33pm UTC](https://www.ruby-forum.com/t/about-id-in-the-url/132436 "2008-03-20T23:33:49Z")

</div>

Hello: I have codes to identify the user when an user try to modify the database using id.This is useful for preventing others to modify a user’s data.But after a registered user login,he can still modify the data th…

---

## [Forms in Rails 2.0](https://www.ruby-forum.com/t/forms-in-rails-2-0/132509)

<div class="topic-metadata">

**Author:** [@liquidrails](https://www.ruby-forum.com/u/liquidrails)\
**Replies:** 1\
**Last updated:** [March 20, 2008, 10:25pm UTC](https://www.ruby-forum.com/t/forms-in-rails-2-0/132509 "2008-03-20T22:25:28Z")

</div>

I am using form\_for and would like the params of the entered form values to appear in the url. How can I do this in Rails 2.0 using “form\_for”? Thanks

---

## ["can't activate activesupport" error](https://www.ruby-forum.com/t/cant-activate-activesupport-error/132507)

<div class="topic-metadata">

**Author:** [@g0nzo](https://www.ruby-forum.com/u/g0nzo)\
**Replies:** 2\
**Last updated:** [March 20, 2008, 10:09pm UTC](https://www.ruby-forum.com/t/cant-activate-activesupport-error/132507 "2008-03-20T22:09:35Z")

</div>

Hi, I’ve got a production server with rails 1.2.3 installed. Previously my app had frozen rails 1.2.3 as well. I decided to update frozen rails to 1.2.6. Deployment went fine until rake task was executed, which resul…

---

## [Anyone know of a humanised date difference plugin/script](https://www.ruby-forum.com/t/anyone-know-of-a-humanised-date-difference-plugin-script/132496)

<div class="topic-metadata">

**Author:** [@DEfusion](https://www.ruby-forum.com/u/DEfusion)\
**Replies:** 2\
**Last updated:** [March 20, 2008, 9:50pm UTC](https://www.ruby-forum.com/t/anyone-know-of-a-humanised-date-difference-plugin-script/132496 "2008-03-20T21:50:12Z")

</div>

I’m looking for something that when given two dates would give me something like ‘3 days ago’ or ‘2 hours ago’ etc. I’ve done quite a bit of searching and either I’m not searching on the right stuff or there is nothin…

---

## [Select SQL conditions based on database](https://www.ruby-forum.com/t/select-sql-conditions-based-on-database/132365)

<div class="topic-metadata">

**Author:** [@gsterndale](https://www.ruby-forum.com/u/gsterndale)\
**Replies:** 1\
**Last updated:** [March 20, 2008, 9:44pm UTC](https://www.ruby-forum.com/t/select-sql-conditions-based-on-database/132365 "2008-03-20T21:44:20Z")

</div>

I’d like to have database agnostic code, however I have been unsuccessful writing conditions that work for both postgres and mysql for the following: postgres only conditions = \[“curtain\_at + CAST (CAST (duration AS V…

---

## [How to use a controller/model in a different view](https://www.ruby-forum.com/t/how-to-use-a-controller-model-in-a-different-view/132313)

<div class="topic-metadata">

**Author:** [@tresero](https://www.ruby-forum.com/u/tresero)\
**Replies:** 4\
**Last updated:** [March 20, 2008, 9:17pm UTC](https://www.ruby-forum.com/t/how-to-use-a-controller-model-in-a-different-view/132313 "2008-03-20T21:17:16Z")

</div>

I am trying to put a random rss feed in the main (application) view. The code works if I surf to /feed/, but if I use the same partial outside of views/feeds/ I get errors about nil objects. It seems that the partial …

---

## [Comatose Authentication](https://www.ruby-forum.com/t/comatose-authentication/132502)

<div class="topic-metadata">

**Author:** [@maged](https://www.ruby-forum.com/u/maged)\
**Replies:** 2\
**Last updated:** [March 20, 2008, 9:02pm UTC](https://www.ruby-forum.com/t/comatose-authentication/132502 "2008-03-20T21:02:37Z")

</div>

Hi guys, I install and ran the Comatose CMS fine. I have a problem now trying to make the site use authentication. I added the code \*\* # Includes AuthenticationSystem in the ComatoseAdminController config.admin\_incl…

---

## [Logging API Calls](https://www.ruby-forum.com/t/logging-api-calls/132390)

<div class="topic-metadata">

**Author:** [@jasonallen](https://www.ruby-forum.com/u/jasonallen)\
**Replies:** 4\
**Last updated:** [March 20, 2008, 8:32pm UTC](https://www.ruby-forum.com/t/logging-api-calls/132390 "2008-03-20T20:32:27Z")

</div>

Hello, I am building an API and I was wondering if there are any best practices out there for logging and monitoring the calls. Ideally I’d like to track: What types of calls Which user account is being hit Which d…

---

## [Converting data to utf8 to load into an ActiveRecord?](https://www.ruby-forum.com/t/converting-data-to-utf8-to-load-into-an-activerecord/132500)

<div class="topic-metadata">

**Author:** [@Henry\_W](https://www.ruby-forum.com/u/Henry_W)\
**Replies:** 2\
**Last updated:** [March 20, 2008, 8:27pm UTC](https://www.ruby-forum.com/t/converting-data-to-utf8-to-load-into-an-activerecord/132500 "2008-03-20T20:27:44Z")

</div>

Hi, I’ve got a text file of data that I need to parse and loaded into my Rails app. I’ve created a migration script the loads and parses the file, but some of the data contains non-utf8 strings, causing an exception…

---

## [Blank DateTime versus Nil DateTime](https://www.ruby-forum.com/t/blank-datetime-versus-nil-datetime/132461)

<div class="topic-metadata">

**Author:** [@fcano](https://www.ruby-forum.com/u/fcano)\
**Replies:** 4\
**Last updated:** [March 20, 2008, 8:18pm UTC](https://www.ruby-forum.com/t/blank-datetime-versus-nil-datetime/132461 "2008-03-20T20:18:21Z")

</div>

Hi! These days I have been having trouble with a test that tried to test DateTime functionality. I have discovered that a NULL DateTime is auto-type casted to NIL by Rails. My problem here is that I have a field :dat…

---

## [Make routes with e-mail address](https://www.ruby-forum.com/t/make-routes-with-e-mail-address/132294)

<div class="topic-metadata">

**Author:** [@makire](https://www.ruby-forum.com/u/makire)\
**Replies:** 2\
**Last updated:** [March 20, 2008, 8:00pm UTC](https://www.ruby-forum.com/t/make-routes-with-e-mail-address/132294 "2008-03-20T20:00:43Z")

</div>

Hi I have a RESTful controller that works when using a numeric ID. Now I would like to accept user login names as ID and for some of the cases this is an e-mail address. In short it boils down to routing the request …

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

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