# Rails

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

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

---

## [Formatting a Text or CharVar(255) data type with Carriage Return or \[enter\]](https://www.ruby-forum.com/t/formatting-a-text-or-charvar-255-data-type-with-carriage-return-or-enter/129385)

<div class="topic-metadata">

**Author:** [@Ronartos](https://www.ruby-forum.com/u/Ronartos)\
**Replies:** 4\
**Last updated:** [February 18, 2008, 1:52pm UTC](https://www.ruby-forum.com/t/formatting-a-text-or-charvar-255-data-type-with-carriage-return-or-enter/129385 "2008-02-18T13:52:53Z")

</div>

Is there a way to format a Text or CharVar data field to include the carriage return or \[ENTER\] ?? Example i saved a data as follows: This is Line 1 Line 2 Line 3 Can I be able to display them again like that? coz …

---

## [Issue with FckEditor](https://www.ruby-forum.com/t/issue-with-fckeditor/129402)

<div class="topic-metadata">

**Author:** [@dhaval\_parikh33](https://www.ruby-forum.com/u/dhaval_parikh33)\
**Replies:** 4\
**Last updated:** [February 18, 2008, 1:28pm UTC](https://www.ruby-forum.com/t/issue-with-fckeditor/129402 "2008-02-18T13:28:53Z")

</div>

Hi all I have integrated fck editor with my application and we all know that fck stores data in db in form of html i.e name so in the output page also we will get the html as text…So the problem is that it should …

---

## [Replace rhtml view with rjs](https://www.ruby-forum.com/t/replace-rhtml-view-with-rjs/119432)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 2\
**Last updated:** [February 18, 2008, 1:21pm UTC](https://www.ruby-forum.com/t/replace-rhtml-view-with-rjs/119432 "2008-02-18T13:21:56Z")

</div>

Hi, I am following the examples in the Agile Web D. with Rails book and am supposed to be replacing an rhtml view with an rjs. So I deleted the rhtml file and replaced it with an rjs file with the same name. However,…

---

## [TypeError in highlight (ActionView::Helpers::TextHelper)](https://www.ruby-forum.com/t/typeerror-in-highlight-actionview-texthelper/129327)

<div class="topic-metadata">

**Author:** [@pahagon](https://www.ruby-forum.com/u/pahagon)\
**Replies:** 1\
**Last updated:** [February 18, 2008, 12:50pm UTC](https://www.ruby-forum.com/t/typeerror-in-highlight-actionview-texthelper/129327 "2008-02-18T12:50:02Z")

</div>

I was trying to highlight more than 1 term in a text with highlight method from TextHelper. Much to my surprise, I just copied the example from Rdoc (http://api.rubyonrails.org/classes/ActionView/Helpers/ TextHelper.h…

---

## [To\_xml and from\_xml round robin ... exists?](https://www.ruby-forum.com/t/to-xml-and-from-xml-round-robin-exists/129275)

<div class="topic-metadata">

**Author:** [@ericgoodwin](https://www.ruby-forum.com/u/ericgoodwin)\
**Replies:** 1\
**Last updated:** [February 18, 2008, 12:47pm UTC](https://www.ruby-forum.com/t/to-xml-and-from-xml-round-robin-exists/129275 "2008-02-18T12:47:03Z")

</div>

Im creating an api for my website and Im trying to roll my own. I know I can use activeresource and some other packages, but really what I would like is to be able to send simple xml data back and forth. Im sticking w…

---

## [Select\_tag in form\_for?](https://www.ruby-forum.com/t/select-tag-in-form-for/129408)

<div class="topic-metadata">

**Author:** [@peter](https://www.ruby-forum.com/u/peter)\
**Replies:** 1\
**Last updated:** [February 18, 2008, 11:41am UTC](https://www.ruby-forum.com/t/select-tag-in-form-for/129408 "2008-02-18T11:41:40Z")

</div>

How can i use a select\_tag correctly inside a form\_for block? when i do a f.select\_tag i get the error that select\_tag is not available for the formbuilder-object. is it possible to create a select tag inside this con…

---

## [Help with error "undefined method \`downcase' for nil:NilClass" after migration](https://www.ruby-forum.com/t/help-with-error-undefined-method-downcase-for-nil-nilclass-after-migration/124018)

<div class="topic-metadata">

**Author:** [@elemental](https://www.ruby-forum.com/u/elemental)\
**Replies:** 7\
**Last updated:** [February 18, 2008, 11:39am UTC](https://www.ruby-forum.com/t/help-with-error-undefined-method-downcase-for-nil-nilclass-after-migration/124018 "2008-02-18T11:39:48Z")

</div>

Hi all, I have a rails 1.5.2 application. I’ve frozen the application via the “rake rails:freeze:gems” command. This application worked well on a server I previously had it installed on. My server was getting real…

---

## [HAML: %li{:class =\> 'current' if page == 2} does not work?](https://www.ruby-forum.com/t/haml-li-class-current-if-page-2-does-not-work/129369)

<div class="topic-metadata">

**Author:** [@josh](https://www.ruby-forum.com/u/josh)\
**Replies:** 4\
**Last updated:** [February 18, 2008, 11:26am UTC](https://www.ruby-forum.com/t/haml-li-class-current-if-page-2-does-not-work/129369 "2008-02-18T11:26:28Z")

</div>

Hi all I’m iterating over navigation page links using HAML. I want to assign the current page’s link the CSS class .current trying to use: %li{:class =\> ‘current’ if params\[:page\] == i} Sadly this doesn’t work. How c…

---

## [Image can not be displayed from database](https://www.ruby-forum.com/t/image-can-not-be-displayed-from-database/129406)

<div class="topic-metadata">

**Author:** [@malioboro](https://www.ruby-forum.com/u/malioboro)\
**Replies:** 0\
**Last updated:** [February 18, 2008, 10:26am UTC](https://www.ruby-forum.com/t/image-can-not-be-displayed-from-database/129406 "2008-02-18T10:26:24Z")

</div>

Hello, I have problem in displaying image from database, please help me how to display my image. DATABASE DETAIL (I not create file name field to save original file name to database) employee\_name, type data → varch…

---

## [Slogging my way thru oracle, not adapter? gem install fails?](https://www.ruby-forum.com/t/slogging-my-way-thru-oracle-not-adapter-gem-install-fails/128249)

<div class="topic-metadata">

**Author:** [@uncle](https://www.ruby-forum.com/u/uncle)\
**Replies:** 3\
**Last updated:** [February 18, 2008, 10:26am UTC](https://www.ruby-forum.com/t/slogging-my-way-thru-oracle-not-adapter-gem-install-fails/128249 "2008-02-18T10:26:22Z")

</div>

\<ubuntu\_gutsy\> me@ubuntu:~/workspace/oracle/ro$ gem install activerecord-oci-adapter Bulk updating Gem source index for: http://gems.rubyforge.org ERROR: While executing gem … (Gem::GemNotFoundException) Could not f…

---

## [Strange thing with find\_by\_sql in oracle](https://www.ruby-forum.com/t/strange-thing-with-find-by-sql-in-oracle/129199)

<div class="topic-metadata">

**Author:** [@hei](https://www.ruby-forum.com/u/hei)\
**Replies:** 4\
**Last updated:** [February 18, 2008, 10:09am UTC](https://www.ruby-forum.com/t/strange-thing-with-find-by-sql-in-oracle/129199 "2008-02-18T10:09:13Z")

</div>

I did two sql queries in the same environment and at the same time: First: Message.find\_by\_sql(\[“select \* from messages where id = ?”, 1\]) Returns: gumentError: wrong number of arguments (0 for 1) from c:/ruby/lib/r…

---

## [Good RoR design example](https://www.ruby-forum.com/t/good-ror-design-example/129027)

<div class="topic-metadata">

**Author:** [@kupsztal](https://www.ruby-forum.com/u/kupsztal)\
**Replies:** 7\
**Last updated:** [February 18, 2008, 9:38am UTC](https://www.ruby-forum.com/t/good-ror-design-example/129027 "2008-02-18T09:38:38Z")

</div>

Hi all, I was wondering if anyone could point me to a good (ideally simple) example of RoR design. I am rather new to this subject, and I am playing with https://rubyforge.org/projects/mystic/ as an simple example to …

---

## [Best way to print PDF file](https://www.ruby-forum.com/t/best-way-to-print-pdf-file/129401)

<div class="topic-metadata">

**Author:** [@crazybass](https://www.ruby-forum.com/u/crazybass)\
**Replies:** 0\
**Last updated:** [February 18, 2008, 9:33am UTC](https://www.ruby-forum.com/t/best-way-to-print-pdf-file/129401 "2008-02-18T09:33:20Z")

</div>

Hello I have a Rails Application which shows a list of file names. These files are PDF documents. For each one I have a checkbox. In the web page I also have a print button. Has you could imagine, the goal is to print …

---

## [Rails MIME type/template engine wrong selection for RSS?](https://www.ruby-forum.com/t/rails-mime-type-template-engine-wrong-selection-for-rss/129398)

<div class="topic-metadata">

**Author:** [@Kip](https://www.ruby-forum.com/u/Kip)\
**Replies:** 0\
**Last updated:** [February 18, 2008, 9:28am UTC](https://www.ruby-forum.com/t/rails-mime-type-template-engine-wrong-selection-for-rss/129398 "2008-02-18T09:28:35Z")

</div>

In my RESTful app, I have 4 templates for different mime types/formats (example, below). How do I tell Rails (2.0.2) to use the Builder template engine as default for rss, or at least look for it at render time for t…

---

## [What's your rails wishlist?](https://www.ruby-forum.com/t/whats-your-rails-wishlist/59113)

<div class="topic-metadata">

**Author:** [@beachguy82](https://www.ruby-forum.com/u/beachguy82)\
**Replies:** 35\
**Last updated:** [February 18, 2008, 7:50am UTC](https://www.ruby-forum.com/t/whats-your-rails-wishlist/59113 "2008-02-18T07:50:01Z")

</div>

I’ve been working with rails for a while now. Rails is the second web framework I’ve tried. It blows the doors off catalyst (perl’s best framework). I even just wrote my first plugin (broomstick). Ruby’s ability t…

---

## [Has\_attachment and validation](https://www.ruby-forum.com/t/has-attachment-and-validation/92766)

<div class="topic-metadata">

**Author:** [@Bolo](https://www.ruby-forum.com/u/Bolo)\
**Replies:** 6\
**Last updated:** [February 18, 2008, 6:24am UTC](https://www.ruby-forum.com/t/has-attachment-and-validation/92766 "2008-02-18T06:24:38Z")

</div>

Hello I would like call the validation when the user submit a file only. i tested this validates\_as\_attachment unless self.uploaded\_data.blank? NoMethodError in EnseignantsController#create undefined method \`upload…

---

## [Different text\_fields for different selected item](https://www.ruby-forum.com/t/different-text-fields-for-different-selected-item/129198)

<div class="topic-metadata">

**Author:** [@daociyiyou](https://www.ruby-forum.com/u/daociyiyou)\
**Replies:** 3\
**Last updated:** [February 18, 2008, 5:08am UTC](https://www.ruby-forum.com/t/different-text-fields-for-different-selected-item/129198 "2008-02-18T05:08:57Z")

</div>

Hell: When i use select tag in a form,how to show different text\_fields below select tag for different selected item without having to click a submit tag.I must know how to write javascript to accomplish it or there …

---

## [Mongrel 1.1.3 errors?](https://www.ruby-forum.com/t/mongrel-1-1-3-errors/129392)

<div class="topic-metadata">

**Author:** [@coldtone](https://www.ruby-forum.com/u/coldtone)\
**Replies:** 0\
**Last updated:** [February 18, 2008, 5:05am UTC](https://www.ruby-forum.com/t/mongrel-1-1-3-errors/129392 "2008-02-18T05:05:19Z")

</div>

All my production Rails/Engines apps died last week. Suddenly, and without code change on my part. I think I’ve narrowed the problem down to my hosting provider upgrading from Mongrel 1.1.1 to 1.1.3. Upgrading my d…

---

## [One test affects another](https://www.ruby-forum.com/t/one-test-affects-another/129386)

<div class="topic-metadata">

**Author:** [@dean](https://www.ruby-forum.com/u/dean)\
**Replies:** 0\
**Last updated:** [February 18, 2008, 3:42am UTC](https://www.ruby-forum.com/t/one-test-affects-another/129386 "2008-02-18T03:42:36Z")

</div>

I have the following class: class Brewer \< ActiveRecord::Base class EmailNotFound \< StandardError; end class \<\< self def find\_by\_email(\*args) b = super(\*args) raise EmailNotFound if b.nil? return b end end end …

---

## [Is assert\_select indicated for XML?](https://www.ruby-forum.com/t/is-assert-select-indicated-for-xml/129383)

<div class="topic-metadata">

**Author:** [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Replies:** 0\
**Last updated:** [February 18, 2008, 2:12am UTC](https://www.ruby-forum.com/t/is-assert-select-indicated-for-xml/129383 "2008-02-18T02:12:18Z")

</div>

Railsers: I’m playing with the Beast, and this test fails: def test\_should\_show\_topic\_as\_rss get :show, :forum\_id =\> forums(:rails).id, :id =\> topics(:pdi).id, :format =\> ‘rss’ assert\_response :success assert\_selec…

---

## [Calling an external API as quickly as possible](https://www.ruby-forum.com/t/calling-an-external-api-as-quickly-as-possible/129368)

<div class="topic-metadata">

**Author:** [@Swordfish](https://www.ruby-forum.com/u/Swordfish)\
**Replies:** 7\
**Last updated:** [February 18, 2008, 1:48am UTC](https://www.ruby-forum.com/t/calling-an-external-api-as-quickly-as-possible/129368 "2008-02-18T01:48:52Z")

</div>

Hi I’m a Java developer working with a team that’s moving over to Ruby and Ruby on Rails - we’re really excited! We are writing a replacement for a large, java-based, e-commerce website for a client who is based in t…

---

## [Polymorphic One-to-One](https://www.ruby-forum.com/t/polymorphic-one-to-one/129344)

<div class="topic-metadata">

**Author:** [@jarrod](https://www.ruby-forum.com/u/jarrod)\
**Replies:** 2\
**Last updated:** [February 18, 2008, 1:40am UTC](https://www.ruby-forum.com/t/polymorphic-one-to-one/129344 "2008-02-18T01:40:40Z")

</div>

I’m having some trouble with a polymorphic relationship. Let’s say I have a class, Vehicle. Vehicle has some attributes of its own, but it largely delegates the specifics to a polymorphic association. class Vehicle \< …

---

## [Comments in RHTML files](https://www.ruby-forum.com/t/comments-in-rhtml-files/129333)

<div class="topic-metadata">

**Author:** [@martin](https://www.ruby-forum.com/u/martin)\
**Replies:** 1\
**Last updated:** [February 18, 2008, 1:20am UTC](https://www.ruby-forum.com/t/comments-in-rhtml-files/129333 "2008-02-18T01:20:44Z")

</div>

Hello all, I have a Partial and at the beginning of it I have Ruby code (\<% … %\>) in which a have a couple of comments. When the comments (which starts with #) are in the Partial, my partial is not displayed, when I …

---

## [NoMethodError... but its not a method!](https://www.ruby-forum.com/t/nomethoderror-but-its-not-a-method/129332)

<div class="topic-metadata">

**Author:** [@sithadmin](https://www.ruby-forum.com/u/sithadmin)\
**Replies:** 2\
**Last updated:** [February 18, 2008, 1:14am UTC](https://www.ruby-forum.com/t/nomethoderror-but-its-not-a-method/129332 "2008-02-18T01:14:53Z")

</div>

Hi everyone, I am putting together an application in which each part of it was tested individually. Now that it is put together, I’m having problems… The one giving me problems is my “ImportController” which parses a …

---

## [File generated with upload\_column plugin](https://www.ruby-forum.com/t/file-generated-with-upload-column-plugin/124332)

<div class="topic-metadata">

**Author:** [@stratboy](https://www.ruby-forum.com/u/stratboy)\
**Replies:** 1\
**Last updated:** [February 18, 2008, 1:14am UTC](https://www.ruby-forum.com/t/file-generated-with-upload-column-plugin/124332 "2008-02-18T01:14:17Z")

</div>

I using the upload\_column plugin. In the model i insert this: image\_column :image,:versions =\> { :thumb =\> ‘c30x30’,:medium=\>‘c62x62’, :large =\> ‘600x600’ } when i upload an image this genera 4 images: 3 images spec…

---

## [Strategy design pattern vs partial](https://www.ruby-forum.com/t/strategy-design-pattern-vs-partial/129290)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 4\
**Last updated:** [February 18, 2008, 1:01am UTC](https://www.ruby-forum.com/t/strategy-design-pattern-vs-partial/129290 "2008-02-18T01:01:58Z")

</div>

I have a Rails application (something like an online catalog) that needs to behave differently for different types of clients. For example, boat dealers and car dealers. When the application displays a list of cars…

---

## [Nil error?](https://www.ruby-forum.com/t/nil-error/129324)

<div class="topic-metadata">

**Author:** [@vanik](https://www.ruby-forum.com/u/vanik)\
**Replies:** 2\
**Last updated:** [February 18, 2008, 12:57am UTC](https://www.ruby-forum.com/t/nil-error/129324 "2008-02-18T00:57:51Z")

</div>

Hi everyone, I’m sure I’m doing something stupid with this, so if somebody could talk some sense into me that would be great :slight\_smile: I’m trying to just increment a variable and I think I’m missing some basic c…

---

## [Controller initializer function?](https://www.ruby-forum.com/t/controller-initializer-function/129299)

<div class="topic-metadata">

**Author:** [@evan](https://www.ruby-forum.com/u/evan)\
**Replies:** 4\
**Last updated:** [February 18, 2008, 12:13am UTC](https://www.ruby-forum.com/t/controller-initializer-function/129299 "2008-02-18T00:13:50Z")

</div>

Hi, i’m a php developer and am used to developing using the zend framework, recently i have discovered the wonders of rails, and have a simple question: In zend in your controller you can make a function called init()…

---

## [Map routes from an array?](https://www.ruby-forum.com/t/map-routes-from-an-array/129082)

<div class="topic-metadata">

**Author:** [@peter](https://www.ruby-forum.com/u/peter)\
**Replies:** 3\
**Last updated:** [February 18, 2008, 12:12am UTC](https://www.ruby-forum.com/t/map-routes-from-an-array/129082 "2008-02-18T00:12:04Z")

</div>

I have a menu\_items array (array of hashes, with printed name and url for each item) in a helper, which i use to create my mainmenu. I’d like to use them in routes.rb so i can loop through them and map routes accordin…

---

## [Redirecting The Root Of The Website](https://www.ruby-forum.com/t/redirecting-the-root-of-the-website/129328)

<div class="topic-metadata">

**Author:** [@digitalpardoe](https://www.ruby-forum.com/u/digitalpardoe)\
**Replies:** 11\
**Last updated:** [February 17, 2008, 11:36pm UTC](https://www.ruby-forum.com/t/redirecting-the-root-of-the-website/129328 "2008-02-17T23:36:08Z")

</div>

Hi, I’ve looked for several ways of doing this but none of the methods I have found work correctly. Basically, the website I am writing is navigated to using the standard domain name, i.e. http://website.com/. Using …

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

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