# Rails

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

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

---

## [Good code?](https://www.ruby-forum.com/t/good-code/103110)

<div class="topic-metadata">

**Author:** [@leonb](https://www.ruby-forum.com/u/leonb)\
**Replies:** 1\
**Last updated:** [May 6, 2007, 4:45pm UTC](https://www.ruby-forum.com/t/good-code/103110 "2007-05-06T16:45:45Z")

</div>

Hi, Is this ok as helper code? http://pastie.caboo.se/58054 I especially was wondering if it is ok to use the “current\_user” method in a helper method?

---

## [Action/Fragment Cache for a Ruby and Rails Newbie](https://www.ruby-forum.com/t/action-fragment-cache-for-a-ruby-and-rails-newbie/103327)

<div class="topic-metadata">

**Author:** [@eric.c](https://www.ruby-forum.com/u/eric.c)\
**Replies:** 1\
**Last updated:** [May 6, 2007, 4:33pm UTC](https://www.ruby-forum.com/t/action-fragment-cache-for-a-ruby-and-rails-newbie/103327 "2007-05-06T16:33:44Z")

</div>

Folks, I am working on a small rails project which has a few actions but with intensive db and rendering. I looked at caching models and because of scalability and authentication needs I will have to use action cache…

---

## [Model Releationship, belong, has?](https://www.ruby-forum.com/t/model-releationship-belong-has/103438)

<div class="topic-metadata">

**Author:** [@jamal](https://www.ruby-forum.com/u/jamal)\
**Replies:** 2\
**Last updated:** [May 6, 2007, 3:54pm UTC](https://www.ruby-forum.com/t/model-releationship-belong-has/103438 "2007-05-06T15:54:16Z")

</div>

Hello, I have two models. blog\_post belongs\_to :blog\_category blog\_category has\_many :blog\_post Whenever I do this, I get error (uninitialized constant BlogPost::BlogCategories) \<%= post.blog\_categories.name %\> P…

---

## [Using models as join tables query question](https://www.ruby-forum.com/t/using-models-as-join-tables-query-question/103428)

<div class="topic-metadata">

**Author:** [@Tomislav\_FilipSSSSi](https://www.ruby-forum.com/u/Tomislav_FilipSSSSi)\
**Replies:** 2\
**Last updated:** [May 6, 2007, 3:10pm UTC](https://www.ruby-forum.com/t/using-models-as-join-tables-query-question/103428 "2007-05-06T15:10:37Z")

</div>

I can’t seem to think straight this evening. I have the following models class Candidate \< ActiveRecord::Base has\_many :castings has\_many :projects, :through =\> :castings end class Project \< ActiveRecord::Base has…

---

## [Hash and condition](https://www.ruby-forum.com/t/hash-and-condition/103465)

<div class="topic-metadata">

**Author:** [@Bolo](https://www.ruby-forum.com/u/Bolo)\
**Replies:** 1\
**Last updated:** [May 6, 2007, 2:53pm UTC](https://www.ruby-forum.com/t/hash-and-condition/103465 "2007-05-06T14:53:36Z")

</div>

Hello I would like to use hash in my condition User.find(:all, :conditions=\>{:first\_name =\> ‘akhil’, :role =\> ‘admin’}) it’s working User.find(:all, :include =\> :profile, :conditions=\>{:band =\> ‘bolo’, :first\_nam…

---

## [Domain Backordering system](https://www.ruby-forum.com/t/domain-backordering-system/103462)

<div class="topic-metadata">

**Author:** [@mattonline](https://www.ruby-forum.com/u/mattonline)\
**Replies:** 1\
**Last updated:** [May 6, 2007, 2:09pm UTC](https://www.ruby-forum.com/t/domain-backordering-system/103462 "2007-05-06T14:09:22Z")

</div>

OK, new to ruby, and i know this can be done, i’m looking for tips on how to create a backordering system for domains to the DAC (Domain availability checker) of nominet. I understand i would need to create a databas…

---

## [Render :action "call method first?"](https://www.ruby-forum.com/t/render-action-call-method-first/103459)

<div class="topic-metadata">

**Author:** [@jamal](https://www.ruby-forum.com/u/jamal)\
**Replies:** 2\
**Last updated:** [May 6, 2007, 1:39pm UTC](https://www.ruby-forum.com/t/render-action-call-method-first/103459 "2007-05-06T13:39:51Z")

</div>

Hi, I know when I call: render :controller =\> ‘some’, :action =\> ‘thing’ It doesn’t call the method ‘thing’ before render the template ‘thing.rhtml’, but I need some instance variable which are in the ‘thing’ method…

---

## [Has\_many :through question](https://www.ruby-forum.com/t/has-many-through-question/93228)

<div class="topic-metadata">

**Author:** [@shinkaku](https://www.ruby-forum.com/u/shinkaku)\
**Replies:** 2\
**Last updated:** [May 6, 2007, 1:33pm UTC](https://www.ruby-forum.com/t/has-many-through-question/93228 "2007-05-06T13:33:58Z")

</div>

I’m working on a simple messaging service where a user can send a message to another user. It’s not email, each user can see their messages when they login to the site. Now I’m trying to figure out how to set up a has…

---

## [Excellent money making program](https://www.ruby-forum.com/t/excellent-money-making-program/103458)

<div class="topic-metadata">

**Author:** [@SSchief](https://www.ruby-forum.com/u/SSchief)\
**Replies:** 0\
**Last updated:** [May 6, 2007, 12:31pm UTC](https://www.ruby-forum.com/t/excellent-money-making-program/103458 "2007-05-06T12:31:27Z")

</div>

Do you want to work for 40 years or more to make $40,000 a year or less just so you can retire on 40% of what wasn’t enough in the first place? Imagine owning a profitable home business that you could start TODAY wit…

---

## [Mapping](https://www.ruby-forum.com/t/mapping/103455)

<div class="topic-metadata">

**Author:** [@yousra](https://www.ruby-forum.com/u/yousra)\
**Replies:** 0\
**Last updated:** [May 6, 2007, 10:59am UTC](https://www.ruby-forum.com/t/mapping/103455 "2007-05-06T10:59:18Z")

</div>

Hi everyone, I wanna know how use the active record to transform the relation (1-1, 0,1)to a class using the radrails also I wana know how to modifiy the interface genering by the radrails like the edit and destroy a…

---

## [MySQL adapter bug? Date col being set to NULL when default i](https://www.ruby-forum.com/t/mysql-adapter-bug-date-col-being-set-to-null-when-default-i/103454)

<div class="topic-metadata">

**Author:** [@rovnak](https://www.ruby-forum.com/u/rovnak)\
**Replies:** 0\
**Last updated:** [May 6, 2007, 10:35am UTC](https://www.ruby-forum.com/t/mysql-adapter-bug-date-col-being-set-to-null-when-default-i/103454 "2007-05-06T10:35:17Z")

</div>

Ok, simple case. MySQL table with date column. The date column default is 0000-00-00. When I view these rows in say SQLyog, all rows in this table have value of 0000-00-00. by default. … Now, onto my Rails app. I d…

---

## [Sending email without using ActionMailer](https://www.ruby-forum.com/t/sending-email-without-using-actionmailer/103390)

<div class="topic-metadata">

**Author:** [@kiran](https://www.ruby-forum.com/u/kiran)\
**Replies:** 2\
**Last updated:** [May 6, 2007, 9:25am UTC](https://www.ruby-forum.com/t/sending-email-without-using-actionmailer/103390 "2007-05-06T09:25:08Z")

</div>

Hi, I am getting problem using action mailer. can some one advice what are the other options for sending email in ruby on rails Thanks Kiran

---

## [Something wierd with .save method](https://www.ruby-forum.com/t/something-wierd-with-save-method/103341)

<div class="topic-metadata">

**Author:** [@anupam](https://www.ruby-forum.com/u/anupam)\
**Replies:** 5\
**Last updated:** [May 6, 2007, 8:23am UTC](https://www.ruby-forum.com/t/something-wierd-with-save-method/103341 "2007-05-06T08:23:05Z")

</div>

Hi, I have a very sime app. I need to create as many records in the db as the selected checkboxes (named :isselected) in the view. Here is the code snippet from the controller: isselectedhash = params\[:isselected\] …

---

## [Porting 1.1.6 to 1.2.3](https://www.ruby-forum.com/t/porting-1-1-6-to-1-2-3/103422)

<div class="topic-metadata">

**Author:** [@rpm13](https://www.ruby-forum.com/u/rpm13)\
**Replies:** 4\
**Last updated:** [May 6, 2007, 7:07am UTC](https://www.ruby-forum.com/t/porting-1-1-6-to-1-2-3/103422 "2007-05-06T07:07:11Z")

</div>

In porting an application from rails 1.1.6 to 1.2.3, I discovered that the image directory has become the images directory. But also some other aspects of the map.image had to be changed. Is there one central place w…

---

## [Validate presence of 1 of 2 fields](https://www.ruby-forum.com/t/validate-presence-of-1-of-2-fields/103342)

<div class="topic-metadata">

**Author:** [@subimage](https://www.ruby-forum.com/u/subimage)\
**Replies:** 5\
**Last updated:** [May 6, 2007, 6:56am UTC](https://www.ruby-forum.com/t/validate-presence-of-1-of-2-fields/103342 "2007-05-06T06:56:02Z")

</div>

I have a model with a home and work phone number and I just want to validate that one of the two are present and correct. Would I have to write my own validation method? If so what is wrong with below?: def validate …

---

## [Using session-type data in an ActiveRecord callback](https://www.ruby-forum.com/t/using-session-type-data-in-an-activerecord-callback/103445)

<div class="topic-metadata">

**Author:** [@jseidel](https://www.ruby-forum.com/u/jseidel)\
**Replies:** 3\
**Last updated:** [May 6, 2007, 6:54am UTC](https://www.ruby-forum.com/t/using-session-type-data-in-an-activerecord-callback/103445 "2007-05-06T06:54:01Z")

</div>

Any suggestions on how best to gain access to session-type information while in an ActiveRecord callback, such as after\_save? I am encrypting some information in the database, using the generalized encryption/decrypti…

---

## [DB trigger vs before\_create](https://www.ruby-forum.com/t/db-trigger-vs-before-create/103436)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 3\
**Last updated:** [May 6, 2007, 6:47am UTC](https://www.ruby-forum.com/t/db-trigger-vs-before-create/103436 "2007-05-06T06:47:01Z")

</div>

Hello everyone, I’m having trouble figuring out which approach is better. I have the following tables: products, orders and line\_items. Every time an Order is placed, the quantity field in the products table has to b…

---

## [\[ANN\] ActiveRecord::Extensions 0.6.0 Released](https://www.ruby-forum.com/t/ann-activerecord-extensions-0-6-0-released/111054)

<div class="topic-metadata">

**Author:** [@zdennis](https://www.ruby-forum.com/u/zdennis)\
**Replies:** 0\
**Last updated:** [May 6, 2007, 6:42am UTC](https://www.ruby-forum.com/t/ann-activerecord-extensions-0-6-0-released/111054 "2007-05-06T06:42:01Z")

</div>

ActiveRecord::Extensions 0.6.0 is released! This adds one nice feature, one small feature and one bug fix. If you ever need to reload data from the database calling “reload” on more then one model instance then you ma…

---

## [\[ann\]](https://www.ruby-forum.com/t/ann/103449)

<div class="topic-metadata">

**Author:** [@zdennis](https://www.ruby-forum.com/u/zdennis)\
**Replies:** 0\
**Last updated:** [May 6, 2007, 6:41am UTC](https://www.ruby-forum.com/t/ann/103449 "2007-05-06T06:41:01Z")

</div>

ActiveRecord::Extensions 0.6.0 is released! This adds one nice feature, one small feature and one bug fix. If you ever need to reload data from the database calling “reload” on more then one model instance then you ma…

---

## [Two controllers needing the same method](https://www.ruby-forum.com/t/two-controllers-needing-the-same-method/103271)

<div class="topic-metadata">

**Author:** [@dorelal](https://www.ruby-forum.com/u/dorelal)\
**Replies:** 2\
**Last updated:** [May 6, 2007, 4:26am UTC](https://www.ruby-forum.com/t/two-controllers-needing-the-same-method/103271 "2007-05-06T04:26:22Z")

</div>

Two of my controllers need access to same method. I instantly put them in ApplicationController and the problem was solved. Now I’m thinking my ApplicationController is getting polluted because there are many cases …

---

## [\[ANN\] Radiant CMS 0.6.1 - Stone Cutter (Security Update)](https://www.ruby-forum.com/t/ann-radiant-cms-0-6-1-stone-cutter-security-update/110943)

<div class="topic-metadata">

**Author:** [@John\_WSLong](https://www.ruby-forum.com/u/John_WSLong)\
**Replies:** 0\
**Last updated:** [May 6, 2007, 2:28am UTC](https://www.ruby-forum.com/t/ann-radiant-cms-0-6-1-stone-cutter-security-update/110943 "2007-05-06T02:28:47Z")

</div>

Looks like it’s time for another release of Radiant: http://radiantcms.org/download/ This release contains an important security update. Passwords since 0.5 have been written straight into the log files without filter…

---

## [Encrypting data using Blowfish/cbc](https://www.ruby-forum.com/t/encrypting-data-using-blowfish-cbc/90927)

<div class="topic-metadata">

**Author:** [@jseidel](https://www.ruby-forum.com/u/jseidel)\
**Replies:** 1\
**Last updated:** [May 6, 2007, 2:18am UTC](https://www.ruby-forum.com/t/encrypting-data-using-blowfish-cbc/90927 "2007-05-06T02:18:47Z")

</div>

I need to encrypt/decrypt some data in my application. I downloaded crypt-1.1.4.zip and installed it successfully. But when I run a simple test program, I get the following error: C:/Dev/InstantRails/ruby/lib/ruby/si…

---

## [More questions re: Presenter pattern & ActionView](https://www.ruby-forum.com/t/more-questions-re-presenter-pattern-actionview/103441)

<div class="topic-metadata">

**Author:** [@dwfrank](https://www.ruby-forum.com/u/dwfrank)\
**Replies:** 0\
**Last updated:** [May 6, 2007, 2:13am UTC](https://www.ruby-forum.com/t/more-questions-re-presenter-pattern-actionview/103441 "2007-05-06T02:13:46Z")

</div>

We’ve been playing with the Presenter pattern a bit (as I asked about a few weeks ago) and now better understand the limitations without hacking deep into Rails. We’re sticking closely with Jay Fields’ thoughts: But…

---

## [Newbie issue](https://www.ruby-forum.com/t/newbie-issue/103435)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 2\
**Last updated:** [May 6, 2007, 12:49am UTC](https://www.ruby-forum.com/t/newbie-issue/103435 "2007-05-06T00:49:41Z")

</div>

I’m trying to get started learning Rails, but can’t get to first base. I have followed the instructions in Agile Web D. with Rails to build “Hello World”, but I keep getting the “Template is missing” error. I have che…

---

## [Newbie question about rendering partials and rhtml](https://www.ruby-forum.com/t/newbie-question-about-rendering-partials-and-rhtml/103361)

<div class="topic-metadata">

**Author:** [@gmoniey](https://www.ruby-forum.com/u/gmoniey)\
**Replies:** 7\
**Last updated:** [May 6, 2007, 12:40am UTC](https://www.ruby-forum.com/t/newbie-question-about-rendering-partials-and-rhtml/103361 "2007-05-06T00:40:41Z")

</div>

Hi, im not sure if i am on the right path here, so i figured i would ask. Basically, all of my pages have the same header and footer, and i was wondering if there was some way i could reference this from the rhtml fi…

---

## [Acts\_as\_attachment - no thumbnails?](https://www.ruby-forum.com/t/acts-as-attachment-no-thumbnails/103431)

<div class="topic-metadata">

**Author:** [@sbeam](https://www.ruby-forum.com/u/sbeam)\
**Replies:** 0\
**Last updated:** [May 5, 2007, 9:59pm UTC](https://www.ruby-forum.com/t/acts-as-attachment-no-thumbnails/103431 "2007-05-05T21:59:26Z")

</div>

the full-size pics upload OK, but no thumbs or resizing. There are no errors or exceptions that I can see, just not getting any thumbnails. The DB column ‘thumbnail’ is always NULL rmagick-1.15.6 is freshly installed. …

---

## [2 Rails Applications sharing same login system](https://www.ruby-forum.com/t/2-rails-applications-sharing-same-login-system/103170)

<div class="topic-metadata">

**Author:** [@chris](https://www.ruby-forum.com/u/chris)\
**Replies:** 12\
**Last updated:** [May 5, 2007, 9:36pm UTC](https://www.ruby-forum.com/t/2-rails-applications-sharing-same-login-system/103170 "2007-05-05T21:36:24Z")

</div>

Hi i have 2 seperate rails applications. They both share the same login system. If someone is logged into application 1 then they should be able to start using application 2 without logging in again. I am unsure how …

---

## [Multiple emai accounts w/ actionmailer & environment.rb](https://www.ruby-forum.com/t/multiple-emai-accounts-w-actionmailer-environment-rb/103425)

<div class="topic-metadata">

**Author:** [@jz176](https://www.ruby-forum.com/u/jz176)\
**Replies:** 0\
**Last updated:** [May 5, 2007, 8:01pm UTC](https://www.ruby-forum.com/t/multiple-emai-accounts-w-actionmailer-environment-rb/103425 "2007-05-05T20:01:30Z")

</div>

i have an app that i need to send emails to from different accounts on the same site… i.e we need removed\_email\_address@domain.invalid for mail from the contact us page and we also need removed\_email\_address@domain.inv…

---

## [Text Field Value unless?](https://www.ruby-forum.com/t/text-field-value-unless/103412)

<div class="topic-metadata">

**Author:** [@jamal](https://www.ruby-forum.com/u/jamal)\
**Replies:** 2\
**Last updated:** [May 5, 2007, 7:44pm UTC](https://www.ruby-forum.com/t/text-field-value-unless/103412 "2007-05-05T19:44:30Z")

</div>

Hello, Why is this not working :frowning: \<%= text\_field\_tag :post\_header, ‘’, :name =\> ‘post\[header\]’, :value @post.header if @post.header %\> I want the default value to be @post.header if it’s not nil :slight\_smile…

---

## [Creating menus with Ruby](https://www.ruby-forum.com/t/creating-menus-with-ruby/68341)

<div class="topic-metadata">

**Author:** [@hotgazpacho](https://www.ruby-forum.com/u/hotgazpacho)\
**Replies:** 1\
**Last updated:** [May 5, 2007, 7:34pm UTC](https://www.ruby-forum.com/t/creating-menus-with-ruby/68341 "2007-05-05T19:34:04Z")

</div>

Hello all, I’m continuing my journey into Ruby and Rails and would like to find a way to create CSS-compliant menus. I want to restrict what appears on the menu based on the user’s role, so I’m thinking that I’ll stor…

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

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