# Rails

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

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

---

## [Output XML to File](https://www.ruby-forum.com/t/output-xml-to-file/226046)

<div class="topic-metadata">

**Author:** [@snantz](https://www.ruby-forum.com/u/snantz)\
**Replies:** 1\
**Last updated:** [August 5, 2009, 12:09am UTC](https://www.ruby-forum.com/t/output-xml-to-file/226046 "2009-08-05T00:09:49Z")

</div>

I am trying to read some information based on a user id, then search the database for the needed info and build an XML file. Everything seems to be working fine; I read the info, I create the xml and even spit “stuff” …

---

## [Integration Testing Posting Problem](https://www.ruby-forum.com/t/integration-testing-posting-problem/173209)

<div class="topic-metadata">

**Author:** [@rilindo\_foster](https://www.ruby-forum.com/u/rilindo_foster)\
**Replies:** 1\
**Last updated:** [August 4, 2009, 11:35pm UTC](https://www.ruby-forum.com/t/integration-testing-posting-problem/173209 "2009-08-04T23:35:16Z")

</div>

Hi! I am trying to get the hang of perform integration testing and I have a slight problem with posting. Basically, I can pull the id like so: @nodename = Node.find\_by\_name(“servername”).id Then able to get a valid 2…

---

## [Don't show XML attributes if they ar eblank or nil](https://www.ruby-forum.com/t/dont-show-xml-attributes-if-they-ar-eblank-or-nil/173208)

<div class="topic-metadata">

**Author:** [@bikle](https://www.ruby-forum.com/u/bikle)\
**Replies:** 0\
**Last updated:** [August 4, 2009, 11:20pm UTC](https://www.ruby-forum.com/t/dont-show-xml-attributes-if-they-ar-eblank-or-nil/173208 "2009-08-04T23:20:43Z")

</div>

Hi, I’m creating a dynamic xml file using builder in Rails, which pulls from several different related tables. Some of my nodes include attributes, but some don’t. I would like to find a way to leave out those attribu…

---

## [Active record sessions 2.3.3](https://www.ruby-forum.com/t/active-record-sessions-2-3-3/173205)

<div class="topic-metadata">

**Author:** [@thumbrule](https://www.ruby-forum.com/u/thumbrule)\
**Replies:** 0\
**Last updated:** [August 4, 2009, 10:50pm UTC](https://www.ruby-forum.com/t/active-record-sessions-2-3-3/173205 "2009-08-04T22:50:47Z")

</div>

Hi, I am trying to store the session in db and i followed these steps a.) rake db:session:create b.) db migrate --\> this created the table. I see the table in the db now. c.) Uncommented the ActionController::Base.s…

---

## [Admin subdirectory and "No action responded to observations." error](https://www.ruby-forum.com/t/admin-subdirectory-and-no-action-responded-to-observations-error/173202)

<div class="topic-metadata">

**Author:** [@Yoann-Z](https://www.ruby-forum.com/u/Yoann-Z)\
**Replies:** 0\
**Last updated:** [August 4, 2009, 9:45pm UTC](https://www.ruby-forum.com/t/admin-subdirectory-and-no-action-responded-to-observations-error/173202 "2009-08-04T21:45:48Z")

</div>

Hi there, I’m working on a project which uses an admin subdirectory. So I created an admin controller and every controller in my admin subdirectory looks like this : class Admin::FooController \<\< AdminController I a…

---

## [Json views](https://www.ruby-forum.com/t/json-views/173135)

<div class="topic-metadata">

**Author:** [@Nicholas\_W](https://www.ruby-forum.com/u/Nicholas_W)\
**Replies:** 3\
**Last updated:** [August 4, 2009, 9:35pm UTC](https://www.ruby-forum.com/t/json-views/173135 "2009-08-04T21:35:15Z")

</div>

Hi \*, I’m writing an API for my application, but I can’t figure out how to behave with the json frontend, where I need to do something like @object.image.url. Should I write a .json view or there’s some special method…

---

## [Form\_tag changes for 2.0?](https://www.ruby-forum.com/t/form-tag-changes-for-2-0/173199)

<div class="topic-metadata">

**Author:** [@agilehack](https://www.ruby-forum.com/u/agilehack)\
**Replies:** 1\
**Last updated:** [August 4, 2009, 9:10pm UTC](https://www.ruby-forum.com/t/form-tag-changes-for-2-0/173199 "2009-08-04T21:10:05Z")

</div>

can someone help me…I understand that with 2.0 start\_ and end\_ form\_tag has been deprecated? Below is my code and I can’t seem to rewrite such that it will work correctly with 2.0… \<%= form\_tag :action =\> “save” , :i…

---

## [Homepage 404 error - HELP!](https://www.ruby-forum.com/t/homepage-404-error-help/173195)

<div class="topic-metadata">

**Author:** [@GearSSS\_id\_OSCealla](https://www.ruby-forum.com/u/GearSSS_id_OSCealla)\
**Replies:** 1\
**Last updated:** [August 4, 2009, 9:10pm UTC](https://www.ruby-forum.com/t/homepage-404-error-help/173195 "2009-08-04T21:10:05Z")

</div>

Hey guys, I made an update to my website last night (located over at exitmusic.ie). I didn’t change much, just an update to the application.html.erb file - everything looked fine yesterday evening but when I go to ex…

---

## [ActiveResource xml element ordering](https://www.ruby-forum.com/t/activeresource-xml-element-ordering/173161)

<div class="topic-metadata">

**Author:** [@slavix](https://www.ruby-forum.com/u/slavix)\
**Replies:** 7\
**Last updated:** [August 4, 2009, 9:02pm UTC](https://www.ruby-forum.com/t/activeresource-xml-element-ordering/173161 "2009-08-04T21:02:56Z")

</div>

Hello, I am using ActiveResource to integrate with a 3rd party service. when calling MyModel.save a POST with xml is sent. I need to make sure that xml is created with defined order of elements (the service requires …

---

## [Decimal datatype and trailing zeros](https://www.ruby-forum.com/t/decimal-datatype-and-trailing-zeros/173116)

<div class="topic-metadata">

**Author:** [@lucac81](https://www.ruby-forum.com/u/lucac81)\
**Replies:** 5\
**Last updated:** [August 4, 2009, 6:44pm UTC](https://www.ruby-forum.com/t/decimal-datatype-and-trailing-zeros/173116 "2009-08-04T18:44:17Z")

</div>

Hello I’ve encountered a little problem with zeros using the decimal data type Specifying a scale of 3 and inserting a number with 3 zeros after the point (for example 12345.000) it gets correctly stored in the data…

---

## [Best Practice: Automatic session timeout/cleanup?](https://www.ruby-forum.com/t/best-practice-automatic-session-timeout-cleanup/173146)

<div class="topic-metadata">

**Author:** [@Phoenix\_R](https://www.ruby-forum.com/u/Phoenix_R)\
**Replies:** 10\
**Last updated:** [August 4, 2009, 6:41pm UTC](https://www.ruby-forum.com/t/best-practice-automatic-session-timeout-cleanup/173146 "2009-08-04T18:41:22Z")

</div>

I’m developing an application where I need to have all sessions that have been inactive for X minutes (in this case, I’m thinking 10 minutes, but I’m flexible to a point) automatically purged from the database (using …

---

## [Rails sites](https://www.ruby-forum.com/t/rails-sites/173156)

<div class="topic-metadata">

**Author:** [@sijo](https://www.ruby-forum.com/u/sijo)\
**Replies:** 10\
**Last updated:** [August 4, 2009, 5:03pm UTC](https://www.ruby-forum.com/t/rails-sites/173156 "2009-08-04T17:03:23Z")

</div>

Hi Could you please give list of some popular sites which handle very huge data than twitter and more faster than that? Thanks in advance Sijo

---

## [\[ANN\] Looking for real-life Rails devel. stories for a book](https://www.ruby-forum.com/t/ann-looking-for-real-life-rails-devel-stories-for-a-book/173177)

<div class="topic-metadata">

**Author:** [@David\_ASBlack](https://www.ruby-forum.com/u/David_ASBlack)\
**Replies:** 0\
**Last updated:** [August 4, 2009, 2:55pm UTC](https://www.ruby-forum.com/t/ann-looking-for-real-life-rails-devel-stories-for-a-book/173177 "2009-08-04T14:55:58Z")

</div>

Hi – I’m working on a new book called “Rails Choices”, for the Pragmatic Bookshelf. It’s a guide to thinking about the factors involved in making choices during Rails development: templating system, session storage m…

---

## [Refactoring and Improving my Rake Task](https://www.ruby-forum.com/t/refactoring-and-improving-my-rake-task/173092)

<div class="topic-metadata">

**Author:** [@bingobob](https://www.ruby-forum.com/u/bingobob)\
**Replies:** 6\
**Last updated:** [August 4, 2009, 2:50pm UTC](https://www.ruby-forum.com/t/refactoring-and-improving-my-rake-task/173092 "2009-08-04T14:50:27Z")

</div>

Here’s my rake task, I’m quite proud of it it’s all working, but it’s going to be really important to my rails app. Especially the fastercsv bit where I read in all the records and create activerecord objects - it’s n…

---

## [Help for Functional Testing?](https://www.ruby-forum.com/t/help-for-functional-testing/173160)

<div class="topic-metadata">

**Author:** [@karthik](https://www.ruby-forum.com/u/karthik)\
**Replies:** 12\
**Last updated:** [August 4, 2009, 1:17pm UTC](https://www.ruby-forum.com/t/help-for-functional-testing/173160 "2009-08-04T13:17:03Z")

</div>

Hi Below is my functional test code def test\_should\_create\_county assert\_difference(‘County.count’) do post :create, :county =\> {:name=\>“myname”,:description=\>“mydesc”,:region\_id=\>“3” } end assert\_redirected\_to co…

---

## [Webcam image capturing](https://www.ruby-forum.com/t/webcam-image-capturing/173118)

<div class="topic-metadata">

**Author:** [@sijo](https://www.ruby-forum.com/u/sijo)\
**Replies:** 5\
**Last updated:** [August 4, 2009, 12:38pm UTC](https://www.ruby-forum.com/t/webcam-image-capturing/173118 "2009-08-04T12:38:37Z")

</div>

Hi Could anybody please advice me to work with wecamera in Rails. What i want to do is to capture webcam images from a machine and send that data to a remote server there it needs to be processed. I have no idea of w…

---

## [I'm not sure what happened with my app - ActiveRecord Query](https://www.ruby-forum.com/t/im-not-sure-what-happened-with-my-app-activerecord-query/173139)

<div class="topic-metadata">

**Author:** [@elricstorm](https://www.ruby-forum.com/u/elricstorm)\
**Replies:** 5\
**Last updated:** [August 4, 2009, 12:36pm UTC](https://www.ruby-forum.com/t/im-not-sure-what-happened-with-my-app-activerecord-query/173139 "2009-08-04T12:36:57Z")

</div>

Everything was working perfectly. I ran a few tests this morning in development and found a few errors and corrected them. Another thing I did was clear out “old data” in 4 tables. 3 of these tables are now having t…

---

## [Object.collections.include? a](https://www.ruby-forum.com/t/object-collections-include-a/173129)

<div class="topic-metadata">

**Author:** [@mroths](https://www.ruby-forum.com/u/mroths)\
**Replies:** 4\
**Last updated:** [August 4, 2009, 11:35am UTC](https://www.ruby-forum.com/t/object-collections-include-a/173129 "2009-08-04T11:35:46Z")

</div>

My question is about object.collections (AssociationProxy). We all know that it pretends to be an Array, but in reality it’s actually an AssociationProxy. But, Why does it have its own db intensive include? method? E…

---

## [Problem in loading images from external site](https://www.ruby-forum.com/t/problem-in-loading-images-from-external-site/173167)

<div class="topic-metadata">

**Author:** [@tonymocha](https://www.ruby-forum.com/u/tonymocha)\
**Replies:** 1\
**Last updated:** [August 4, 2009, 11:31am UTC](https://www.ruby-forum.com/t/problem-in-loading-images-from-external-site/173167 "2009-08-04T11:31:40Z")

</div>

I am trying to load an external image from other website in my rails app. With following syntax: \<%= image\_tag(‘http://www.google.com/intl/en\_com/images/ logo\_plain.png’ %\> It only display the text, but not the image…

---

## [Sessions or Hidden fields?](https://www.ruby-forum.com/t/sessions-or-hidden-fields/173089)

<div class="topic-metadata">

**Author:** [@railslist](https://www.ruby-forum.com/u/railslist)\
**Replies:** 2\
**Last updated:** [August 4, 2009, 11:28am UTC](https://www.ruby-forum.com/t/sessions-or-hidden-fields/173089 "2009-08-04T11:28:45Z")

</div>

In my application I need to track user’s application state such as in which city or category he/she is in and based on that i need to perform a search. I have 3 options. Use cookies, use sessions or use hidden fields…

---

## [Performance hit from disabling template caching?](https://www.ruby-forum.com/t/performance-hit-from-disabling-template-caching/173173)

<div class="topic-metadata">

**Author:** [@nuby2ruby](https://www.ruby-forum.com/u/nuby2ruby)\
**Replies:** 0\
**Last updated:** [August 4, 2009, 11:04am UTC](https://www.ruby-forum.com/t/performance-hit-from-disabling-template-caching/173173 "2009-08-04T11:04:09Z")

</div>

Hi, How bad is the performance hit from disabling template caching? I’ve got an app which was upgraded to 2.2 and that seems to have turned on template caching - causing other problems. Presumably the app will just r…

---

## [Jasperreport and rails](https://www.ruby-forum.com/t/jasperreport-and-rails/173083)

<div class="topic-metadata">

**Author:** [@Zied](https://www.ruby-forum.com/u/Zied)\
**Replies:** 2\
**Last updated:** [August 4, 2009, 10:48am UTC](https://www.ruby-forum.com/t/jasperreport-and-rails/173083 "2009-08-04T10:48:21Z")

</div>

Hi everybody, I have a rails application and a report designed by iReport. I want to combine rails and jasper to obtain a pdf document… Sincerly, i followed the tutorial in http://wiki.rubyonrails.org/rails/pages/How…

---

## [Problem with parsing excel file using spreadsheet](https://www.ruby-forum.com/t/problem-with-parsing-excel-file-using-spreadsheet/173170)

<div class="topic-metadata">

**Author:** [@anu](https://www.ruby-forum.com/u/anu)\
**Replies:** 0\
**Last updated:** [August 4, 2009, 10:30am UTC](https://www.ruby-forum.com/t/problem-with-parsing-excel-file-using-spreadsheet/173170 "2009-08-04T10:30:08Z")

</div>

Hi, I am using ruby ruby 1.8.6 and spreadsheet (0.6.4). I am trying to oarse an excel file. My code is like : require 'rubygems' require 'spreadsheet' require 'parseexcel' equire 'parseexcel/parseexcel' require 'pars…

---

## [Mysql::Error: Illegal mix of collations (latin1\_swedish\_ci,IMPLICIT) and (utf8\_general\_ci,COERCIBLE)](https://www.ruby-forum.com/t/mysql-illegal-mix-of-collations-latin1-swedish-ci-implicit-and-utf8-general-ci-coercible/173169)

<div class="topic-metadata">

**Author:** [@HeChian\_H](https://www.ruby-forum.com/u/HeChian_H)\
**Replies:** 0\
**Last updated:** [August 4, 2009, 10:24am UTC](https://www.ruby-forum.com/t/mysql-illegal-mix-of-collations-latin1-swedish-ci-implicit-and-utf8-general-ci-coercible/173169 "2009-08-04T10:24:56Z")

</div>

Hi, I’ve got an error when I upload a record by iPhone with Chinese character. Processing ScoresController#create (for 123.204.56.133 at 2009-08-04 16:19:52) \[POST\] Parameters: {“score”=\>{“score”=\>“79.60”, “player\_na…

---

## [nicEdit image upload](https://www.ruby-forum.com/t/nicedit-image-upload/173163)

<div class="topic-metadata">

**Author:** [@Xiahong\_G](https://www.ruby-forum.com/u/Xiahong_G)\
**Replies:** 0\
**Last updated:** [August 4, 2009, 9:20am UTC](https://www.ruby-forum.com/t/nicedit-image-upload/173163 "2009-08-04T09:20:32Z")

</div>

Hi everyone I am new in ROR. Recently, I want to integrate nicEdit to my application. However, the default image upload functionality doesn’t support upload image to local server. How can I upload image to local serv…

---

## [Active Record Equivalent to SQL Aggregate Query?](https://www.ruby-forum.com/t/active-record-equivalent-to-sql-aggregate-query/173082)

<div class="topic-metadata">

**Author:** [@BrendanC](https://www.ruby-forum.com/u/BrendanC)\
**Replies:** 2\
**Last updated:** [August 4, 2009, 9:19am UTC](https://www.ruby-forum.com/t/active-record-equivalent-to-sql-aggregate-query/173082 "2009-08-04T09:19:22Z")

</div>

Hi, Just started learning active record and am wondering how to best retrieve data from multiple tables where an SQL aggregate query is involved. In the following example (from a medical app) I’m looking for the most …

---

## [Authlogic::How to access current user from within a cache sweeper?](https://www.ruby-forum.com/t/authlogic-how-to-access-current-user-from-within-a-cache-sweeper/173152)

<div class="topic-metadata">

**Author:** [@coolmenu](https://www.ruby-forum.com/u/coolmenu)\
**Replies:** 0\
**Last updated:** [August 4, 2009, 5:07am UTC](https://www.ruby-forum.com/t/authlogic-how-to-access-current-user-from-within-a-cache-sweeper/173152 "2009-08-04T05:07:41Z")

</div>

So I’m trying to follow along in Chad F.'s Rails Recipes (recipe #59, Keeping track of who did what) and I simply want to access the current user from within my cache sweeper. Normally you just reference @current\_use…

---

## [Correctly upgrading ruby on MS Windows](https://www.ruby-forum.com/t/correctly-upgrading-ruby-on-ms-windows/173147)

<div class="topic-metadata">

**Author:** [@rubynewbie](https://www.ruby-forum.com/u/rubynewbie)\
**Replies:** 0\
**Last updated:** [August 4, 2009, 3:16am UTC](https://www.ruby-forum.com/t/correctly-upgrading-ruby-on-ms-windows/173147 "2009-08-04T03:16:28Z")

</div>

Hi, I am looking for some guidance on the correct and/or most streamlined way to upgrade Ruby. Presently I am on Ruby version 1.8.6 patch level 111. I am looking to upgrade to version 1.8.6 patch level 287. When I t…

---

## [Rails Database Query](https://www.ruby-forum.com/t/rails-database-query/173140)

<div class="topic-metadata">

**Author:** [@nick](https://www.ruby-forum.com/u/nick)\
**Replies:** 2\
**Last updated:** [August 4, 2009, 1:17am UTC](https://www.ruby-forum.com/t/rails-database-query/173140 "2009-08-04T01:17:04Z")

</div>

Hi, I’m having trouble creating the right code to query the following: I have a table of “trails” and a table of “trailreports” “trails” has a “hasmany” relationship with “trailreports” “trailreports” has a field “tra…

---

## [Site redirection](https://www.ruby-forum.com/t/site-redirection/173053)

<div class="topic-metadata">

**Author:** [@fRAnKEnSTEin](https://www.ruby-forum.com/u/fRAnKEnSTEin)\
**Replies:** 7\
**Last updated:** [August 4, 2009, 1:16am UTC](https://www.ruby-forum.com/t/site-redirection/173053 "2009-08-04T01:16:29Z")

</div>

Hi there, I use this in my .htaccess for redirect URL mysite.cr to www.mysite.cr. It redirects fine. … … … RewriteEngine On RewriteCond %{HTTP\_HOST} ^mysite.cr \[NC\] RewriteRule ^(.\*)$ http://www.mysite.cr/$1 \[L,R…

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

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