# Rails

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

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

---

## [Searching for an existant entry in the Model](https://www.ruby-forum.com/t/searching-for-an-existant-entry-in-the-model/143403)

<div class="topic-metadata">

**Author:** [@jturney](https://www.ruby-forum.com/u/jturney)\
**Replies:** 3\
**Last updated:** [July 18, 2008, 9:46pm UTC](https://www.ruby-forum.com/t/searching-for-an-existant-entry-in-the-model/143403 "2008-07-18T21:46:35Z")

</div>

Hi, I have a form for two models, a Requirement has\_many Posts @requirement = Requirement.new(params\[:requirement\]) @post = @requirement.posts.build(params\[:post\]) That’s what I have so far to save the requirement. I c…

---

## [Serialize not working as expected. Am I doing it wrong?](https://www.ruby-forum.com/t/serialize-not-working-as-expected-am-i-doing-it-wrong/143462)

<div class="topic-metadata">

**Author:** [@Jeremy\_SAuzigog](https://www.ruby-forum.com/u/Jeremy_SAuzigog)\
**Replies:** 0\
**Last updated:** [July 18, 2008, 9:44pm UTC](https://www.ruby-forum.com/t/serialize-not-working-as-expected-am-i-doing-it-wrong/143462 "2008-07-18T21:44:22Z")

</div>

I reported the bug here: http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/647-serialize-d-array-not-unserializing-properly But the replies are to the tone of “it’s not a bug”. Serialize isn’t working…

---

## [Uknown ActiveRecord method](https://www.ruby-forum.com/t/uknown-activerecord-method/143447)

<div class="topic-metadata">

**Author:** [@jturney](https://www.ruby-forum.com/u/jturney)\
**Replies:** 1\
**Last updated:** [July 18, 2008, 9:22pm UTC](https://www.ruby-forum.com/t/uknown-activerecord-method/143447 "2008-07-18T21:22:08Z")

</div>

NoMethodError in Auth userController#new\_requirement undefined method \`find\_by\_id’ for #Class:0x4628d34 Method in application controller: User.find\_by\_id(session\[:user\_id\]) id is one of the columns of my users table… …

---

## [What does the ||= operator mean?](https://www.ruby-forum.com/t/what-does-the-operator-mean/143459)

<div class="topic-metadata">

**Author:** [@christoph](https://www.ruby-forum.com/u/christoph)\
**Replies:** 3\
**Last updated:** [July 18, 2008, 9:20pm UTC](https://www.ruby-forum.com/t/what-does-the-operator-mean/143459 "2008-07-18T21:20:23Z")

</div>

Hi all, I hope it’s ok that I ask this question here, I don’t wanted to subscribe to two other lists. If I have more questions regarding ruby itself I will do this. I’ve seen the ||= operator several times in codes, …

---

## [Link\_to\_function to remove a \<div\> in both IE and FF](https://www.ruby-forum.com/t/link-to-function-to-remove-a-div-in-both-ie-and-ff/143458)

<div class="topic-metadata">

**Author:** [@rpardee](https://www.ruby-forum.com/u/rpardee)\
**Replies:** 1\
**Last updated:** [July 18, 2008, 9:02pm UTC](https://www.ruby-forum.com/t/link-to-function-to-remove-a-div-in-both-ie-and-ff/143458 "2008-07-18T21:02:14Z")

</div>

Hey All, I’ve got a partial \_research\_areas.html.erb, which has a link\_to\_function call for removing the div defined by the partial, like so: ========================= \<% fields\_for\_research\_area(research\_areas)…

---

## [Creating multiple objects at a time, the RESTful way?](https://www.ruby-forum.com/t/creating-multiple-objects-at-a-time-the-restful-way/143457)

<div class="topic-metadata">

**Author:** [@M\_Graff](https://www.ruby-forum.com/u/M_Graff)\
**Replies:** 0\
**Last updated:** [July 18, 2008, 8:25pm UTC](https://www.ruby-forum.com/t/creating-multiple-objects-at-a-time-the-restful-way/143457 "2008-07-18T20:25:51Z")

</div>

Most resources seem to be singletons – that is, the “create” action only creates one object. However, for a log parsing application I am writing, I would like to issue one large HTTP request to generate multiple obje…

---

## [View Inheritance Population, and another question](https://www.ruby-forum.com/t/view-inheritance-population-and-another-question/143454)

<div class="topic-metadata">

**Author:** [@aawilson](https://www.ruby-forum.com/u/aawilson)\
**Replies:** 2\
**Last updated:** [July 18, 2008, 8:23pm UTC](https://www.ruby-forum.com/t/view-inheritance-population-and-another-question/143454 "2008-07-18T20:23:47Z")

</div>

I’m trying to create a select box that chooses from a list of options determined by class hierarchy. To be specific, I have a Field model that has been subclassed into several types of Fields. The user chooses a typ…

---

## [Create an array from a hash that includes key and value](https://www.ruby-forum.com/t/create-an-array-from-a-hash-that-includes-key-and-value/143440)

<div class="topic-metadata">

**Author:** [@paco.onrails](https://www.ruby-forum.com/u/paco.onrails)\
**Replies:** 4\
**Last updated:** [July 18, 2008, 7:56pm UTC](https://www.ruby-forum.com/t/create-an-array-from-a-hash-that-includes-key-and-value/143440 "2008-07-18T19:56:33Z")

</div>

Hello there, I have the hash: @hash = {“a”=\>“1”, “b”=\>“2”, “c”=\>“3”} And I need to create an array: @array = \[ \[‘a’,‘1’\],\[‘b’,‘2’\],\[‘c’,‘3’\] \] How do I do that? Paco Reyes

---

## [Cant auto-start Ruby on lighthttpd](https://www.ruby-forum.com/t/cant-auto-start-ruby-on-lighthttpd/143346)

<div class="topic-metadata">

**Author:** [@adithecool](https://www.ruby-forum.com/u/adithecool)\
**Replies:** 3\
**Last updated:** [July 18, 2008, 6:22pm UTC](https://www.ruby-forum.com/t/cant-auto-start-ruby-on-lighthttpd/143346 "2008-07-18T18:22:18Z")

</div>

Hi, I have installed ruby and redmine on my server running lighthttpd. I wanted to run ruby on a different port (3000). The problem is I cant get it to auto-start, I have to manually type in: ruby server/script -e pr…

---

## [Passing array to the email body using ActionMailer](https://www.ruby-forum.com/t/passing-array-to-the-email-body-using-actionmailer/143389)

<div class="topic-metadata">

**Author:** [@cobra050](https://www.ruby-forum.com/u/cobra050)\
**Replies:** 2\
**Last updated:** [July 18, 2008, 6:21pm UTC](https://www.ruby-forum.com/t/passing-array-to-the-email-body-using-actionmailer/143389 "2008-07-18T18:21:03Z")

</div>

Hi, all I am new to actionmailer. I am writing a script that sends emails contains lots of file names. So the email will look like: hi, filename1 filename2 filename3 . . . filenameN So I want to pass an arra…

---

## [Import predefined data to database using YAML](https://www.ruby-forum.com/t/import-predefined-data-to-database-using-yaml/143443)

<div class="topic-metadata">

**Author:** [@Sven\_Clement](https://www.ruby-forum.com/u/Sven_Clement)\
**Replies:** 0\
**Last updated:** [July 18, 2008, 5:25pm UTC](https://www.ruby-forum.com/t/import-predefined-data-to-database-using-yaml/143443 "2008-07-18T17:25:28Z")

</div>

Hello, I would need a way to import some data which I already have in the YAML format to be written to the database. This is used especially to preload the database with some standard data like postal codes and diffe…

---

## [OpenX ad server API with Ruby](https://www.ruby-forum.com/t/openx-ad-server-api-with-ruby/143444)

<div class="topic-metadata">

**Author:** [@Arlen\_Coupland](https://www.ruby-forum.com/u/Arlen_Coupland)\
**Replies:** 0\
**Last updated:** [July 18, 2008, 5:23pm UTC](https://www.ruby-forum.com/t/openx-ad-server-api-with-ruby/143444 "2008-07-18T17:23:08Z")

</div>

Hi all, I’m from OpenX, an open source ad server for PHP. The upcoming 2.6 release includes a new developer API which lets you control users & banner inventory, grab statistics, and generate invocation tags. One com…

---

## [Hi , Ruby on Rails Developer](https://www.ruby-forum.com/t/hi-ruby-on-rails-developer/143441)

<div class="topic-metadata">

**Author:** [@AmitO](https://www.ruby-forum.com/u/AmitO)\
**Replies:** 0\
**Last updated:** [July 18, 2008, 5:21pm UTC](https://www.ruby-forum.com/t/hi-ruby-on-rails-developer/143441 "2008-07-18T17:21:58Z")

</div>

Good Morning ! Please allow me to introduce myself, I am Amit Dubey representing Pyramid Consulting INC. I have taken over the responsibility of Sales Manager. I am having a Job position with direct client for Ruby o…

---

## [What is the MySQL app used in the 15 minute weblog video](https://www.ruby-forum.com/t/what-is-the-mysql-app-used-in-the-15-minute-weblog-video/196746)

<div class="topic-metadata">

**Author:** [@josh](https://www.ruby-forum.com/u/josh)\
**Replies:** 2\
**Last updated:** [July 18, 2008, 5:15pm UTC](https://www.ruby-forum.com/t/what-is-the-mysql-app-used-in-the-15-minute-weblog-video/196746 "2008-07-18T17:15:31Z")

</div>

On the “Create a Weblog in 15 Minutes” screencast on the Ruby On Rails site http://media.rubyonrails.org/video/rails\_take2\_with\_sound.mov There is a really nice looking MySQL gui interface app. Can anybody tell me wh…

---

## [Security weakness in ActiveResource?](https://www.ruby-forum.com/t/security-weakness-in-activeresource/143163)

<div class="topic-metadata">

**Author:** [@duco](https://www.ruby-forum.com/u/duco)\
**Replies:** 1\
**Last updated:** [July 18, 2008, 4:49pm UTC](https://www.ruby-forum.com/t/security-weakness-in-activeresource/143163 "2008-07-18T16:49:05Z")

</div>

For a project, we are considering a little-less-than-trivial HTTPS setup for communication between components. Amongst other things, we need RoR to consume a REST interface implemented by a Java servlet. For reasons b…

---

## [Show Validation Errors after redirecting](https://www.ruby-forum.com/t/show-validation-errors-after-redirecting/143419)

<div class="topic-metadata">

**Author:** [@christoph](https://www.ruby-forum.com/u/christoph)\
**Replies:** 4\
**Last updated:** [July 18, 2008, 4:31pm UTC](https://www.ruby-forum.com/t/show-validation-errors-after-redirecting/143419 "2008-07-18T16:31:48Z")

</div>

Hi all, I’ve got another newbie question. I have Article and Comment models/ controllers, and users can comment articles, this should be pretty clear :slight\_smile: Here is some code: class CommentsController \< Appl…

---

## [ActiveRecord: SQL IN operator](https://www.ruby-forum.com/t/activerecord-sql-in-operator/143431)

<div class="topic-metadata">

**Author:** [@ratcheer](https://www.ruby-forum.com/u/ratcheer)\
**Replies:** 2\
**Last updated:** [July 18, 2008, 4:27pm UTC](https://www.ruby-forum.com/t/activerecord-sql-in-operator/143431 "2008-07-18T16:27:07Z")

</div>

I want to use an array in the :conditions of an ActiveRecord Find so that a SQL IN statement is created. However, I also want to specify a greater than condition on a timestamp column too. From the Docs: An array ma…

---

## [Anyone know anything about using mod\_deflate gzipping with Rails?](https://www.ruby-forum.com/t/anyone-know-anything-about-using-mod-deflate-gzipping-with-rails/143263)

<div class="topic-metadata">

**Author:** [@sev2](https://www.ruby-forum.com/u/sev2)\
**Replies:** 2\
**Last updated:** [July 18, 2008, 4:15pm UTC](https://www.ruby-forum.com/t/anyone-know-anything-about-using-mod-deflate-gzipping-with-rails/143263 "2008-07-18T16:15:25Z")

</div>

Anyone know anything about using mod\_deflate gzipping with Rails? I’ve got it enabled in our .htaccess but it doesn’t seem to handle gzip anything going through Rails. Any ideas? Thanks

---

## [Shebang Warning in Locomotive](https://www.ruby-forum.com/t/shebang-warning-in-locomotive/143142)

<div class="topic-metadata">

**Author:** [@Marie-Anne](https://www.ruby-forum.com/u/Marie-Anne)\
**Replies:** 3\
**Last updated:** [July 18, 2008, 2:36pm UTC](https://www.ruby-forum.com/t/shebang-warning-in-locomotive/143142 "2008-07-18T14:36:13Z")

</div>

I’ve been working with Locomotive (2.0.8) for quite some time without any problems. Today I tried to create a new project and I got the following error: ‘Warning! The Ruby interpreter referenced this Rails applicatio…

---

## [Print Layout](https://www.ruby-forum.com/t/print-layout/143429)

<div class="topic-metadata">

**Author:** [@se\_pavel](https://www.ruby-forum.com/u/se_pavel)\
**Replies:** 1\
**Last updated:** [July 18, 2008, 2:29pm UTC](https://www.ruby-forum.com/t/print-layout/143429 "2008-07-18T14:29:11Z")

</div>

Hello All, We have developed the following code in application.rb def determine\_layout if !params\[:layout\].blank? and params\[:layout\] == “print” @layout = “print” else @layout = “public” @layout = “admin” if param…

---

## [2 views, 1 action](https://www.ruby-forum.com/t/2-views-1-action/143337)

<div class="topic-metadata">

**Author:** [@Tarscher](https://www.ruby-forum.com/u/Tarscher)\
**Replies:** 5\
**Last updated:** [July 18, 2008, 1:04pm UTC](https://www.ruby-forum.com/t/2-views-1-action/143337 "2008-07-18T13:04:50Z")

</div>

hi all, I want to have an index view for photoalbums both for an admin and for the users. Does Rails provide a better way to do something like site.com/albums?admin=1 =\> shows admin index and site.com/albums =\> shows…

---

## [Gettext change language temporarily?](https://www.ruby-forum.com/t/gettext-change-language-temporarily/143420)

<div class="topic-metadata">

**Author:** [@marlor](https://www.ruby-forum.com/u/marlor)\
**Replies:** 1\
**Last updated:** [July 18, 2008, 11:40am UTC](https://www.ruby-forum.com/t/gettext-change-language-temporarily/143420 "2008-07-18T11:40:22Z")

</div>

Hello all, Here is the scenario: The site is multilingual as expected using gettext and that works fine. The problem is that when I select a language (E.g German) on the site and I want to send a semi static EMail (u…

---

## [Email not getting deleted on server \[Net::POP3\]](https://www.ruby-forum.com/t/email-not-getting-deleted-on-server-net-pop3/143423)

<div class="topic-metadata">

**Author:** [@AtsoK](https://www.ruby-forum.com/u/AtsoK)\
**Replies:** 0\
**Last updated:** [July 18, 2008, 11:32am UTC](https://www.ruby-forum.com/t/email-not-getting-deleted-on-server-net-pop3/143423 "2008-07-18T11:32:52Z")

</div>

Hello, I created a rake task to fetch email from Gmail’s server using Net::POP3. Everything works, except the messages are not getting deleted. Here’s my code: task :receive =\> :environment do require ‘net/pop’ pop…

---

## [Web crawler - spider and Amazon Web Servces (AWS)](https://www.ruby-forum.com/t/web-crawler-spider-and-amazon-web-servces-aws/143424)

<div class="topic-metadata">

**Author:** [@Abel](https://www.ruby-forum.com/u/Abel)\
**Replies:** 0\
**Last updated:** [July 18, 2008, 11:28am UTC](https://www.ruby-forum.com/t/web-crawler-spider-and-amazon-web-servces-aws/143424 "2008-07-18T11:28:45Z")

</div>

I need to create a web crawler and the closest thing to a tutorial I’ve found so far is this article: http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1182 wich I think I found via RubyInside or so…

---

## [Override message for validations](https://www.ruby-forum.com/t/override-message-for-validations/143425)

<div class="topic-metadata">

**Author:** [@Tarscher](https://www.ruby-forum.com/u/Tarscher)\
**Replies:** 0\
**Last updated:** [July 18, 2008, 11:27am UTC](https://www.ruby-forum.com/t/override-message-for-validations/143425 "2008-07-18T11:27:35Z")

</div>

Hi all, Is it possible to override the default rails messages (:message =\> ) for validations (validates\_presence\_of :first\_name, :last\_name, :email, :message =\> “you moron!”) application wide without changing the rai…

---

## [Documenting web services](https://www.ruby-forum.com/t/documenting-web-services/143422)

<div class="topic-metadata">

**Author:** [@Nicholas\_W](https://www.ruby-forum.com/u/Nicholas_W)\
**Replies:** 0\
**Last updated:** [July 18, 2008, 11:25am UTC](https://www.ruby-forum.com/t/documenting-web-services/143422 "2008-07-18T11:25:50Z")

</div>

What is the preferred way to document a web service ? I don’t like RDoc because it documents the whole project, so basically what I need is documenting just a small subset of it. What do you people suggest ? ngw

---

## [Mysql query](https://www.ruby-forum.com/t/mysql-query/143414)

<div class="topic-metadata">

**Author:** [@mrbless](https://www.ruby-forum.com/u/mrbless)\
**Replies:** 2\
**Last updated:** [July 18, 2008, 11:18am UTC](https://www.ruby-forum.com/t/mysql-query/143414 "2008-07-18T11:18:47Z")

</div>

Hi Everybody I have a table called mail which is as follows: id user\_id message\_id conversation\_id created\_at == ===== ========= =========== ================= 22 2 12 …

---

## [Using API Keys with REST](https://www.ruby-forum.com/t/using-api-keys-with-rest/143333)

<div class="topic-metadata">

**Author:** [@Mark\_ASRichman](https://www.ruby-forum.com/u/Mark_ASRichman)\
**Replies:** 3\
**Last updated:** [July 18, 2008, 10:50am UTC](https://www.ruby-forum.com/t/using-api-keys-with-rest/143333 "2008-07-18T10:50:40Z")

</div>

What is the best way to restrict use of the xml format by using an API key?

---

## [File upload](https://www.ruby-forum.com/t/file-upload/143418)

<div class="topic-metadata">

**Author:** [@jaiganez](https://www.ruby-forum.com/u/jaiganez)\
**Replies:** 0\
**Last updated:** [July 18, 2008, 10:36am UTC](https://www.ruby-forum.com/t/file-upload/143418 "2008-07-18T10:36:17Z")

</div>

i cant able to insert filename into database…pl;s help my model.rb class Mobile \< ActiveRecord::Base validates\_presence\_of:image validates\_presence\_of:brand def mobile=(picture\_field) self.image = picture\_field\[‘i…

---

## [Make name on link\_to\_remote change](https://www.ruby-forum.com/t/make-name-on-link-to-remote-change/143417)

<div class="topic-metadata">

**Author:** [@elioncho](https://www.ruby-forum.com/u/elioncho)\
**Replies:** 0\
**Last updated:** [July 18, 2008, 10:30am UTC](https://www.ruby-forum.com/t/make-name-on-link-to-remote-change/143417 "2008-07-18T10:30:40Z")

</div>

Hello, I have the following link\_to\_remote code that calls the going method. It works right but I want that after the call the name “Not going!” changes to “I am going!”. Whats the easiest way to do this? I have a go…

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

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