# Rails

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

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

---

## [Simulating script/console for backend process](https://www.ruby-forum.com/t/simulating-script-console-for-backend-process/161337)

<div class="topic-metadata">

**Author:** [@dmorin](https://www.ruby-forum.com/u/dmorin)\
**Replies:** 2\
**Last updated:** [February 26, 2009, 2:28am UTC](https://www.ruby-forum.com/t/simulating-script-console-for-backend-process/161337 "2009-02-26T02:28:15Z")

</div>

I could swear I’ve seen instructions before on how to do this, but I can’t find them. I’ve got a backend process that runs in the same environment as my webapp, injecting data into the model. In the interests of not …

---

## [Validation on a has\_many relationship](https://www.ruby-forum.com/t/validation-on-a-has-many-relationship/160854)

<div class="topic-metadata">

**Author:** [@sijo](https://www.ruby-forum.com/u/sijo)\
**Replies:** 11\
**Last updated:** [February 26, 2009, 2:11am UTC](https://www.ruby-forum.com/t/validation-on-a-has-many-relationship/160854 "2009-02-26T02:11:17Z")

</div>

Hi I have 2 models like request and contacts Request \< ActiveRecord::Base has\_many :contacts end Contact \< ActiveRecord::Base belongs\_to :request validates\_presence\_of :name, :message =\> ‘Name should not be blank’ …

---

## [Controller and views](https://www.ruby-forum.com/t/controller-and-views/161298)

<div class="topic-metadata">

**Author:** [@nilez](https://www.ruby-forum.com/u/nilez)\
**Replies:** 1\
**Last updated:** [February 26, 2009, 2:07am UTC](https://www.ruby-forum.com/t/controller-and-views/161298 "2009-02-26T02:07:11Z")

</div>

hi, I am writing an application in which i have list of books fetching from data base,i am using textbox to display that data from database .ie “xyz” hindi, are in textbox. i am displaying 100 record per page ,i want…

---

## [First Activerecord model missing attributes/methods](https://www.ruby-forum.com/t/first-activerecord-model-missing-attributes-methods/161380)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [February 26, 2009, 1:23am UTC](https://www.ruby-forum.com/t/first-activerecord-model-missing-attributes-methods/161380 "2009-02-26T01:23:15Z")

</div>

I’m having a very strange problem. I’m getting a collection of Rails ActiveRecord models back from the database but the first model in the collection does not have the model attributes/methods, just the standard Activ…

---

## [Adding a monkey patch](https://www.ruby-forum.com/t/adding-a-monkey-patch/161377)

<div class="topic-metadata">

**Author:** [@sygvin](https://www.ruby-forum.com/u/sygvin)\
**Replies:** 1\
**Last updated:** [February 26, 2009, 12:14am UTC](https://www.ruby-forum.com/t/adding-a-monkey-patch/161377 "2009-02-26T00:14:27Z")

</div>

Hi /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.0/lib/active\_record/connection\_adapters/mysql\_adapter.rb (class Mysql adapter) there is a call def create\_table(table\_name, options = {}) #:nodoc: super(table\_name, op…

---

## [On Ultrasphinx Associations](https://www.ruby-forum.com/t/on-ultrasphinx-associations/161370)

<div class="topic-metadata">

**Author:** [@SergioMB](https://www.ruby-forum.com/u/SergioMB)\
**Replies:** 0\
**Last updated:** [February 25, 2009, 11:04pm UTC](https://www.ruby-forum.com/t/on-ultrasphinx-associations/161370 "2009-02-25T23:04:50Z")

</div>

I am new to ultrasphinx and I am struggling with this issue. I ve got a model with the following associations and is\_indexed options: class Item has\_many :keywords is\_indexed :fields =\> \[‘id’, ‘collection\_id’,‘subje…

---

## [Multiple DBs and Query Cache](https://www.ruby-forum.com/t/multiple-dbs-and-query-cache/161364)

<div class="topic-metadata">

**Author:** [@starmaerker](https://www.ruby-forum.com/u/starmaerker)\
**Replies:** 0\
**Last updated:** [February 25, 2009, 9:42pm UTC](https://www.ruby-forum.com/t/multiple-dbs-and-query-cache/161364 "2009-02-25T21:42:26Z")

</div>

Hi all, I have an application where the majority of models live in one main DB, while I have a couple model relying on data in a old DB. So I created an abstract class for those models and called establish\_connection…

---

## [Find\_or\_create\_by\_](https://www.ruby-forum.com/t/find-or-create-by/161355)

<div class="topic-metadata">

**Author:** [@giga](https://www.ruby-forum.com/u/giga)\
**Replies:** 3\
**Last updated:** [February 25, 2009, 9:08pm UTC](https://www.ruby-forum.com/t/find-or-create-by/161355 "2009-02-25T21:08:14Z")

</div>

If I use find\_or\_create\_by\_… is it possible to define at was it created or founded?

---

## [What's happened to acts\_as\_state\_machine](https://www.ruby-forum.com/t/whats-happened-to-acts-as-state-machine/161334)

<div class="topic-metadata">

**Author:** [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Replies:** 7\
**Last updated:** [February 25, 2009, 8:56pm UTC](https://www.ruby-forum.com/t/whats-happened-to-acts-as-state-machine/161334 "2009-02-25T20:56:56Z")

</div>

I went to get the latest acts\_as\_state\_machine from GitHub - rubyist/aasm: AASM - State machines for Ruby classes and to my untrained eye it appears not to work anymore. At least it doesn’t work the same way that the …

---

## [Displaying line breaks & paragraphs using 'simple\_format'?](https://www.ruby-forum.com/t/displaying-line-breaks-paragraphs-using-simple-format/161278)

<div class="topic-metadata">

**Author:** [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Replies:** 2\
**Last updated:** [February 25, 2009, 8:18pm UTC](https://www.ruby-forum.com/t/displaying-line-breaks-paragraphs-using-simple-format/161278 "2009-02-25T20:18:54Z")

</div>

Hi there, I need to: STORE a text of the below format in a (MySQL) database (using a ‘textarea’), and then RETRIEVE & DISPLAY it in exactly the same format (meaning: keeping all paragraphs/line breaks). The intende…

---

## [Migration : value between 1 and 7](https://www.ruby-forum.com/t/migration-value-between-1-and-7/161352)

<div class="topic-metadata">

**Author:** [@loader](https://www.ruby-forum.com/u/loader)\
**Replies:** 8\
**Last updated:** [February 25, 2009, 8:06pm UTC](https://www.ruby-forum.com/t/migration-value-between-1-and-7/161352 "2009-02-25T20:06:38Z")

</div>

Hello everyone! I want to add a column to a table. So here is my migration. My question is : Is it possible to say that this value must be between 1 and 7 and must no be a float (1.4 shouldn’t be possible) ? class Ad…

---

## [Lockdown: Understanding "nil\_lockdown\_values"...?](https://www.ruby-forum.com/t/lockdown-understanding-nil-lockdown-values/161354)

<div class="topic-metadata">

**Author:** [@dezrtdude](https://www.ruby-forum.com/u/dezrtdude)\
**Replies:** 0\
**Last updated:** [February 25, 2009, 7:50pm UTC](https://www.ruby-forum.com/t/lockdown-understanding-nil-lockdown-values/161354 "2009-02-25T19:50:33Z")

</div>

Hi All, I’m having a bit of trouble wrapping my head around “nil\_lockdown\_values” in the Lockdown plugin. I’m unfamiliar with how exactly this works. I’m assuming it is a helper method of sorts, but I see no defini…

---

## [Nested Resources and Routes](https://www.ruby-forum.com/t/nested-resources-and-routes/161304)

<div class="topic-metadata">

**Author:** [@Sahil\_D](https://www.ruby-forum.com/u/Sahil_D)\
**Replies:** 2\
**Last updated:** [February 25, 2009, 7:24pm UTC](https://www.ruby-forum.com/t/nested-resources-and-routes/161304 "2009-02-25T19:24:02Z")

</div>

hi, i have some nested resources like, a deal has\_many :orders and has\_one :invoice i am using nested routing for these. so the urls are like: deals\_url deal\_orders\_url deal\_invoice\_url and others for the whole CR…

---

## [Implementing a web service in rails](https://www.ruby-forum.com/t/implementing-a-web-service-in-rails/161282)

<div class="topic-metadata">

**Author:** [@lazukars](https://www.ruby-forum.com/u/lazukars)\
**Replies:** 5\
**Last updated:** [February 25, 2009, 6:41pm UTC](https://www.ruby-forum.com/t/implementing-a-web-service-in-rails/161282 "2009-02-25T18:41:56Z")

</div>

Hi all, I need to implement a web service in rails with the following signature: string ReceiveEvents (string A, string B, string C). As you can see, it is basically a method that takes in three strings and returns a…

---

## [Count array keys possible?](https://www.ruby-forum.com/t/count-array-keys-possible/196900)

<div class="topic-metadata">

**Author:** [@remco](https://www.ruby-forum.com/u/remco)\
**Replies:** 6\
**Last updated:** [February 25, 2009, 6:09pm UTC](https://www.ruby-forum.com/t/count-array-keys-possible/196900 "2009-02-25T18:09:01Z")

</div>

Hi, newbie question(i guess) a = Bookings.find(:all, :conditions =\> \[3.days.ago\]) a = \[id : 1, departure : ‘AMS’, arrival =\> ‘NY’\],\[id : 2, departure : ‘AMS’, arrival =\> ‘BCN’\],\[id : 3, departure : ‘AMS’, arrival =\> …

---

## [Dynamic database connection](https://www.ruby-forum.com/t/dynamic-database-connection/161341)

<div class="topic-metadata">

**Author:** [@rickf](https://www.ruby-forum.com/u/rickf)\
**Replies:** 1\
**Last updated:** [February 25, 2009, 6:00pm UTC](https://www.ruby-forum.com/t/dynamic-database-connection/161341 "2009-02-25T18:00:08Z")

</div>

Hi All, Is there a way to determine the adapter type, as well as, other information on the fly for a database? For example, can you make a generic type connection to a database (assuming the db server port and/or cre…

---

## [Ar\_mailer issue - emails not getting saved into DB](https://www.ruby-forum.com/t/ar-mailer-issue-emails-not-getting-saved-into-db/149924)

<div class="topic-metadata">

**Author:** [@sgudibanda](https://www.ruby-forum.com/u/sgudibanda)\
**Replies:** 5\
**Last updated:** [February 25, 2009, 5:36pm UTC](https://www.ruby-forum.com/t/ar-mailer-issue-emails-not-getting-saved-into-db/149924 "2009-02-25T17:36:41Z")

</div>

Hi, I just installed ar\_mailer. When i trigger an action that sends out feature update mails to everyone, absolutely nothing gets stored in emails. But instead i see in log/development.log that Sent mail: From: remo…

---

## [Search engine that works with MS SQL Server](https://www.ruby-forum.com/t/search-engine-that-works-with-ms-sql-server/161299)

<div class="topic-metadata">

**Author:** [@tuktuk](https://www.ruby-forum.com/u/tuktuk)\
**Replies:** 4\
**Last updated:** [February 25, 2009, 5:09pm UTC](https://www.ruby-forum.com/t/search-engine-that-works-with-ms-sql-server/161299 "2009-02-25T17:09:19Z")

</div>

Can anyone recommend a search engine for Rails that works with MS SQL Server? I have good experience in using Sphinx and the Rails plugin UltraSphinx. Unfortunately, it supports only MySQL and PostgreSQL. The newest b…

---

## [Eager loading with has\_many :through](https://www.ruby-forum.com/t/eager-loading-with-has-many-through/161294)

<div class="topic-metadata">

**Author:** [@shenry](https://www.ruby-forum.com/u/shenry)\
**Replies:** 2\
**Last updated:** [February 25, 2009, 4:54pm UTC](https://www.ruby-forum.com/t/eager-loading-with-has-many-through/161294 "2009-02-25T16:54:28Z")

</div>

I’ve got the following associations: class Photo \< AR::Base has\_many :slides has\_many :albums, :through =\> :slides this has an attachment\_fu attachment which creates a thumbnail image for each uploaded photo. end c…

---

## [Background browser independent Application](https://www.ruby-forum.com/t/background-browser-independent-application/160952)

<div class="topic-metadata">

**Author:** [@salil](https://www.ruby-forum.com/u/salil)\
**Replies:** 1\
**Last updated:** [February 25, 2009, 4:34pm UTC](https://www.ruby-forum.com/t/background-browser-independent-application/160952 "2009-02-25T16:34:53Z")

</div>

Hello everyone, i faced problems while creating a software application which will run in background. it will communicate with a remote site i.e. read value from csv file present in the application with value present i…

---

## [How to resolve JavaScripts Conflict](https://www.ruby-forum.com/t/how-to-resolve-javascripts-conflict/161325)

<div class="topic-metadata">

**Author:** [@salil](https://www.ruby-forum.com/u/salil)\
**Replies:** 5\
**Last updated:** [February 25, 2009, 4:31pm UTC](https://www.ruby-forum.com/t/how-to-resolve-javascripts-conflict/161325 "2009-02-25T16:31:58Z")

</div>

How to resolve the javascripts conflicts between jQuery.js and prototype.js. Thanks Salil

---

## [Wiki kind of features](https://www.ruby-forum.com/t/wiki-kind-of-features/161310)

<div class="topic-metadata">

**Author:** [@sgudibanda](https://www.ruby-forum.com/u/sgudibanda)\
**Replies:** 1\
**Last updated:** [February 25, 2009, 4:19pm UTC](https://www.ruby-forum.com/t/wiki-kind-of-features/161310 "2009-02-25T16:19:35Z")

</div>

Hi, We are planning to implement a wiki kinda feature on a company page. The details of the company can be edited/updated by any. Is there a nice n clean way to do this feature? Any suggestions? Regards, SG

---

## [Routes with parameters ordered differently](https://www.ruby-forum.com/t/routes-with-parameters-ordered-differently/161331)

<div class="topic-metadata">

**Author:** [@kailas](https://www.ruby-forum.com/u/kailas)\
**Replies:** 0\
**Last updated:** [February 25, 2009, 3:52pm UTC](https://www.ruby-forum.com/t/routes-with-parameters-ordered-differently/161331 "2009-02-25T15:52:00Z")

</div>

Hi, i’m trying to setup a custom route and having some trouble. In various resources i’ve seen plenty of examples of how to do something along the lines of: map.connect “foo/bar/:a/:b/:c”, :controller =\> “foo”, :act…

---

## [Association through 2 intermediate Models](https://www.ruby-forum.com/t/association-through-2-intermediate-models/161311)

<div class="topic-metadata">

**Author:** [@sol](https://www.ruby-forum.com/u/sol)\
**Replies:** 6\
**Last updated:** [February 25, 2009, 3:40pm UTC](https://www.ruby-forum.com/t/association-through-2-intermediate-models/161311 "2009-02-25T15:40:13Z")

</div>

Hey, I have an association chain like this: Site has\_many Feed(s) has\_many FeedEntry(/ies) has\_many Articles where the reverse is always belongs\_to: Article belongs\_to FeedEntry belongs\_to Feed belongs\_to Site Now w…

---

## [InvalidAuthenticityToken error with db sessions](https://www.ruby-forum.com/t/invalidauthenticitytoken-error-with-db-sessions/161320)

<div class="topic-metadata">

**Author:** [@sa125](https://www.ruby-forum.com/u/sa125)\
**Replies:** 3\
**Last updated:** [February 25, 2009, 3:17pm UTC](https://www.ruby-forum.com/t/invalidauthenticitytoken-error-with-db-sessions/161320 "2009-02-25T15:17:10Z")

</div>

I added login to my app and storing the sessions in the db. I un-commented the “config.action\_controller.session\_store = :active\_record\_store” line in the environment.rb file, and the :secret in the application.rb fil…

---

## [Multiple rows in a model](https://www.ruby-forum.com/t/multiple-rows-in-a-model/161313)

<div class="topic-metadata">

**Author:** [@rmswarna](https://www.ruby-forum.com/u/rmswarna)\
**Replies:** 1\
**Last updated:** [February 25, 2009, 3:15pm UTC](https://www.ruby-forum.com/t/multiple-rows-in-a-model/161313 "2009-02-25T15:15:59Z")

</div>

Hi, I am new to rails. Any support from your side would be very helpful. I have two models one named Child.rb and the other named Filtersetting.rb The general idea is one user can have many children and one child can …

---

## [Problem with set\_table\_name](https://www.ruby-forum.com/t/problem-with-set-table-name/161322)

<div class="topic-metadata">

**Author:** [@sarathy](https://www.ruby-forum.com/u/sarathy)\
**Replies:** 1\
**Last updated:** [February 25, 2009, 3:13pm UTC](https://www.ruby-forum.com/t/problem-with-set-table-name/161322 "2009-02-25T15:13:38Z")

</div>

Dear friends, I ran the following in my console.Assume I already have the postgresql connection . class D \< ActiveRecord::Base end =\> nil D.set\_table\_name “users” =\> nil D.column\_names =\> \[“id”, “name”, …

---

## [Gem install mysql --\> Error](https://www.ruby-forum.com/t/gem-install-mysql-error/161319)

<div class="topic-metadata">

**Author:** [@sankarkumar](https://www.ruby-forum.com/u/sankarkumar)\
**Replies:** 2\
**Last updated:** [February 25, 2009, 2:20pm UTC](https://www.ruby-forum.com/t/gem-install-mysql-error/161319 "2009-02-25T14:20:35Z")

</div>

Hi, When I try to install “gem install mysql” it throwing error. For your ref, bash-2.05b$ gem install mysql – –with-mysql-dir=/opt/etrade/p6/share/mysql5 ERROR: http://gems.rubyforge.org/ does not appear to be a r…

---

## [Render :update problem](https://www.ruby-forum.com/t/render-update-problem/161253)

<div class="topic-metadata">

**Author:** [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Replies:** 11\
**Last updated:** [February 25, 2009, 1:22pm UTC](https://www.ruby-forum.com/t/render-update-problem/161253 "2009-02-25T13:22:14Z")

</div>

I have this div in my application.rhtml file: \<%= render :partial =\> 'ericssoncards' %\> When I go to another view I am doing this: def turin2000 render :update do |page| page\[:shelfcards\].replace\_html :partial =\> ‘t…

---

## [Updating multiple records in a single form](https://www.ruby-forum.com/t/updating-multiple-records-in-a-single-form/161318)

<div class="topic-metadata">

**Author:** [@vikas](https://www.ruby-forum.com/u/vikas)\
**Replies:** 0\
**Last updated:** [February 25, 2009, 12:43pm UTC](https://www.ruby-forum.com/t/updating-multiple-records-in-a-single-form/161318 "2009-02-25T12:43:03Z")

</div>

Hello All, I am new to ruby, so please excuse me. problem is -------- I have a model named “Album” I want to update all records from “albums” table in a single form and single button “Update”. my code for view — \<%…

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

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