# Rails

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

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

---

## [Inline CSS in forms, for real?](https://www.ruby-forum.com/t/inline-css-in-forms-for-real/185839)

<div class="topic-metadata">

**Author:** [@cult\_hero](https://www.ruby-forum.com/u/cult_hero)\
**Replies:** 4\
**Last updated:** [March 28, 2010, 4:09am UTC](https://www.ruby-forum.com/t/inline-css-in-forms-for-real/185839 "2010-03-28T04:09:15Z")

</div>

So, I use a form helper and it works nicely. Then I look at the code and I find myself somewhat annoyed: I obviously have no issue with hidden inputs, but WHY OH WHY are they inside a completely unnecessary div with …

---

## [Nested attributes with required protected attributes](https://www.ruby-forum.com/t/nested-attributes-with-required-protected-attributes/185814)

<div class="topic-metadata">

**Author:** [@g0nzo](https://www.ruby-forum.com/u/g0nzo)\
**Replies:** 2\
**Last updated:** [March 27, 2010, 9:30pm UTC](https://www.ruby-forum.com/t/nested-attributes-with-required-protected-attributes/185814 "2010-03-27T21:30:17Z")

</div>

Hi, I’ve got 3 models: Comment, Venue and User. Comment has many :venues and belongs to :user. Venue belongs to :user as well. When adding a comment, user should be able to attach a venue to it. In Venue model “user\_…

---

## [Shorter Rails 3 routes](https://www.ruby-forum.com/t/shorter-rails-3-routes/185861)

<div class="topic-metadata">

**Author:** [@judge](https://www.ruby-forum.com/u/judge)\
**Replies:** 2\
**Last updated:** [March 27, 2010, 7:54pm UTC](https://www.ruby-forum.com/t/shorter-rails-3-routes/185861 "2010-03-27T19:54:14Z")

</div>

Hi, I have a small blog application, and I would like to shorten its routes. Here they are: Blog::Application.routes.draw do resources :categories do resources :articles do resources :comments end end A rake rou…

---

## [Persistent objects](https://www.ruby-forum.com/t/persistent-objects/185857)

<div class="topic-metadata">

**Author:** [@makire](https://www.ruby-forum.com/u/makire)\
**Replies:** 5\
**Last updated:** [March 27, 2010, 7:14pm UTC](https://www.ruby-forum.com/t/persistent-objects/185857 "2010-03-27T19:14:29Z")

</div>

Is there a way to create an object that is a singleton (one instance per user session) and is kept as long as the user session exists? The object handles a connection to a remote server that is very heavy to establish…

---

## [Rake argument error](https://www.ruby-forum.com/t/rake-argument-error/185834)

<div class="topic-metadata">

**Author:** [@raghu\_muni](https://www.ruby-forum.com/u/raghu_muni)\
**Replies:** 6\
**Last updated:** [March 27, 2010, 6:02pm UTC](https://www.ruby-forum.com/t/rake-argument-error/185834 "2010-03-27T18:02:30Z")

</div>

Hi, I’m having a problem loading a sample data with simple rake command. rake db:fixtures:load When I run the above command,I get the following error $rake db:fixtures:load (in /home/raghu/www/photos) rake aborted! …

---

## [How to get client machine's IP address?](https://www.ruby-forum.com/t/how-to-get-client-machines-ip-address/185859)

<div class="topic-metadata">

**Author:** [@rutisyrz](https://www.ruby-forum.com/u/rutisyrz)\
**Replies:** 1\
**Last updated:** [March 27, 2010, 5:15pm UTC](https://www.ruby-forum.com/t/how-to-get-client-machines-ip-address/185859 "2010-03-27T17:15:06Z")

</div>

dear all, I need a method that can get me an IP address of client’s machine Thanking you…

---

## [How to read a xml file?](https://www.ruby-forum.com/t/how-to-read-a-xml-file/185832)

<div class="topic-metadata">

**Author:** [@jorgegetafe](https://www.ruby-forum.com/u/jorgegetafe)\
**Replies:** 2\
**Last updated:** [March 27, 2010, 4:01pm UTC](https://www.ruby-forum.com/t/how-to-read-a-xml-file/185832 "2010-03-27T16:01:23Z")

</div>

How to read a xml file? I have this XML source: \<?xml version="1.0" encoding="UTF-8" standalone="yes"?\> Gabriel Molina Alfredo Vargas #36 Jorge Mendoza Alguna de por ahi #12 ------…

---

## [Displaying contnet](https://www.ruby-forum.com/t/displaying-contnet/185852)

<div class="topic-metadata">

**Author:** [@mailtorajuit](https://www.ruby-forum.com/u/mailtorajuit)\
**Replies:** 2\
**Last updated:** [March 27, 2010, 1:15pm UTC](https://www.ruby-forum.com/t/displaying-contnet/185852 "2010-03-27T13:15:12Z")

</div>

hi all, i am using text filed to store the database using textarea. i have entered the data line by line. while displaying also i want to display the content line by line but when i gave like this record.methodname i…

---

## [Caching fragement](https://www.ruby-forum.com/t/caching-fragement/185848)

<div class="topic-metadata">

**Author:** [@mailtorajuit](https://www.ruby-forum.com/u/mailtorajuit)\
**Replies:** 1\
**Last updated:** [March 27, 2010, 1:15pm UTC](https://www.ruby-forum.com/t/caching-fragement/185848 "2010-03-27T13:15:12Z")

</div>

HI all, in my application i have index action. i called cache for this index by using cache\_page :index and in index.erb page i called another partila page using and cached the fragment using \<%cache “1” do%\> \<%@s…

---

## [Timezone issue with legacy data stored in Eastern time](https://www.ruby-forum.com/t/timezone-issue-with-legacy-data-stored-in-eastern-time/185837)

<div class="topic-metadata">

**Author:** [@J\_Graham](https://www.ruby-forum.com/u/J_Graham)\
**Replies:** 4\
**Last updated:** [March 27, 2010, 12:48pm UTC](https://www.ruby-forum.com/t/timezone-issue-with-legacy-data-stored-in-eastern-time/185837 "2010-03-27T12:48:51Z")

</div>

Hello, I’ve Googled and searched for this for many hours now and couldn’t find an answer although I did find a lot about timezones and rails. Specifically I’m attaching a basic Rails CRUD frontend onto a legacy datab…

---

## [\[Rails3\] Rails 3 app in one file](https://www.ruby-forum.com/t/rails3-rails-3-app-in-one-file/185851)

<div class="topic-metadata">

**Author:** [@Drogomir](https://www.ruby-forum.com/u/Drogomir)\
**Replies:** 0\
**Last updated:** [March 27, 2010, 10:51am UTC](https://www.ruby-forum.com/t/rails3-rails-3-app-in-one-file/185851 "2010-03-27T10:51:13Z")

</div>

Hi, I’ve tried to run config.ru file provided by Yehuda K.: omg.rb · GitHub After running it and pointing browser to localhost:3000/foo I get “RoutingError: uninitialized contant FooController” error. Have anyone el…

---

## [Custom validation](https://www.ruby-forum.com/t/custom-validation/185785)

<div class="topic-metadata">

**Author:** [@migrate](https://www.ruby-forum.com/u/migrate)\
**Replies:** 4\
**Last updated:** [March 27, 2010, 8:27am UTC](https://www.ruby-forum.com/t/custom-validation/185785 "2010-03-27T08:27:15Z")

</div>

Hi all, I need to call validation methods from outside the models. This is a workflow application so the models don’t have validation methods declared in it. Example: class Step \< ActiveRecord::Base end def Wrk \< …

---

## [File upload error(can't convert Tempfile into String)](https://www.ruby-forum.com/t/file-upload-error-cant-convert-tempfile-into-string/185792)

<div class="topic-metadata">

**Author:** [@murfhy](https://www.ruby-forum.com/u/murfhy)\
**Replies:** 2\
**Last updated:** [March 27, 2010, 4:46am UTC](https://www.ruby-forum.com/t/file-upload-error-cant-convert-tempfile-into-string/185792 "2010-03-27T04:46:04Z")

</div>

i tried a method to implementa file uploader by using amethod below this is ma controlller method to upload def save\_imports Contactslist.save(params\[:list\]) render :text =\> “File uploaded successfully” th…

---

## [Installing ActionMailer from Rails 3?](https://www.ruby-forum.com/t/installing-actionmailer-from-rails-3/185793)

<div class="topic-metadata">

**Author:** [@trib4lmaniac](https://www.ruby-forum.com/u/trib4lmaniac)\
**Replies:** 6\
**Last updated:** [March 27, 2010, 4:36am UTC](https://www.ruby-forum.com/t/installing-actionmailer-from-rails-3/185793 "2010-03-27T04:36:42Z")

</div>

Hi I’d like to use the new ActionMailer that comes with Rails 3, for a email reminder program I am writing. I am pretty new to Ruby, and would like to know how I can gem install this pre-release version, so I can st…

---

## [Deploying my rails app to GoDaddy](https://www.ruby-forum.com/t/deploying-my-rails-app-to-godaddy/185476)

<div class="topic-metadata">

**Author:** [@Butterson](https://www.ruby-forum.com/u/Butterson)\
**Replies:** 4\
**Last updated:** [March 27, 2010, 4:12am UTC](https://www.ruby-forum.com/t/deploying-my-rails-app-to-godaddy/185476 "2010-03-27T04:12:07Z")

</div>

So I’ve written my first real-world RoR app and I’m now getting ready to deploy it. Unfortunately, my client decided to use GoDaddy as the hosting provider and based on what I’ve seen so far from the web, it’s not rea…

---

## [NoMethodError (private method \`chomp' called for nil:NilClas](https://www.ruby-forum.com/t/nomethoderror-private-method-chomp-called-for-nil-nilclas/185783)

<div class="topic-metadata">

**Author:** [@jefflin23](https://www.ruby-forum.com/u/jefflin23)\
**Replies:** 2\
**Last updated:** [March 27, 2010, 3:51am UTC](https://www.ruby-forum.com/t/nomethoderror-private-method-chomp-called-for-nil-nilclas/185783 "2010-03-27T03:51:18Z")

</div>

Hi: I am using Rails 2.3.5 with paperclip, mime-types and uploadify. So far the application is working in development environment. But when I switched to the production environment, it produced the following error. N…

---

## [Declaring migration bankruptcy](https://www.ruby-forum.com/t/declaring-migration-bankruptcy/185843)

<div class="topic-metadata">

**Author:** [@drewB](https://www.ruby-forum.com/u/drewB)\
**Replies:** 0\
**Last updated:** [March 27, 2010, 1:04am UTC](https://www.ruby-forum.com/t/declaring-migration-bankruptcy/185843 "2010-03-27T01:04:49Z")

</div>

I joined a project recently that has 2 years worth of migrations. It is about to go into production and I am wondering if we should consider clearing out most of the history. A poor decision made early on has caused…

---

## [How to calculate per\_page value based on browser window size for will\_paginate](https://www.ruby-forum.com/t/how-to-calculate-per-page-value-based-on-browser-window-size-for-will-paginate/185826)

<div class="topic-metadata">

**Author:** [@RVRoadie](https://www.ruby-forum.com/u/RVRoadie)\
**Replies:** 4\
**Last updated:** [March 27, 2010, 12:06am UTC](https://www.ruby-forum.com/t/how-to-calculate-per-page-value-based-on-browser-window-size-for-will-paginate/185826 "2010-03-27T00:06:18Z")

</div>

def self.per\_page 20 end Any suggestion on how I can calculate this value base on the size of the browser window? Thanks

---

## [ActiveRecord setting empty strings to nil for Numeric attributes](https://www.ruby-forum.com/t/activerecord-setting-empty-strings-to-nil-for-numeric-attributes/185836)

<div class="topic-metadata">

**Author:** [@Chris\_N](https://www.ruby-forum.com/u/Chris_N)\
**Replies:** 0\
**Last updated:** [March 26, 2010, 9:59pm UTC](https://www.ruby-forum.com/t/activerecord-setting-empty-strings-to-nil-for-numeric-attributes/185836 "2010-03-26T21:59:16Z")

</div>

I have an ActiveRecord model with several float attributes that takes input directly from the user, and they are all set to not null in the DB. When any of these attributes are set to an empty string (""), their valu…

---

## [Grouping and acts\_as\_tree](https://www.ruby-forum.com/t/grouping-and-acts-as-tree/185686)

<div class="topic-metadata">

**Author:** [@tomtt](https://www.ruby-forum.com/u/tomtt)\
**Replies:** 4\
**Last updated:** [March 26, 2010, 8:55pm UTC](https://www.ruby-forum.com/t/grouping-and-acts-as-tree/185686 "2010-03-26T20:55:28Z")

</div>

hi, im using acts\_as\_tree and im not sure on how to group find-result. x = find.almost\_all \<% for y in @x.ancestors.reverse %\> \<%= link\_to h(y.title), page %\> \> \<% end %\> gives me a nice “breadcrum”. but how is …

---

## [Ruby on Rails job opportunities](https://www.ruby-forum.com/t/ruby-on-rails-job-opportunities/185835)

<div class="topic-metadata">

**Author:** [@sid137](https://www.ruby-forum.com/u/sid137)\
**Replies:** 0\
**Last updated:** [March 26, 2010, 8:52pm UTC](https://www.ruby-forum.com/t/ruby-on-rails-job-opportunities/185835 "2010-03-26T20:52:17Z")

</div>

I am an IT recruiter with TEKsystems. I’m working with a client here in New Orleans that is looking to bring on several entry level Ruby on Rails developers. I’m looking for anyone that is a Ruby novice all the way up…

---

## [Many-to-many relationship to table itself through other table](https://www.ruby-forum.com/t/many-to-many-relationship-to-table-itself-through-other-table/185820)

<div class="topic-metadata">

**Author:** [@mxrgus\_pxrt](https://www.ruby-forum.com/u/mxrgus_pxrt)\
**Replies:** 2\
**Last updated:** [March 26, 2010, 8:15pm UTC](https://www.ruby-forum.com/t/many-to-many-relationship-to-table-itself-through-other-table/185820 "2010-03-26T20:15:34Z")

</div>

Hello, I would like to have many-to-many relationship to object itself with additional info, but I did not find any info on that, could someone suggest something? Example: Service – name – description ServiceConn…

---

## [Multilingual Email Within UserObserver?](https://www.ruby-forum.com/t/multilingual-email-within-userobserver/185680)

<div class="topic-metadata">

**Author:** [@hugues](https://www.ruby-forum.com/u/hugues)\
**Replies:** 2\
**Last updated:** [March 26, 2010, 8:06pm UTC](https://www.ruby-forum.com/t/multilingual-email-within-userobserver/185680 "2010-03-26T20:06:44Z")

</div>

Hello, I have a beta testing program for a multilingual webapp using globalite. People register on the website in english or in french. I use a UserObserver from acts\_as\_authenticated plugin that send an email with a…

---

## [Ruby 1.9 loading rails is slow](https://www.ruby-forum.com/t/ruby-1-9-loading-rails-is-slow/184953)

<div class="topic-metadata">

**Author:** [@andrius\_c](https://www.ruby-forum.com/u/andrius_c)\
**Replies:** 5\
**Last updated:** [March 26, 2010, 8:05pm UTC](https://www.ruby-forum.com/t/ruby-1-9-loading-rails-is-slow/184953 "2010-03-26T20:05:42Z")

</div>

Hello all, I’ve recently started a project and I wanted to give ruby 1.9 + rails a chance. Well everything works great, so far haven’t encountered any gem that didn’t work (so anyone out there you should give it a try…

---

## [How to get last url?](https://www.ruby-forum.com/t/how-to-get-last-url/185827)

<div class="topic-metadata">

**Author:** [@rutisyrz](https://www.ruby-forum.com/u/rutisyrz)\
**Replies:** 2\
**Last updated:** [March 26, 2010, 8:04pm UTC](https://www.ruby-forum.com/t/how-to-get-last-url/185827 "2010-03-26T20:04:28Z")

</div>

Dear all, How can I get lastly accessed url on my current page. i.e. user is on ‘Posts’ page & now if user wants to add new post for that user needs to login first… for that user 'll be redirected to login page…Now a…

---

## [Using attachment\_fu in existing user model with edit/update](https://www.ruby-forum.com/t/using-attachment-fu-in-existing-user-model-with-edit-update/147182)

<div class="topic-metadata">

**Author:** [@bagadoughnuts](https://www.ruby-forum.com/u/bagadoughnuts)\
**Replies:** 7\
**Last updated:** [March 26, 2010, 7:39pm UTC](https://www.ruby-forum.com/t/using-attachment-fu-in-existing-user-model-with-edit-update/147182 "2010-03-26T19:39:11Z")

</div>

Hi all, I currently have a working development site with the user model already setup. I did however hold out on user images/avatars until the end and am now thinking it wasn’t such a good idea. I’m using attachment\_…

---

## [Having Problems with collection\_sellect](https://www.ruby-forum.com/t/having-problems-with-collection-sellect/185823)

<div class="topic-metadata">

**Author:** [@Gordons](https://www.ruby-forum.com/u/Gordons)\
**Replies:** 1\
**Last updated:** [March 26, 2010, 7:07pm UTC](https://www.ruby-forum.com/t/having-problems-with-collection-sellect/185823 "2010-03-26T19:07:09Z")

</div>

Hello everybody, I am new to Ruby on Rails, while going through one of the tutorials, i found this program which I’ve been finding very difficult to run and see the output as it has been throwing many errors. Please c…

---

## [Active Record relations](https://www.ruby-forum.com/t/active-record-relations/185729)

<div class="topic-metadata">

**Author:** [@mailtorajuit](https://www.ruby-forum.com/u/mailtorajuit)\
**Replies:** 1\
**Last updated:** [March 26, 2010, 6:36pm UTC](https://www.ruby-forum.com/t/active-record-relations/185729 "2010-03-26T18:36:08Z")

</div>

HI all in my application , i have 2 tables subjects and teachers. the relation is one to many. i have to display the subjects first and when i click on the subjects i have to display the teachers. and i have to add …

---

## [For loops](https://www.ruby-forum.com/t/for-loops/185808)

<div class="topic-metadata">

**Author:** [@woodsy0130](https://www.ruby-forum.com/u/woodsy0130)\
**Replies:** 2\
**Last updated:** [March 26, 2010, 5:44pm UTC](https://www.ruby-forum.com/t/for-loops/185808 "2010-03-26T17:44:38Z")

</div>

Could someone please give me a brief explanation on for loops please Thanks Dale

---

## [Exporting table data as a html file](https://www.ruby-forum.com/t/exporting-table-data-as-a-html-file/185821)

<div class="topic-metadata">

**Author:** [@gautam](https://www.ruby-forum.com/u/gautam)\
**Replies:** 0\
**Last updated:** [March 26, 2010, 5:44pm UTC](https://www.ruby-forum.com/t/exporting-table-data-as-a-html-file/185821 "2010-03-26T17:44:02Z")

</div>

I have a model named “notice.rb” with a corresponding controller “notices\_controller.rb” and my db table “notices” contains two text fields - title and body. I want to save this table data as an html file in a externa…

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

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