# Rails

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

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

---

## [Help with libxml](https://www.ruby-forum.com/t/help-with-libxml/174022)

<div class="topic-metadata">

**Author:** [@dino\_d](https://www.ruby-forum.com/u/dino_d)\
**Replies:** 1\
**Last updated:** [August 19, 2009, 5:46pm UTC](https://www.ruby-forum.com/t/help-with-libxml/174022 "2009-08-19T17:46:03Z")

</div>

hi - i’m pulling my hair out. the find method simply won’t work for me. here’s my xml doc: that’s it. now after parsing, i do doc.find(’/top/first’) and i get a result with size 0. i’ve tried everything. is…

---

## [Detecting if a render or redirect\_to has been called](https://www.ruby-forum.com/t/detecting-if-a-render-or-redirect-to-has-been-called/174024)

<div class="topic-metadata">

**Author:** [@dreamwave](https://www.ruby-forum.com/u/dreamwave)\
**Replies:** 1\
**Last updated:** [August 19, 2009, 4:47pm UTC](https://www.ruby-forum.com/t/detecting-if-a-render-or-redirect-to-has-been-called/174024 "2009-08-19T16:47:51Z")

</div>

I know that you can only render / redirect\_to once in a controller action, but I was wondering if there’s a property I can check to see if a render / redirect\_to has been called. For example, I have a method I call t…

---

## [How do you set session variables inside an integration test?](https://www.ruby-forum.com/t/how-do-you-set-session-variables-inside-an-integration-test/174025)

<div class="topic-metadata">

**Author:** [@Phoenix\_R](https://www.ruby-forum.com/u/Phoenix_R)\
**Replies:** 0\
**Last updated:** [August 19, 2009, 4:41pm UTC](https://www.ruby-forum.com/t/how-do-you-set-session-variables-inside-an-integration-test/174025 "2009-08-19T16:41:04Z")

</div>

I’m writing integration tests for a “who’s logged in” function for a project I’m working on. The system checks the database to see when the last request was made, and to ensure that it only returns user objects (from…

---

## [Extending models with statistic capabilities](https://www.ruby-forum.com/t/extending-models-with-statistic-capabilities/174021)

<div class="topic-metadata">

**Author:** [@christoph\_j](https://www.ruby-forum.com/u/christoph_j)\
**Replies:** 0\
**Last updated:** [August 19, 2009, 4:04pm UTC](https://www.ruby-forum.com/t/extending-models-with-statistic-capabilities/174021 "2009-08-19T16:04:12Z")

</div>

Hi, I have several models in my app which contain several numerical attribute. Ex.: stock model; attributes: bid, ask, value,… todays\_values\_of\_Google = \[ \[#Stock: id=1, bid = 1.5, ask = 1.5, value = 1.5, time=…, ……

---

## [Potential concurrency issues with a global hash to reduce DB](https://www.ruby-forum.com/t/potential-concurrency-issues-with-a-global-hash-to-reduce-db/173905)

<div class="topic-metadata">

**Author:** [@frankiefoo](https://www.ruby-forum.com/u/frankiefoo)\
**Replies:** 12\
**Last updated:** [August 19, 2009, 2:43pm UTC](https://www.ruby-forum.com/t/potential-concurrency-issues-with-a-global-hash-to-reduce-db/173905 "2009-08-19T14:43:24Z")

</div>

Hi folks: I’m building something akin to Google Analytics and currently I’m doing real time database updates. However this isn’t really scaling anymore, so I need to stop doing synchronous DB operations. In the shor…

---

## [Secure Form question](https://www.ruby-forum.com/t/secure-form-question/174012)

<div class="topic-metadata">

**Author:** [@Trausti\_Thor\_J](https://www.ruby-forum.com/u/Trausti_Thor_J)\
**Replies:** 5\
**Last updated:** [August 19, 2009, 2:42pm UTC](https://www.ruby-forum.com/t/secure-form-question/174012 "2009-08-19T14:42:49Z")

</div>

In cakephp, you have Secure component. It takes certain form values like id and User\_id and such and encodes them. How is this done in rails ? I don’t want the user to change ids on items for deletions and such. Tr…

---

## [File include error](https://www.ruby-forum.com/t/file-include-error/174003)

<div class="topic-metadata">

**Author:** [@wap](https://www.ruby-forum.com/u/wap)\
**Replies:** 4\
**Last updated:** [August 19, 2009, 2:32pm UTC](https://www.ruby-forum.com/t/file-include-error/174003 "2009-08-19T14:32:37Z")

</div>

Hello guys, i want to include file in another file for ex. i have a file \_search.html.erb & index.html.erb \_search include in index using \<% render :partial =\> ‘search’%\> that’s no problem but i want to without under…

---

## [DBI: connect succeeds in IRB, fails in Rails](https://www.ruby-forum.com/t/dbi-connect-succeeds-in-irb-fails-in-rails/173945)

<div class="topic-metadata">

**Author:** [@trevoke](https://www.ruby-forum.com/u/trevoke)\
**Replies:** 2\
**Last updated:** [August 19, 2009, 2:24pm UTC](https://www.ruby-forum.com/t/dbi-connect-succeeds-in-irb-fails-in-rails/173945 "2009-08-19T14:24:34Z")

</div>

require ‘dbi’ # 0.4.2 dbh = DBI.connect(‘DBI:ODBC:PACS’, ‘username’, ‘password’) This works in IRB; in Rails it fails (taken from Rails console): DBI::InterfaceError: Unable to load driver ‘ODBC’ (underlying error: u…

---

## [Error when output has a period (".") in the name](https://www.ruby-forum.com/t/error-when-output-has-a-period-in-the-name/173946)

<div class="topic-metadata">

**Author:** [@bagadoughnuts](https://www.ruby-forum.com/u/bagadoughnuts)\
**Replies:** 1\
**Last updated:** [August 19, 2009, 1:18pm UTC](https://www.ruby-forum.com/t/error-when-output-has-a-period-in-the-name/173946 "2009-08-19T13:18:31Z")

</div>

Hi all, Hopefully this is easy for you guys. I’m trying to output a list of usernames and everything has been working well. However, when I added a user with a period in their username it generates this error. If I r…

---

## [Paging error](https://www.ruby-forum.com/t/paging-error/174014)

<div class="topic-metadata">

**Author:** [@wap](https://www.ruby-forum.com/u/wap)\
**Replies:** 0\
**Last updated:** [August 19, 2009, 12:26pm UTC](https://www.ruby-forum.com/t/paging-error/174014 "2009-08-19T12:26:23Z")

</div>

i want to do paging with ajax i am using link\_to\_remote file and than include partial for ex. items/index.html.erb \<%link\_to\_remote(‘items’,update=\>‘cont’,:url=\>{:action=\>:list})%\> list.html.erb this is also in item…

---

## [Attaching files through attachment\_fu](https://www.ruby-forum.com/t/attaching-files-through-attachment-fu/174000)

<div class="topic-metadata">

**Author:** [@charanya](https://www.ruby-forum.com/u/charanya)\
**Replies:** 3\
**Last updated:** [August 19, 2009, 11:07am UTC](https://www.ruby-forum.com/t/attaching-files-through-attachment-fu/174000 "2009-08-19T11:07:53Z")

</div>

Hi I wish to upload a file not from the view but from the controller itself. I have the file’s path and mimetype and size. I would like to know How it can be done directly from the controller Thanks in Advance

---

## [Find ActiveRecord Session by session\_id](https://www.ruby-forum.com/t/find-activerecord-session-by-session-id/173995)

<div class="topic-metadata">

**Author:** [@maruthymukund](https://www.ruby-forum.com/u/maruthymukund)\
**Replies:** 2\
**Last updated:** [August 19, 2009, 9:42am UTC](https://www.ruby-forum.com/t/find-activerecord-session-by-session-id/173995 "2009-08-19T09:42:15Z")

</div>

Hi We are in the process of integrating a Java web application with our existing Rails application. The user logs into the Rails application and will at some point proceed to the Java part, now the Java application s…

---

## [How to insert a new record in to table](https://www.ruby-forum.com/t/how-to-insert-a-new-record-in-to-table/173997)

<div class="topic-metadata">

**Author:** [@akramwasim1234](https://www.ruby-forum.com/u/akramwasim1234)\
**Replies:** 2\
**Last updated:** [August 19, 2009, 9:36am UTC](https://www.ruby-forum.com/t/how-to-insert-a-new-record-in-to-table/173997 "2009-08-19T09:36:05Z")

</div>

hi all, I want to insert new records into table but i dont konw how to use it using rails methods as far i know was Model.save Model.update is there any ways to insert new records with params plz help me…

---

## [ActionMailer - Problem](https://www.ruby-forum.com/t/actionmailer-problem/173935)

<div class="topic-metadata">

**Author:** [@mjayakumar2k6](https://www.ruby-forum.com/u/mjayakumar2k6)\
**Replies:** 8\
**Last updated:** [August 19, 2009, 8:30am UTC](https://www.ruby-forum.com/t/actionmailer-problem/173935 "2009-08-19T08:30:46Z")

</div>

Hi, I am some problem in action mailer. if I run the same project in other system it is working fine. But now working in my system. Could please help me to solve this problem? Thanks Jk

---

## [Postgres defaults to ID DESC, MySQL defaults to ID ASC](https://www.ruby-forum.com/t/postgres-defaults-to-id-desc-mysql-defaults-to-id-asc/173981)

<div class="topic-metadata">

**Author:** [@benjohnson](https://www.ruby-forum.com/u/benjohnson)\
**Replies:** 4\
**Last updated:** [August 19, 2009, 3:13am UTC](https://www.ruby-forum.com/t/postgres-defaults-to-id-desc-mysql-defaults-to-id-asc/173981 "2009-08-19T03:13:31Z")

</div>

I just switched to Postgres and some of my tests are failing. It seems that Postgres defaults by ordering data by ID DESC, whereas MySQL defaults to ordering by ID ASC. What is the best practice for handling this? Is …

---

## [Storing a value of an enum in the ActiveRecord model](https://www.ruby-forum.com/t/storing-a-value-of-an-enum-in-the-activerecord-model/173977)

<div class="topic-metadata">

**Author:** [@glex](https://www.ruby-forum.com/u/glex)\
**Replies:** 4\
**Last updated:** [August 19, 2009, 2:59am UTC](https://www.ruby-forum.com/t/storing-a-value-of-an-enum-in-the-activerecord-model/173977 "2009-08-19T02:59:51Z")

</div>

Hi, everyone! What is a good way to store a enum value in the ActiveRecord? For example, I have a User model. The User has a “gender” that can only be :not\_specified, :male, or :female. Gleb

---

## [Capistrano deploy:web:disable doesn't work](https://www.ruby-forum.com/t/capistrano-deploydisable-doesnt-work/173976)

<div class="topic-metadata">

**Author:** [@elricstorm](https://www.ruby-forum.com/u/elricstorm)\
**Replies:** 4\
**Last updated:** [August 19, 2009, 2:46am UTC](https://www.ruby-forum.com/t/capistrano-deploydisable-doesnt-work/173976 "2009-08-19T02:46:55Z")

</div>

Hi all, I’m trying to figure out why cap deploy:web:disable isn’t working for my server. I’m adding a pastie with the example apache RewriteCond I’m using with my rails app. http://pastie.org/587619 The document ro…

---

## [ActionMailer method level layouts](https://www.ruby-forum.com/t/actionmailer-method-level-layouts/173908)

<div class="topic-metadata">

**Author:** [@nextpulse](https://www.ruby-forum.com/u/nextpulse)\
**Replies:** 3\
**Last updated:** [August 19, 2009, 2:01am UTC](https://www.ruby-forum.com/t/actionmailer-method-level-layouts/173908 "2009-08-19T02:01:51Z")

</div>

I am using layouts in 2.3’s ActionMalier. I know I can specify a layout at the class level: class MyMailer \< ActionMailer::Base layout ‘foo’ … end Is it possible to define one at the method level? i.e. class MyMa…

---

## [Active Record Associations and application outline advice](https://www.ruby-forum.com/t/active-record-associations-and-application-outline-advice/173907)

<div class="topic-metadata">

**Author:** [@scudco](https://www.ruby-forum.com/u/scudco)\
**Replies:** 10\
**Last updated:** [August 19, 2009, 2:01am UTC](https://www.ruby-forum.com/t/active-record-associations-and-application-outline-advice/173907 "2009-08-19T02:01:12Z")

</div>

Hi if i have one model say with objects for each letter of the alphabet e.g a,b,c … x,y,z and i want to allow users to create there own favourite pairings of these e.g. ab, cd, ef, gp and allow them to discuss via com…

---

## [Due date default to n days from now in migration](https://www.ruby-forum.com/t/due-date-default-to-n-days-from-now-in-migration/173772)

<div class="topic-metadata">

**Author:** [@nik](https://www.ruby-forum.com/u/nik)\
**Replies:** 5\
**Last updated:** [August 19, 2009, 1:58am UTC](https://www.ruby-forum.com/t/due-date-default-to-n-days-from-now-in-migration/173772 "2009-08-19T01:58:21Z")

</div>

hello,how can I set the default value of a column in the migration called due\_on with type datetime to n days from now at the time when a model is created ?

---

## [In-place Editing; State of the Union](https://www.ruby-forum.com/t/in-place-editing-state-of-the-union/170893)

<div class="topic-metadata">

**Author:** [@corywilkerson](https://www.ruby-forum.com/u/corywilkerson)\
**Replies:** 1\
**Last updated:** [August 19, 2009, 1:26am UTC](https://www.ruby-forum.com/t/in-place-editing-state-of-the-union/170893 "2009-08-19T01:26:45Z")

</div>

All, Wants the current State of the Union wrt in-place editing and Rails 2.2 or \>? Are folks using the in\_place\_editor plugin? SuperInPlaceControls (http://os.flvorful.com/super\_in\_place\_controls)? Rolling your own? G…

---

## [Database structuring](https://www.ruby-forum.com/t/database-structuring/173965)

<div class="topic-metadata">

**Author:** [@peterbe](https://www.ruby-forum.com/u/peterbe)\
**Replies:** 4\
**Last updated:** [August 18, 2009, 11:14pm UTC](https://www.ruby-forum.com/t/database-structuring/173965 "2009-08-18T23:14:15Z")

</div>

Hi I have website which displays tweets (from twitter). Each tweet can either be given thumbsup or thumbsdown, but only once. What would be the best way to organzine a database table for this? Its a many-to-many r…

---

## [Caching in controller pre rails 2.05](https://www.ruby-forum.com/t/caching-in-controller-pre-rails-2-05/173974)

<div class="topic-metadata">

**Author:** [@dezrtdude](https://www.ruby-forum.com/u/dezrtdude)\
**Replies:** 0\
**Last updated:** [August 18, 2009, 10:07pm UTC](https://www.ruby-forum.com/t/caching-in-controller-pre-rails-2-05/173974 "2009-08-18T22:07:01Z")

</div>

hello, i am working on a project at university where we are developing a caching system for an open source rails CMS. we need to be able to cache dynamic content, however, cant use fragment caching for this. memcached …

---

## [Rendered as needed](https://www.ruby-forum.com/t/rendered-as-needed/173931)

<div class="topic-metadata">

**Author:** [@RVince](https://www.ruby-forum.com/u/RVince)\
**Replies:** 4\
**Last updated:** [August 18, 2009, 8:49pm UTC](https://www.ruby-forum.com/t/rendered-as-needed/173931 "2009-08-18T20:49:52Z")

</div>

Is there a way to get a link to a partial to open in a div, which I can open with the prototype .toggle() ? What I want is to put a link on a page, which, when clicked, renders the partial in a div in that page. Howe…

---

## [Possible BUG on rails 2.2.3 with ruby 1.8.7 patchlevel 174](https://www.ruby-forum.com/t/possible-bug-on-rails-2-2-3-with-ruby-1-8-7-patchlevel-174/173967)

<div class="topic-metadata">

**Author:** [@Xinobit](https://www.ruby-forum.com/u/Xinobit)\
**Replies:** 1\
**Last updated:** [August 18, 2009, 8:32pm UTC](https://www.ruby-forum.com/t/possible-bug-on-rails-2-2-3-with-ruby-1-8-7-patchlevel-174/173967 "2009-08-18T20:32:54Z")

</div>

Try this in a view running rails 2.2.3 with ruby 1.8.7. I tried in 1.8.6 and worked just as expected. But in 1.8.7 it doesn’t execute the code inside a condition that has a comment. Sample: \<% if (@var)%\> @var is nil…

---

## [Unable to download the latest release 1.9.1](https://www.ruby-forum.com/t/unable-to-download-the-latest-release-1-9-1/173971)

<div class="topic-metadata">

**Author:** [@deostroll](https://www.ruby-forum.com/u/deostroll)\
**Replies:** 0\
**Last updated:** [August 18, 2009, 8:32pm UTC](https://www.ruby-forum.com/t/unable-to-download-the-latest-release-1-9-1/173971 "2009-08-18T20:32:54Z")

</div>

HI, I am unable to download the latest version of ruby from: ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.1-p243.tar.gz Will this interfere with the rails installation? –deostroll

---

## [Will\_paginate](https://www.ruby-forum.com/t/will-paginate/173960)

<div class="topic-metadata">

**Author:** [@soller](https://www.ruby-forum.com/u/soller)\
**Replies:** 1\
**Last updated:** [August 18, 2009, 8:27pm UTC](https://www.ruby-forum.com/t/will-paginate/173960 "2009-08-18T20:27:02Z")

</div>

Hi, I don’t speak English very well, and I have a problem, with the gem mislav-will-paginate I install perfect, the las version 2.3.11 and I did the example http://dev.nozav.org/rails\_ajax\_table.html and I copy all!! …

---

## [Using observe\_field on an field inside a fields\_for](https://www.ruby-forum.com/t/using-observe-field-on-an-field-inside-a-fields-for/173898)

<div class="topic-metadata">

**Author:** [@jay](https://www.ruby-forum.com/u/jay)\
**Replies:** 4\
**Last updated:** [August 18, 2009, 7:49pm UTC](https://www.ruby-forum.com/t/using-observe-field-on-an-field-inside-a-fields-for/173898 "2009-08-18T19:49:34Z")

</div>

I’m trying to observe a field that get generated inside a fields\_for loop (I’m trying to create the form dynamically depending on a selection value). Is there a way to access the index in the field\_for loop? Thanks, …

---

## [Cross domain sessions](https://www.ruby-forum.com/t/cross-domain-sessions/173955)

<div class="topic-metadata">

**Author:** [@rob](https://www.ruby-forum.com/u/rob)\
**Replies:** 1\
**Last updated:** [August 18, 2009, 6:39pm UTC](https://www.ruby-forum.com/t/cross-domain-sessions/173955 "2009-08-18T18:39:24Z")

</div>

Hi there, I am wondering if anyone can help me. I’ve come across a bit of a sticky problem. I’m currently running a Facebook application which takes payment from users. In order to take payment securely we’re had to b…

---

## [\[ADV/REMINDER\] Ruby language training in September, w/ Black & Kastner!](https://www.ruby-forum.com/t/adv-reminder-ruby-language-training-in-september-w-black-kastner/173959)

<div class="topic-metadata">

**Author:** [@David\_ASBlack](https://www.ruby-forum.com/u/David_ASBlack)\
**Replies:** 0\
**Last updated:** [August 18, 2009, 6:36pm UTC](https://www.ruby-forum.com/t/adv-reminder-ruby-language-training-in-september-w-black-kastner/173959 "2009-08-18T18:36:22Z")

</div>

Hi all – Don’t forget that Ruby Power and Light has some Ruby training coming up, taught by me and Erik Kastner. It’s ideal for: programmers who are new to Ruby Ruby programmers who want to review the language syst…

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

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