# Rails

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

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

---

## [New to Ruby Need some help](https://www.ruby-forum.com/t/new-to-ruby-need-some-help/160799)

<div class="topic-metadata">

**Author:** [@erubin](https://www.ruby-forum.com/u/erubin)\
**Replies:** 1\
**Last updated:** [February 19, 2009, 9:02pm UTC](https://www.ruby-forum.com/t/new-to-ruby-need-some-help/160799 "2009-02-19T21:02:35Z")

</div>

I am quite new to ruby on rails so bare with me. I just got an interesting repository from github and I have been trying diligently to get this app to work. This seems like a general error to me but I do not understan…

---

## [Test::unit](https://www.ruby-forum.com/t/test-unit/160580)

<div class="topic-metadata">

**Author:** [@jobber](https://www.ruby-forum.com/u/jobber)\
**Replies:** 8\
**Last updated:** [February 19, 2009, 8:34pm UTC](https://www.ruby-forum.com/t/test-unit/160580 "2009-02-19T20:34:53Z")

</div>

Hello, im trying since a few days with unit test. my problem is, i have write a test for 7 validates\_presence\_of and its ok. then i have write 2 validates\_uniqueness\_of and its ok. then i have write 1 test for valid…

---

## [Wysiwyg](https://www.ruby-forum.com/t/wysiwyg/160741)

<div class="topic-metadata">

**Author:** [@chaitanya](https://www.ruby-forum.com/u/chaitanya)\
**Replies:** 4\
**Last updated:** [February 19, 2009, 8:27pm UTC](https://www.ruby-forum.com/t/wysiwyg/160741 "2009-02-19T20:27:48Z")

</div>

WYSIWYG editor for user to enter the content using ruby on rails.

---

## [Resource routing error with the route equipment/new](https://www.ruby-forum.com/t/resource-routing-error-with-the-route-equipment-new/138986)

<div class="topic-metadata">

**Author:** [@dpitman](https://www.ruby-forum.com/u/dpitman)\
**Replies:** 3\
**Last updated:** [February 19, 2009, 7:49pm UTC](https://www.ruby-forum.com/t/resource-routing-error-with-the-route-equipment-new/138986 "2009-02-19T19:49:35Z")

</div>

I’m having an issue with resource routing after running a “ruby script/generate scaffold equipment” command. I did not make any changes to the equipment model/controller/views after running this. The full command I ra…

---

## [Execute an SQL statement each time DB connection is set up](https://www.ruby-forum.com/t/execute-an-sql-statement-each-time-db-connection-is-set-up/160718)

<div class="topic-metadata">

**Author:** [@absolute-beginner](https://www.ruby-forum.com/u/absolute-beginner)\
**Replies:** 3\
**Last updated:** [February 19, 2009, 7:23pm UTC](https://www.ruby-forum.com/t/execute-an-sql-statement-each-time-db-connection-is-set-up/160718 "2009-02-19T19:23:26Z")

</div>

Hi everyone. I need to execute a “SET SQL\_MODE=‘STRICT\_ALL\_TABLES’” after my application’s DB connection is established by AcriveRecord. This is important since I want the DB itself be more strict about logical data …

---

## [Undefined method \`content\_type' when editing already-uploaded items (attachment\_fu)](https://www.ruby-forum.com/t/undefined-method-content-type-when-editing-already-uploaded-items-attachment-fu/160745)

<div class="topic-metadata">

**Author:** [@adammontgomery](https://www.ruby-forum.com/u/adammontgomery)\
**Replies:** 1\
**Last updated:** [February 19, 2009, 7:10pm UTC](https://www.ruby-forum.com/t/undefined-method-content-type-when-editing-already-uploaded-items-attachment-fu/160745 "2009-02-19T19:10:06Z")

</div>

My project is for a photographer’s portfolio. He’s allowed to upload photographs, which are then displayed on the site. I’m using attachment\_fu. All of this works fine. Where I’m running into problems is in allowin…

---

## [Absolute image urls](https://www.ruby-forum.com/t/absolute-image-urls/160765)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 2\
**Last updated:** [February 19, 2009, 6:51pm UTC](https://www.ruby-forum.com/t/absolute-image-urls/160765 "2009-02-19T18:51:45Z")

</div>

Hey, I am sending out html emails. It seems to me that in order for the images to be properly shown in the email, their src needs to be absolute. More precisely, /images/email/header.gif will not work, but http://lo…

---

## [Using gems on a shared hosting](https://www.ruby-forum.com/t/using-gems-on-a-shared-hosting/160793)

<div class="topic-metadata">

**Author:** [@Sean\_McGilvray](https://www.ruby-forum.com/u/Sean_McGilvray)\
**Replies:** 0\
**Last updated:** [February 19, 2009, 6:48pm UTC](https://www.ruby-forum.com/t/using-gems-on-a-shared-hosting/160793 "2009-02-19T18:48:49Z")

</div>

My hosting requires that I put the following in my app to use the gems that I want to use. $:.push("/home/username/ruby/gems") How do I use this. The gem that I want to utilize is adzap-ar\_mailer It is located in /h…

---

## [Script/console : modify an attribute](https://www.ruby-forum.com/t/script-console-modify-an-attribute/160788)

<div class="topic-metadata">

**Author:** [@loader](https://www.ruby-forum.com/u/loader)\
**Replies:** 1\
**Last updated:** [February 19, 2009, 6:48pm UTC](https://www.ruby-forum.com/t/script-console-modify-an-attribute/160788 "2009-02-19T18:48:13Z")

</div>

Hello everyone! :slight\_smile: I would like to know how to modify a variable in the console? I did this : e = Entry.find(:first) e.dev.community.name = “Ruby Geeks” e.save But when I look into my database, the vari…

---

## [Can't seem to instantiate Builder::XmlMarkup.new?](https://www.ruby-forum.com/t/cant-seem-to-instantiate-builder-xmlmarkup-new/160792)

<div class="topic-metadata">

**Author:** [@InventoryTrackers](https://www.ruby-forum.com/u/InventoryTrackers)\
**Replies:** 0\
**Last updated:** [February 19, 2009, 6:48pm UTC](https://www.ruby-forum.com/t/cant-seem-to-instantiate-builder-xmlmarkup-new/160792 "2009-02-19T18:48:12Z")

</div>

I am unable to instantiate the Builder::XmlMarkup.new on one development machine ( Windows ) and upon my CentOS server. When I run the same code on my Ubuntu 8.10 VMWare machine, everything runs great? In the Builder …

---

## [Rake db:migrate should run for all environements](https://www.ruby-forum.com/t/rake-db-migrate-should-run-for-all-environements/159275)

<div class="topic-metadata">

**Author:** [@fipa](https://www.ruby-forum.com/u/fipa)\
**Replies:** 5\
**Last updated:** [February 19, 2009, 6:47pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-should-run-for-all-environements/159275 "2009-02-19T18:47:14Z")

</div>

Or at least development and test. How many times did I find myself banging my head on the table with buggy tests until I figured out that I had forgotten to migrate the test database. Why rake db:migrate doesn’t by de…

---

## [Identifying Rails versions related to deprecation warnings](https://www.ruby-forum.com/t/identifying-rails-versions-related-to-deprecation-warnings/89405)

<div class="topic-metadata">

**Author:** [@weyus](https://www.ruby-forum.com/u/weyus)\
**Replies:** 5\
**Last updated:** [February 19, 2009, 6:15pm UTC](https://www.ruby-forum.com/t/identifying-rails-versions-related-to-deprecation-warnings/89405 "2009-02-19T18:15:07Z")

</div>

All, I’m starting to work no migrating an app. from 1.1.6 to 1.2.3 and the deprecation warnings are very helpful and detailed enough, I think. However, it would be really nice to know the earliest version for which a…

---

## [Associated child records not created on creation of a parent](https://www.ruby-forum.com/t/associated-child-records-not-created-on-creation-of-a-parent/160715)

<div class="topic-metadata">

**Author:** [@Master\_Chief](https://www.ruby-forum.com/u/Master_Chief)\
**Replies:** 3\
**Last updated:** [February 19, 2009, 6:07pm UTC](https://www.ruby-forum.com/t/associated-child-records-not-created-on-creation-of-a-parent/160715 "2009-02-19T18:07:36Z")

</div>

I am trying to create a record with association. Within the create method, I would also like to pre-populate dependent (has\_many) records from a template in the database. The child records are mysteriously rolled bac…

---

## [Is RJS highly used by Rails developers? (learning RJS versus just going to jQuery or Protype)](https://www.ruby-forum.com/t/is-rjs-highly-used-by-rails-developers-learning-rjs-versus-just-going-to-jquery-or-protype/160756)

<div class="topic-metadata">

**Author:** [@greg](https://www.ruby-forum.com/u/greg)\
**Replies:** 6\
**Last updated:** [February 19, 2009, 5:48pm UTC](https://www.ruby-forum.com/t/is-rjs-highly-used-by-rails-developers-learning-rjs-versus-just-going-to-jquery-or-protype/160756 "2009-02-19T17:48:47Z")

</div>

Hi, Question - If I’m starting to use Rails javascript/ajax helpers but want to start doing some more custom/complex Ajax/Javascript should I learn RJS as part of moving forward? (or alternatively just look to eithe…

---

## [Text\_area\_tag not escaping content by default](https://www.ruby-forum.com/t/text-area-tag-not-escaping-content-by-default/160392)

<div class="topic-metadata">

**Author:** [@mla](https://www.ruby-forum.com/u/mla)\
**Replies:** 2\
**Last updated:** [February 19, 2009, 5:38pm UTC](https://www.ruby-forum.com/t/text-area-tag-not-escaping-content-by-default/160392 "2009-02-19T17:38:48Z")

</div>

I stumbled on the fact that text\_area\_tag does not HTML escape its content by default. For example: text\_area\_tag “body”, “” At the very least, are we amendable to adding a note in the FormTagHelper docs about the es…

---

## [How to output unescaped string to console?](https://www.ruby-forum.com/t/how-to-output-unescaped-string-to-console/160785)

<div class="topic-metadata">

**Author:** [@bobm](https://www.ruby-forum.com/u/bobm)\
**Replies:** 1\
**Last updated:** [February 19, 2009, 5:24pm UTC](https://www.ruby-forum.com/t/how-to-output-unescaped-string-to-console/160785 "2009-02-19T17:24:20Z")

</div>

Hi, whenever I display a string to the console (for debugging purpose) I get a bunch of \\\\ ‘’ “”"" It’s not human readable and really annoying when strings are very long Sometime it prevents me to debug anything as I…

---

## [\[ADV\] Rails Studio in Reston, VA](https://www.ruby-forum.com/t/adv-rails-studio-in-reston-va/160783)

<div class="topic-metadata">

**Author:** [@clarkware](https://www.ruby-forum.com/u/clarkware)\
**Replies:** 0\
**Last updated:** [February 19, 2009, 5:06pm UTC](https://www.ruby-forum.com/t/adv-rails-studio-in-reston-va/160783 "2009-02-19T17:06:56Z")

</div>

Hi folks, The Pragmatic Studio is happy to announce the next Rails Studio will be in Reston, VA on April 15-17. If you’re just getting into Rails, or need to get your team members up to speed quickly, this course is …

---

## [Prototype and application/json](https://www.ruby-forum.com/t/prototype-and-application-json/160780)

<div class="topic-metadata">

**Author:** [@monkeyten](https://www.ruby-forum.com/u/monkeyten)\
**Replies:** 0\
**Last updated:** [February 19, 2009, 5:03pm UTC](https://www.ruby-forum.com/t/prototype-and-application-json/160780 "2009-02-19T17:03:20Z")

</div>

I have a feeling I am doing something wrong here (the great thing with Rails is that when it gets difficult you can generally assume that to be the case!), so any comments are appreciated. I have a link on a page that…

---

## [Clean the database](https://www.ruby-forum.com/t/clean-the-database/160778)

<div class="topic-metadata">

**Author:** [@jobber](https://www.ruby-forum.com/u/jobber)\
**Replies:** 0\
**Last updated:** [February 19, 2009, 5:01pm UTC](https://www.ruby-forum.com/t/clean-the-database/160778 "2009-02-19T17:01:00Z")

</div>

hello all, im write unit test (i try it :slight\_smile: ). now i like to clean the database before every cycle i do. how can i real it?

---

## [How can I access currently selected records in the view?](https://www.ruby-forum.com/t/how-can-i-access-currently-selected-records-in-the-view/160767)

<div class="topic-metadata">

**Author:** [@sa125](https://www.ruby-forum.com/u/sa125)\
**Replies:** 4\
**Last updated:** [February 19, 2009, 4:58pm UTC](https://www.ruby-forum.com/t/how-can-i-access-currently-selected-records-in-the-view/160767 "2009-02-19T16:58:19Z")

</div>

One of my views enables searching records using a text field. The rendered view contains only records that match the search. After the view has rendered, I want to add an option to perform an update on the displayed r…

---

## [Test db missing constraints](https://www.ruby-forum.com/t/test-db-missing-constraints/160688)

<div class="topic-metadata">

**Author:** [@destiney](https://www.ruby-forum.com/u/destiney)\
**Replies:** 4\
**Last updated:** [February 19, 2009, 4:43pm UTC](https://www.ruby-forum.com/t/test-db-missing-constraints/160688 "2009-02-19T16:43:46Z")

</div>

What is everyone doing with regards to database constraints not being created in schema.rb ? I’m using Oracle and I just noticed none of the constraints I am creating in my migrations appear in my test schema. This …

---

## [Conditions on association include, hacky but more or less solved](https://www.ruby-forum.com/t/conditions-on-association-include-hacky-but-more-or-less-solved/160354)

<div class="topic-metadata">

**Author:** [@chris](https://www.ruby-forum.com/u/chris)\
**Replies:** 3\
**Last updated:** [February 19, 2009, 3:48pm UTC](https://www.ruby-forum.com/t/conditions-on-association-include-hacky-but-more-or-less-solved/160354 "2009-02-19T15:48:48Z")

</div>

Hi all, I just finally figured out how to get 2.2.2 to do this, and thought I’d share in case others run into the same thing. The situation is a find with associations, but the tricky part is that the association sho…

---

## [Percentages in log are wrong](https://www.ruby-forum.com/t/percentages-in-log-are-wrong/160770)

<div class="topic-metadata">

**Author:** [@LemmingJoel](https://www.ruby-forum.com/u/LemmingJoel)\
**Replies:** 0\
**Last updated:** [February 19, 2009, 3:02pm UTC](https://www.ruby-forum.com/t/percentages-in-log-are-wrong/160770 "2009-02-19T15:02:08Z")

</div>

Has this happened anyone else? Here is a log entry: Completed in 0.00918 (108 reqs/sec) | Rendering: 0.00565 (61%) | DB: 0.09696 (1056%) | 200 OK \[… The numbers don’t quite add up do they? All my log entries are like …

---

## [How i add the sum in too this field](https://www.ruby-forum.com/t/how-i-add-the-sum-in-too-this-field/160766)

<div class="topic-metadata">

**Author:** [@poloman](https://www.ruby-forum.com/u/poloman)\
**Replies:** 3\
**Last updated:** [February 19, 2009, 2:37pm UTC](https://www.ruby-forum.com/t/how-i-add-the-sum-in-too-this-field/160766 "2009-02-19T14:37:09Z")

</div>

Day work Start End Work time/Day \<% for shift in @shifts %\> \<%= shift.date.strftime '%a' %\>Â \<%= shift.date.strftime '%d/%m/%Y' %\> \<%= time\_ampm shift.start %\> \<%= time\_ampm shift.end %\> \<%= (…

---

## [Using #{} with instance variables inside prototypes $$()](https://www.ruby-forum.com/t/using-with-instance-variables-inside-prototypes/160764)

<div class="topic-metadata">

**Author:** [@scudco](https://www.ruby-forum.com/u/scudco)\
**Replies:** 2\
**Last updated:** [February 19, 2009, 2:24pm UTC](https://www.ruby-forum.com/t/using-with-instance-variables-inside-prototypes/160764 "2009-02-19T14:24:24Z")

</div>

I want to do something like this in a link\_to\_remote call in a view :before =\> ‘$$(“tr#task\_#{completed\_task.id} \> td.task-title-cell”).update(“Reactivating”)’ but the number of ’ and " in the string are not allowing …

---

## [Submit input to params](https://www.ruby-forum.com/t/submit-input-to-params/160643)

<div class="topic-metadata">

**Author:** [@sa125](https://www.ruby-forum.com/u/sa125)\
**Replies:** 1\
**Last updated:** [February 19, 2009, 2:23pm UTC](https://www.ruby-forum.com/t/submit-input-to-params/160643 "2009-02-19T14:23:44Z")

</div>

I have a form for a model, that has an auto-fill button based on existing record. Basically you can choose if to duplicate an existing record using a select list of the record already in the db. This select list is in…

---

## [Friendly\_id / acts\_as\_referenced conflict?](https://www.ruby-forum.com/t/friendly-id-acts-as-referenced-conflict/160760)

<div class="topic-metadata">

**Author:** [@noddy](https://www.ruby-forum.com/u/noddy)\
**Replies:** 0\
**Last updated:** [February 19, 2009, 12:58pm UTC](https://www.ruby-forum.com/t/friendly-id-acts-as-referenced-conflict/160760 "2009-02-19T12:58:53Z")

</div>

Hi, I’m using acts\_as\_referenced to generate unique references: property.rb class Property \< ActiveRecord::Base acts\_as\_referenced :referenced\_column =\> “permalink” end I would now like to use friendly\_id to create …

---

## [What you see is what you get](https://www.ruby-forum.com/t/what-you-see-is-what-you-get/160740)

<div class="topic-metadata">

**Author:** [@madhavi.k](https://www.ruby-forum.com/u/madhavi.k)\
**Replies:** 3\
**Last updated:** [February 19, 2009, 12:39pm UTC](https://www.ruby-forum.com/t/what-you-see-is-what-you-get/160740 "2009-02-19T12:39:28Z")

</div>

how to implement WYSIWYG editor for user to enter the content using rails

---

## [Freeze the grid view header](https://www.ruby-forum.com/t/freeze-the-grid-view-header/160632)

<div class="topic-metadata">

**Author:** [@wfspoet](https://www.ruby-forum.com/u/wfspoet)\
**Replies:** 6\
**Last updated:** [February 19, 2009, 12:33pm UTC](https://www.ruby-forum.com/t/freeze-the-grid-view-header/160632 "2009-02-19T12:33:35Z")

</div>

i wanna freeze the grid view header fixed just like in excel as we scroll the rows scrolls away leaving the column heading fixed I wanna perform this action using css

---

## [AutosaveAssociation - Saving nested models without validation](https://www.ruby-forum.com/t/autosaveassociation-saving-nested-models-without-validation/160537)

<div class="topic-metadata">

**Author:** [@evensoul](https://www.ruby-forum.com/u/evensoul)\
**Replies:** 1\
**Last updated:** [February 19, 2009, 11:49am UTC](https://www.ruby-forum.com/t/autosaveassociation-saving-nested-models-without-validation/160537 "2009-02-19T11:49:21Z")

</div>

Hi, I’m using Rails 2.3 RC1. I’ve noticed that calling save(false) on the model which accepts\_nested\_attributes\_for :another doesn’t create the nested model if it’s invalid. It does save it if it’s been previously c…

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

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