# Rails

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

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

---

## [Eager loading of Associations](https://www.ruby-forum.com/t/eager-loading-of-associations/143977)

<div class="topic-metadata">

**Author:** [@elioncho](https://www.ruby-forum.com/u/elioncho)\
**Replies:** 0\
**Last updated:** [July 24, 2008, 10:36am UTC](https://www.ruby-forum.com/t/eager-loading-of-associations/143977 "2008-07-24T10:36:53Z")

</div>

Hello I have the following code which looks for all the comments on a specified blog post and neighborhood. comment\_activity = PostComment.find(:all, :select =\> “post\_comments.\*”, :joins =\> “INNER JOIN posts ON po…

---

## [Association without id in table](https://www.ruby-forum.com/t/association-without-id-in-table/143966)

<div class="topic-metadata">

**Author:** [@subhadip](https://www.ruby-forum.com/u/subhadip)\
**Replies:** 1\
**Last updated:** [July 24, 2008, 10:18am UTC](https://www.ruby-forum.com/t/association-without-id-in-table/143966 "2008-07-24T10:18:43Z")

</div>

can we use association(has\_one,has\_many,belongs\_to) without using id as primary key.

---

## [External htm -\> record not found](https://www.ruby-forum.com/t/external-htm-record-not-found/143972)

<div class="topic-metadata">

**Author:** [@monsterag](https://www.ruby-forum.com/u/monsterag)\
**Replies:** 1\
**Last updated:** [July 24, 2008, 9:09am UTC](https://www.ruby-forum.com/t/external-htm-record-not-found/143972 "2008-07-24T09:09:59Z")

</div>

Hello, i want to execute php in a iframe-window for uploading files without sending the whole form. i placed the "uploader.htm" in the public folder, but i get the error: "Active Record:: Recordnotfound in AuftragsC…

---

## [Accessing session values in rails methods](https://www.ruby-forum.com/t/accessing-session-values-in-rails-methods/143970)

<div class="topic-metadata">

**Author:** [@manohar\_amrutkar](https://www.ruby-forum.com/u/manohar_amrutkar)\
**Replies:** 0\
**Last updated:** [July 24, 2008, 8:53am UTC](https://www.ruby-forum.com/t/accessing-session-values-in-rails-methods/143970 "2008-07-24T08:53:51Z")

</div>

Hello All, This is something new for me. Please help me to resolve the following problem. I am using Flex in my application of course Flex in rails. I am using Flex in UI for widgets, where it calls a rails method wh…

---

## [Word document in html format using Ruby on rails](https://www.ruby-forum.com/t/word-document-in-html-format-using-ruby-on-rails/143968)

<div class="topic-metadata">

**Author:** [@sujith](https://www.ruby-forum.com/u/sujith)\
**Replies:** 0\
**Last updated:** [July 24, 2008, 8:41am UTC](https://www.ruby-forum.com/t/word-document-in-html-format-using-ruby-on-rails/143968 "2008-07-24T08:41:02Z")

</div>

i am uploading one word document now i want that word document to view as a html format in my browser in Ruby on rails pls help me out on this issue

---

## [How can determine if an item has a value or not?](https://www.ruby-forum.com/t/how-can-determine-if-an-item-has-a-value-or-not/143926)

<div class="topic-metadata">

**Author:** [@monsterag](https://www.ruby-forum.com/u/monsterag)\
**Replies:** 6\
**Last updated:** [July 24, 2008, 8:34am UTC](https://www.ruby-forum.com/t/how-can-determine-if-an-item-has-a-value-or-not/143926 "2008-07-24T08:34:46Z")

</div>

When i execute the followin code i get the following message: “comparison of Time with String failed” \<% @auftrag.attributes.each do |key, item| %\> \<%if item \> “” %\> Key: \<%= key %\>: Item: \<%= item %\> \<%end%\> \<%en…

---

## [Collection\_select](https://www.ruby-forum.com/t/collection-select/143964)

<div class="topic-metadata">

**Author:** [@subhadip](https://www.ruby-forum.com/u/subhadip)\
**Replies:** 0\
**Last updated:** [July 24, 2008, 7:47am UTC](https://www.ruby-forum.com/t/collection-select/143964 "2008-07-24T07:47:23Z")

</div>

Hi, i am using one collection select in my application, and i am trying to set the value which i am selected,but i unable to fixed it.It always refer to first value.Here is my code,what is wrong in this code, and wh…

---

## [Respond\_to weirdness](https://www.ruby-forum.com/t/respond-to-weirdness/143931)

<div class="topic-metadata">

**Author:** [@Tim\_McIntyre](https://www.ruby-forum.com/u/Tim_McIntyre)\
**Replies:** 1\
**Last updated:** [July 24, 2008, 7:46am UTC](https://www.ruby-forum.com/t/respond-to-weirdness/143931 "2008-07-24T07:46:10Z")

</div>

Hey all, Here is the suspect code, description follows. environment: Mime::Type.register “text/csv”, :csv controller: def sales\_report … … respond\_to do |f| f.csv { send\_data(csvify(@sales), :filename =\> “sales…

---

## [Render :template render:partial](https://www.ruby-forum.com/t/render-template-render-partial/143963)

<div class="topic-metadata">

**Author:** [@sijo](https://www.ruby-forum.com/u/sijo)\
**Replies:** 0\
**Last updated:** [July 24, 2008, 7:34am UTC](https://www.ruby-forum.com/t/render-template-render-partial/143963 "2008-07-24T07:34:32Z")

</div>

Hi In the main file i have to include a code portion (just one table with an image\_tag…) as \<%=image\_tag("/images/menu/big.png", {:class=\>"noborder"})%\> User Profile This has to be included in severa…

---

## [Id attribute partial problem in tab](https://www.ruby-forum.com/t/id-attribute-partial-problem-in-tab/143912)

<div class="topic-metadata">

**Author:** [@quest4](https://www.ruby-forum.com/u/quest4)\
**Replies:** 1\
**Last updated:** [July 24, 2008, 7:29am UTC](https://www.ruby-forum.com/t/id-attribute-partial-problem-in-tab/143912 "2008-07-24T07:29:00Z")

</div>

I have used JavaScript Tabifier automatically create an html css tabs interface in my rails view. My problem is when I place a partial in the second tab I lose access to the global @model.id attribute for reference pur…

---

## [Getting Foreign Key to work!](https://www.ruby-forum.com/t/getting-foreign-key-to-work/143960)

<div class="topic-metadata">

**Author:** [@curtdbz](https://www.ruby-forum.com/u/curtdbz)\
**Replies:** 0\
**Last updated:** [July 24, 2008, 7:18am UTC](https://www.ruby-forum.com/t/getting-foreign-key-to-work/143960 "2008-07-24T07:18:02Z")

</div>

Okay. So I have this simple site, which includes Recipes and then Comments. I want ppl to be able to comment on the recipes, and so I made comments have a recipe\_id as it’s foreign key etc. I’m not that much of a no…

---

## [Respond\_to wrong in ie -- html requests seen as text/javascript](https://www.ruby-forum.com/t/respond-to-wrong-in-ie-html-requests-seen-as-text-javascript/143958)

<div class="topic-metadata">

**Author:** [@jdevine](https://www.ruby-forum.com/u/jdevine)\
**Replies:** 1\
**Last updated:** [July 24, 2008, 6:45am UTC](https://www.ruby-forum.com/t/respond-to-wrong-in-ie-html-requests-seen-as-text-javascript/143958 "2008-07-24T06:45:09Z")

</div>

Anyone come across this problem? It may be something I’m doing somewhere, but my page renders fine in Firefox, and returns a syntax error in Internet explorer. Very strange, I thought, then I traced it to the fact tha…

---

## [Running command line scripts from Rails](https://www.ruby-forum.com/t/running-command-line-scripts-from-rails/143894)

<div class="topic-metadata">

**Author:** [@jeannibee](https://www.ruby-forum.com/u/jeannibee)\
**Replies:** 2\
**Last updated:** [July 24, 2008, 5:52am UTC](https://www.ruby-forum.com/t/running-command-line-scripts-from-rails/143894 "2008-07-24T05:52:46Z")

</div>

Hi I have an application that makes use of some tools that are provided on the installed system. (statistical model compilation). How should I do this gracefully w/ Rails. In the past (Java equivalent) I have relied …

---

## [Tutorial for digital distribution](https://www.ruby-forum.com/t/tutorial-for-digital-distribution/143674)

<div class="topic-metadata">

**Author:** [@nek4life](https://www.ruby-forum.com/u/nek4life)\
**Replies:** 1\
**Last updated:** [July 24, 2008, 5:49am UTC](https://www.ruby-forum.com/t/tutorial-for-digital-distribution/143674 "2008-07-24T05:49:01Z")

</div>

Can anyone direct me to a digital distribution tutorial? I’m trying to create a store that can handle digital products. Any Ideas? I’m mostly interested in the secure delivery of the goods.

---

## [Cannot figure out how to handle multi checkbox](https://www.ruby-forum.com/t/cannot-figure-out-how-to-handle-multi-checkbox/143847)

<div class="topic-metadata">

**Author:** [@naijaguy](https://www.ruby-forum.com/u/naijaguy)\
**Replies:** 5\
**Last updated:** [July 24, 2008, 4:16am UTC](https://www.ruby-forum.com/t/cannot-figure-out-how-to-handle-multi-checkbox/143847 "2008-07-24T04:16:40Z")

</div>

I have a checkbox that is not tied to a model. Basically, here’s what the beginning looks like in the view: \<% for entrant in @entrants %\> \<tr class="\<%= cycle(“even”, “odd”) %\>" \> \<%= check\_box (“to\_check”, entran…

---

## [Wsdl not generated when using "expects"](https://www.ruby-forum.com/t/wsdl-not-generated-when-using-expects/143954)

<div class="topic-metadata">

**Author:** [@rain\_tmc](https://www.ruby-forum.com/u/rain_tmc)\
**Replies:** 0\
**Last updated:** [July 24, 2008, 4:16am UTC](https://www.ruby-forum.com/t/wsdl-not-generated-when-using-expects/143954 "2008-07-24T04:16:39Z")

</div>

I have a class that extends ActionWebService and is able to generate a wsdl (http://localhost/mycontroller/service.wsdl) when api\_method doesn’t have any parameters. As soon as I add/define a parameter I get: Templat…

---

## [Question about a rails behaviour](https://www.ruby-forum.com/t/question-about-a-rails-behaviour/143909)

<div class="topic-metadata">

**Author:** [@elioncho](https://www.ruby-forum.com/u/elioncho)\
**Replies:** 1\
**Last updated:** [July 24, 2008, 4:16am UTC](https://www.ruby-forum.com/t/question-about-a-rails-behaviour/143909 "2008-07-24T04:16:39Z")

</div>

Hello, my doubt is the following. The line of code below fetches all the comments made for an specific event: @comments = @event.event\_comments.paginate(:all, :include =\> \[:comment\_by\], :order =\> "created\_at DESC", :pa…

---

## [ActiveRecord failure, or something else?](https://www.ruby-forum.com/t/activerecord-failure-or-something-else/143948)

<div class="topic-metadata">

**Author:** [@binary011010](https://www.ruby-forum.com/u/binary011010)\
**Replies:** 0\
**Last updated:** [July 24, 2008, 3:10am UTC](https://www.ruby-forum.com/t/activerecord-failure-or-something-else/143948 "2008-07-24T03:10:23Z")

</div>

I’ll try not to complicate this more than need be. I have been working on a rails project for several months. Not long ago, I decided to upgrade to rails 2.1.0 and ever since then I’ve been getting an error while taki…

---

## [Is there any way to get the hour/minute value of a DateTime object?](https://www.ruby-forum.com/t/is-there-any-way-to-get-the-hour-minute-value-of-a-datetime-object/143945)

<div class="topic-metadata">

**Author:** [@paradise](https://www.ruby-forum.com/u/paradise)\
**Replies:** 1\
**Last updated:** [July 24, 2008, 2:55am UTC](https://www.ruby-forum.com/t/is-there-any-way-to-get-the-hour-minute-value-of-a-datetime-object/143945 "2008-07-24T02:55:18Z")

</div>

This may be a stupid question, but I have been exploring the methods of DateTime and Time and am unable to find anything that extracts just the minute or the hour. Am I going to have to write my own functions to do t…

---

## [Rails on Apache: FAIL](https://www.ruby-forum.com/t/rails-on-apache-fail/143820)

<div class="topic-metadata">

**Author:** [@km01](https://www.ruby-forum.com/u/km01)\
**Replies:** 5\
**Last updated:** [July 24, 2008, 12:49am UTC](https://www.ruby-forum.com/t/rails-on-apache-fail/143820 "2008-07-24T00:49:30Z")

</div>

Hey guys, I am getting the following while trying to run a rails project someone else wrote under apache: \[Tue Jul 22 19:50:33 2008\] \[notice\] Apache/2.2.9 (Unix) mod\_ruby/1.2.6 Ruby/1.8.6(2008-03-03) configured – res…

---

## [Database.yml encoding is utf8, yet connections aren't](https://www.ruby-forum.com/t/database-yml-encoding-is-utf8-yet-connections-arent/143940)

<div class="topic-metadata">

**Author:** [@dutone](https://www.ruby-forum.com/u/dutone)\
**Replies:** 0\
**Last updated:** [July 24, 2008, 12:46am UTC](https://www.ruby-forum.com/t/database-yml-encoding-is-utf8-yet-connections-arent/143940 "2008-07-24T00:46:39Z")

</div>

$ cat config/database.yml common: &common adapter: mysql username: whaaaaaaaaa! host: 127.0.0.1 encoding: utf8 development: database: delivery\_log\_dev \<\<: \*common $ ./script/console Loading development environm…

---

## [Is this where you could use polymorphic associations?](https://www.ruby-forum.com/t/is-this-where-you-could-use-polymorphic-associations/143939)

<div class="topic-metadata">

**Author:** [@elliotchyba](https://www.ruby-forum.com/u/elliotchyba)\
**Replies:** 0\
**Last updated:** [July 24, 2008, 12:31am UTC](https://www.ruby-forum.com/t/is-this-where-you-could-use-polymorphic-associations/143939 "2008-07-24T00:31:28Z")

</div>

Could somebody help me wrap my head around this one? Tables: users id username password Tables: friends id user\_id share\_id Tables: books id user\_id title author Users get to store as many books as they wan…

---

## [Beginning find / validation questions](https://www.ruby-forum.com/t/beginning-find-validation-questions/143914)

<div class="topic-metadata">

**Author:** [@rsanheim](https://www.ruby-forum.com/u/rsanheim)\
**Replies:** 2\
**Last updated:** [July 23, 2008, 11:47pm UTC](https://www.ruby-forum.com/t/beginning-find-validation-questions/143914 "2008-07-23T23:47:49Z")

</div>

I’ve been toying over these two problems, but I’m hoping that someone here might be able to provide a better idea. Every user has their own id (current\_user.id) and can add people to a list with firstname and lastna…

---

## [I have the same problem](https://www.ruby-forum.com/t/i-have-the-same-problem/143936)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [July 23, 2008, 11:46pm UTC](https://www.ruby-forum.com/t/i-have-the-same-problem/143936 "2008-07-23T23:46:35Z")

</div>

IRB: irb(main):001:0\> require ‘RMagick’ =\> true script/console of my app: Loading development environment (Rails 2.1.0) require ‘RMagick’ =\> \[\] include Magick =\> Object image = Magick::ImageList.new() =\> \[\] …

---

## [Localization Issue](https://www.ruby-forum.com/t/localization-issue/143935)

<div class="topic-metadata">

**Author:** [@gus](https://www.ruby-forum.com/u/gus)\
**Replies:** 0\
**Last updated:** [July 23, 2008, 11:46pm UTC](https://www.ruby-forum.com/t/localization-issue/143935 "2008-07-23T23:46:34Z")

</div>

Hello, I wish someone could help me with this… i´ve been trying to figure out for some days now but have not come up with a solution. I am building an application (which is intended to be used in spanish speaking cou…

---

## [Create data model from existing database](https://www.ruby-forum.com/t/create-data-model-from-existing-database/143934)

<div class="topic-metadata">

**Author:** [@Ronn\_Ross](https://www.ruby-forum.com/u/Ronn_Ross)\
**Replies:** 0\
**Last updated:** [July 23, 2008, 11:46pm UTC](https://www.ruby-forum.com/t/create-data-model-from-existing-database/143934 "2008-07-23T23:46:33Z")

</div>

How do I go about creating a data model from an existing database? Does rails have a script to automate the process?

---

## [Rules behind datamodels](https://www.ruby-forum.com/t/rules-behind-datamodels/143933)

<div class="topic-metadata">

**Author:** [@Ronn](https://www.ruby-forum.com/u/Ronn)\
**Replies:** 0\
**Last updated:** [July 23, 2008, 11:45pm UTC](https://www.ruby-forum.com/t/rules-behind-datamodels/143933 "2008-07-23T23:45:56Z")

</div>

Hello, I have been looking for a tutorial explains the rules behind creating datamodels in rails. I know the basic table are plural, but are there any rules concerning fields? Can someone please give me more informat…

---

## [Best-practice: :symbol || 'string\_literal'?](https://www.ruby-forum.com/t/best-practice-symbol-string-literal/143921)

<div class="topic-metadata">

**Author:** [@A\_Love\_of\_Surf](https://www.ruby-forum.com/u/A_Love_of_Surf)\
**Replies:** 2\
**Last updated:** [July 23, 2008, 11:08pm UTC](https://www.ruby-forum.com/t/best-practice-symbol-string-literal/143921 "2008-07-23T23:08:25Z")

</div>

I was researching an earlier issue with rails and I stumbled across a document which mentioned something that sounded to me like “Due to a recent shift in the mind-set of the community, it is frowned upon to use a str…

---

## [2.0.2 migrations seem totally broken](https://www.ruby-forum.com/t/2-0-2-migrations-seem-totally-broken/143825)

<div class="topic-metadata">

**Author:** [@metrix](https://www.ruby-forum.com/u/metrix)\
**Replies:** 2\
**Last updated:** [July 23, 2008, 10:44pm UTC](https://www.ruby-forum.com/t/2-0-2-migrations-seem-totally-broken/143825 "2008-07-23T22:44:54Z")

</div>

I have a Rails app running under 2.0.2. I created the app with 2.1, but eventually ran into some bugs and set the app to run at 2.0.2, and commented out the 2.1 initializers. I’ve created and dropped the database a fe…

---

## [Rails Rewrite rule (on mod\_rails)](https://www.ruby-forum.com/t/rails-rewrite-rule-on-mod-rails/143904)

<div class="topic-metadata">

**Author:** [@MEK](https://www.ruby-forum.com/u/MEK)\
**Replies:** 1\
**Last updated:** [July 23, 2008, 10:29pm UTC](https://www.ruby-forum.com/t/rails-rewrite-rule-on-mod-rails/143904 "2008-07-23T22:29:46Z")

</div>

Hello, I’m running fine my application on the dev server with apache2 and mod\_rails, but on the production server I have a strange issue… it seems like something is wrong with httpd.conf of .htacces… the dev server i…

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

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