# Rails

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

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

---

## [Link\_to popup divorced from controller?](https://www.ruby-forum.com/t/link-to-popup-divorced-from-controller/120303)

<div class="topic-metadata">

**Author:** [@yachtman](https://www.ruby-forum.com/u/yachtman)\
**Replies:** 6\
**Last updated:** [November 16, 2007, 5:08am UTC](https://www.ruby-forum.com/t/link-to-popup-divorced-from-controller/120303 "2007-11-16T05:08:34Z")

</div>

Here’s my case: Using a link\_to popup window to show a related help file of an element on a page. The problem: Window pops up perfectly, but refuses to carryover @instance variables in the controller that I referenc…

---

## [Do I pile up mutiple cruds in one controller?](https://www.ruby-forum.com/t/do-i-pile-up-mutiple-cruds-in-one-controller/120354)

<div class="topic-metadata">

**Author:** [@tomn](https://www.ruby-forum.com/u/tomn)\
**Replies:** 0\
**Last updated:** [November 16, 2007, 4:15am UTC](https://www.ruby-forum.com/t/do-i-pile-up-mutiple-cruds-in-one-controller/120354 "2007-11-16T04:15:09Z")

</div>

Being so new to programming, I really don’t have a clue to the proper convention to use. I have a schema where users will be storing personal data in a number of different models, some of them dependent on others and …

---

## [Making a hash from AR data](https://www.ruby-forum.com/t/making-a-hash-from-ar-data/120344)

<div class="topic-metadata">

**Author:** [@tomn](https://www.ruby-forum.com/u/tomn)\
**Replies:** 1\
**Last updated:** [November 16, 2007, 3:33am UTC](https://www.ruby-forum.com/t/making-a-hash-from-ar-data/120344 "2007-11-16T03:33:27Z")

</div>

I want to routinely make updated hashes in controller methods and use the data in views. Can I put this in a method and be done? my\_hash = {} widget\_holder = Cars.find(:all) my\_hash = widget\_holder.map { |widget| wi…

---

## [Problem in file uploading](https://www.ruby-forum.com/t/problem-in-file-uploading/120161)

<div class="topic-metadata">

**Author:** [@nad](https://www.ruby-forum.com/u/nad)\
**Replies:** 5\
**Last updated:** [November 16, 2007, 3:12am UTC](https://www.ruby-forum.com/t/problem-in-file-uploading/120161 "2007-11-16T03:12:50Z")

</div>

i wote a code to do file uploading with the hep given in documents in the net. but i came across some problems. in the View section the form that was wrote in th normal HTML was working 100% perfect and it uplodes th…

---

## [Vlad problems](https://www.ruby-forum.com/t/vlad-problems/116278)

<div class="topic-metadata">

**Author:** [@ivanstorck](https://www.ruby-forum.com/u/ivanstorck)\
**Replies:** 1\
**Last updated:** [November 16, 2007, 3:07am UTC](https://www.ruby-forum.com/t/vlad-problems/116278 "2007-11-16T03:07:31Z")

</div>

I am having trouble getting rake vlad:start to work… here is the output: ivan:04:39 PM:www2.sustainablewebsites.com\> rake vlad:start (in /Users/ivan/Sites/www2.sustainablewebsites.com) !!! PID file log/mongrel.8000.p…

---

## [Which javascript library?](https://www.ruby-forum.com/t/which-javascript-library/120350)

<div class="topic-metadata">

**Author:** [@snacktime](https://www.ruby-forum.com/u/snacktime)\
**Replies:** 0\
**Last updated:** [November 16, 2007, 1:23am UTC](https://www.ruby-forum.com/t/which-javascript-library/120350 "2007-11-16T01:23:32Z")

</div>

Once I got into doing more javascript work, the less I found myself using the rails javascript helpers and rjs. Most of the time I end up with half of the amount of code in less time not using the rails helpers and r…

---

## [How to retrive the number of articles in a given month?](https://www.ruby-forum.com/t/how-to-retrive-the-number-of-articles-in-a-given-month/120327)

<div class="topic-metadata">

**Author:** [@fcano](https://www.ruby-forum.com/u/fcano)\
**Replies:** 6\
**Last updated:** [November 16, 2007, 1:23am UTC](https://www.ruby-forum.com/t/how-to-retrive-the-number-of-articles-in-a-given-month/120327 "2007-11-16T01:23:32Z")

</div>

Hi! Sorry if this is more a SQL question than a Rails question. I have a model called Article that have an attribute called date. I want to retrive from the database the oldest article. And for each month since then …

---

## [How do you find relationships using has\_and\_belongs\_to\_many?](https://www.ruby-forum.com/t/how-do-you-find-relationships-using-has-and-belongs-to-many/120163)

<div class="topic-metadata">

**Author:** [@adistarmid](https://www.ruby-forum.com/u/adistarmid)\
**Replies:** 15\
**Last updated:** [November 16, 2007, 1:04am UTC](https://www.ruby-forum.com/t/how-do-you-find-relationships-using-has-and-belongs-to-many/120163 "2007-11-16T01:04:14Z")

</div>

I’m trying to list out the tasks that belongs to the logged-in user’s groups. For instance, I have the models: Task - belongs\_to :group Group - has\_and\_belongs\_to\_many :users My User model has both: has\_many :tasks …

---

## [Setting headers in sent\_file response](https://www.ruby-forum.com/t/setting-headers-in-sent-file-response/119469)

<div class="topic-metadata">

**Author:** [@eggie5](https://www.ruby-forum.com/u/eggie5)\
**Replies:** 2\
**Last updated:** [November 16, 2007, 12:43am UTC](https://www.ruby-forum.com/t/setting-headers-in-sent-file-response/119469 "2007-11-16T00:43:12Z")

</div>

I’m having trouble playing a video from my site on the iphone using send\_file. It seems that I’m missing the Accept-Ranges header in my response. How can I set the Accept-Ranges header in my send\_file response?

---

## [RESTful rails customized resource mapping concerning edit action and monolithic template](https://www.ruby-forum.com/t/restful-rails-customized-resource-mapping-concerning-edit-action-and-monolithic-template/120348)

<div class="topic-metadata">

**Author:** [@ptontiger](https://www.ruby-forum.com/u/ptontiger)\
**Replies:** 0\
**Last updated:** [November 16, 2007, 12:32am UTC](https://www.ruby-forum.com/t/restful-rails-customized-resource-mapping-concerning-edit-action-and-monolithic-template/120348 "2007-11-16T00:32:41Z")

</div>

Hi everyone, this is my first post. I’m reorganizing a rails app to use RESTful routes. I have a users controller that’s mapped RESTfully. Before the switch to REST I had three separate actions to display a form to e…

---

## [Using .find\_by\_sql for database/admin queries](https://www.ruby-forum.com/t/using-find-by-sql-for-database-admin-queries/120341)

<div class="topic-metadata">

**Author:** [@thabenksta](https://www.ruby-forum.com/u/thabenksta)\
**Replies:** 4\
**Last updated:** [November 15, 2007, 11:42pm UTC](https://www.ruby-forum.com/t/using-find-by-sql-for-database-admin-queries/120341 "2007-11-15T23:42:41Z")

</div>

I want to create an internal admin view to display the output of “show variables” from mysql. What’s the best approach do this? For example, I’m doing something like this: @variables = ActiveRecord::Base.find\_by\_sql “…

---

## [Acts\_as\_tree "soft destroy", ie. "move up" children](https://www.ruby-forum.com/t/acts-as-tree-soft-destroy-ie-move-up-children/120316)

<div class="topic-metadata">

**Author:** [@stedwick](https://www.ruby-forum.com/u/stedwick)\
**Replies:** 4\
**Last updated:** [November 15, 2007, 11:17pm UTC](https://www.ruby-forum.com/t/acts-as-tree-soft-destroy-ie-move-up-children/120316 "2007-11-15T23:17:11Z")

</div>

By default, when you destroy a parent node all of the children nodes are destroyed as well. Is there a way I can modify this so that when you destroy a parent node all the children nodes are simply “moved up” within t…

---

## [Habtm order\_by](https://www.ruby-forum.com/t/habtm-order-by/120343)

<div class="topic-metadata">

**Author:** [@flamingsole](https://www.ruby-forum.com/u/flamingsole)\
**Replies:** 0\
**Last updated:** [November 15, 2007, 11:12pm UTC](https://www.ruby-forum.com/t/habtm-order-by/120343 "2007-11-15T23:12:47Z")

</div>

Hello, Is it possible to order a result set by one of the values in an habtm relationship? If so, how can this be done? For example, I have a data set of providers. @levels = Level.find(:all) @pages, providers = pag…

---

## [Rails + Apache2 problem](https://www.ruby-forum.com/t/rails-apache2-problem/120333)

<div class="topic-metadata">

**Author:** [@paul](https://www.ruby-forum.com/u/paul)\
**Replies:** 4\
**Last updated:** [November 15, 2007, 11:07pm UTC](https://www.ruby-forum.com/t/rails-apache2-problem/120333 "2007-11-15T23:07:49Z")

</div>

Hello, I’m quite a noob, after days of work and suffer I managed to deploy my rails app to my server with capistrano 2. I don’t use mongrel or lighttpd, webrick is strong enough for my small projects ;\] my app is in…

---

## [Trap "We're sorry..." errors](https://www.ruby-forum.com/t/trap-were-sorry-errors/120336)

<div class="topic-metadata">

**Author:** [@zakifataya](https://www.ruby-forum.com/u/zakifataya)\
**Replies:** 2\
**Last updated:** [November 15, 2007, 10:39pm UTC](https://www.ruby-forum.com/t/trap-were-sorry-errors/120336 "2007-11-15T22:39:29Z")

</div>

In my production app, I occasionally get the “We’re sorry…” error screen. But in most (if not all) cases, there is no corresponding error in the logs. This makes it difficult to track down bugs. It seems that what’s h…

---

## [Rails intranet - in house server](https://www.ruby-forum.com/t/rails-intranet-in-house-server/117063)

<div class="topic-metadata">

**Author:** [@dgm](https://www.ruby-forum.com/u/dgm)\
**Replies:** 3\
**Last updated:** [November 15, 2007, 10:30pm UTC](https://www.ruby-forum.com/t/rails-intranet-in-house-server/117063 "2007-11-15T22:30:15Z")

</div>

I’m deploying a rails intranet and have never setup an in house rails server. I have only used mediatemple. Does anyone have any tips? The application is very small. It has a maximum of 6 users at a time and it is …

---

## [Embedding a Widget](https://www.ruby-forum.com/t/embedding-a-widget/120338)

<div class="topic-metadata">

**Author:** [@dishkuvek](https://www.ruby-forum.com/u/dishkuvek)\
**Replies:** 0\
**Last updated:** [November 15, 2007, 10:26pm UTC](https://www.ruby-forum.com/t/embedding-a-widget/120338 "2007-11-15T22:26:53Z")

</div>

I build this widget: http://flicks.mochafoo.com/widget is the temporary location for it at the moment, it might also be a little slow since I am hosting it on dreamhost. Anyhow, I built it using normal rails methods,…

---

## [Openbase Adapter](https://www.ruby-forum.com/t/openbase-adapter/120337)

<div class="topic-metadata">

**Author:** [@tktktk](https://www.ruby-forum.com/u/tktktk)\
**Replies:** 0\
**Last updated:** [November 15, 2007, 10:25pm UTC](https://www.ruby-forum.com/t/openbase-adapter/120337 "2007-11-15T22:25:08Z")

</div>

Hi all I’m new to rails and trying to get it work with our openbase database. I’ve downloaded the plugin and put it in the vendors plugin directory. in the environments file i worte require OpenBase. It wouldn’t accep…

---

## [Undefined AR class module for Marshal](https://www.ruby-forum.com/t/undefined-ar-class-module-for-marshal/110200)

<div class="topic-metadata">

**Author:** [@ericgoodwin](https://www.ruby-forum.com/u/ericgoodwin)\
**Replies:** 1\
**Last updated:** [November 15, 2007, 10:14pm UTC](https://www.ruby-forum.com/t/undefined-ar-class-module-for-marshal/110200 "2007-11-15T22:14:14Z")

</div>

When I do Marshal.load, and the data includes AR classes, it gives me an undefined class/module error along with the AR class name. If I require the model files right before calling Marshal.load, it will work fine. I…

---

## [Multiple saves within one controller method issues](https://www.ruby-forum.com/t/multiple-saves-within-one-controller-method-issues/120334)

<div class="topic-metadata">

**Author:** [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Replies:** 0\
**Last updated:** [November 15, 2007, 10:02pm UTC](https://www.ruby-forum.com/t/multiple-saves-within-one-controller-method-issues/120334 "2007-11-15T22:02:17Z")

</div>

I am having a little problem with relations between models when more than one is created within one action. I have a Member, User and Address class as defined by the schemas below: create\_table “addresses”, :force =\> …

---

## [Rails + Apache2 problem](https://www.ruby-forum.com/t/rails-apache2-problem/120331)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [November 15, 2007, 9:38pm UTC](https://www.ruby-forum.com/t/rails-apache2-problem/120331 "2007-11-15T21:38:51Z")

</div>

Hello, I’m quite a noob, after days of work and suffer I managed to deploy my rails app to my server with capistrano 2. I don’t use mongrel or lighttpd, webrick is strong enough for my small projects ;\] my app is in…

---

## [Get file content type?](https://www.ruby-forum.com/t/get-file-content-type/120265)

<div class="topic-metadata">

**Author:** [@jamal](https://www.ruby-forum.com/u/jamal)\
**Replies:** 4\
**Last updated:** [November 15, 2007, 9:38pm UTC](https://www.ruby-forum.com/t/get-file-content-type/120265 "2007-11-15T21:38:10Z")

</div>

Hi, I’m trying to get content\_type value for uploaded file, but it always return to me application/octet-stream even if it is video.avi or file.rb or any other music.mp3 is there anything special I need to do in my …

---

## [Legacy DB with multiple tables per model](https://www.ruby-forum.com/t/legacy-db-with-multiple-tables-per-model/120275)

<div class="topic-metadata">

**Author:** [@kimmoke](https://www.ruby-forum.com/u/kimmoke)\
**Replies:** 1\
**Last updated:** [November 15, 2007, 9:13pm UTC](https://www.ruby-forum.com/t/legacy-db-with-multiple-tables-per-model/120275 "2007-11-15T21:13:40Z")

</div>

I’m working with a large DB that is also being used by another application(s) so I really can’t change it. I’d like to wrap it in ActiveRecord (or DataMapper/OG/Other ORM) models but it’s quite a challenge because mod…

---

## [Add and remove try but missing concepts](https://www.ruby-forum.com/t/add-and-remove-try-but-missing-concepts/120250)

<div class="topic-metadata">

**Author:** [@tomn](https://www.ruby-forum.com/u/tomn)\
**Replies:** 4\
**Last updated:** [November 15, 2007, 9:03pm UTC](https://www.ruby-forum.com/t/add-and-remove-try-but-missing-concepts/120250 "2007-11-15T21:03:08Z")

</div>

I am spanking new to programming but managed to read a ruby book, did a few onlamp tutorials, read and followed along with the depot project on the Agile WebDfR, read and followed along the Oreily up and running book. …

---

## [Partial update](https://www.ruby-forum.com/t/partial-update/120268)

<div class="topic-metadata">

**Author:** [@vapor](https://www.ruby-forum.com/u/vapor)\
**Replies:** 3\
**Last updated:** [November 15, 2007, 8:41pm UTC](https://www.ruby-forum.com/t/partial-update/120268 "2007-11-15T20:41:00Z")

</div>

I have a partial on main page that displays current scores of game. The latest scores keep coming in database. I want to update that partial after every 5 seconds with values from db so that latest scores will be disp…

---

## [Posting a file to a controller action using wget](https://www.ruby-forum.com/t/posting-a-file-to-a-controller-action-using-wget/120328)

<div class="topic-metadata">

**Author:** [@emmanueloga](https://www.ruby-forum.com/u/emmanueloga)\
**Replies:** 0\
**Last updated:** [November 15, 2007, 8:12pm UTC](https://www.ruby-forum.com/t/posting-a-file-to-a-controller-action-using-wget/120328 "2007-11-15T20:12:24Z")

</div>

Hi. i have this runnig: class MainController \< ActionController::Base def load\_data end end From my linux box, i do: wget http://localhost/main/load\_data --post-file file\_name.txt Wich works great! the proble is, …

---

## [Passing parameters to private methods with before\_filter](https://www.ruby-forum.com/t/passing-parameters-to-private-methods-with-before-filter/120324)

<div class="topic-metadata">

**Author:** [@gete](https://www.ruby-forum.com/u/gete)\
**Replies:** 2\
**Last updated:** [November 15, 2007, 8:03pm UTC](https://www.ruby-forum.com/t/passing-parameters-to-private-methods-with-before-filter/120324 "2007-11-15T20:03:27Z")

</div>

Hello, I was wondering if anybody can show me how to pass parameters to a Private method with before\_filter. I’ve tried doing the proc blocked way with before\_filter {|c| c.private\_method(params)} …but this throws an …

---

## [Acts\_as\_conference tickets on sale tomorrow at 9am](https://www.ruby-forum.com/t/acts-as-conference-tickets-on-sale-tomorrow-at-9am/120326)

<div class="topic-metadata">

**Author:** [@flatekmonkey](https://www.ruby-forum.com/u/flatekmonkey)\
**Replies:** 0\
**Last updated:** [November 15, 2007, 7:58pm UTC](https://www.ruby-forum.com/t/acts-as-conference-tickets-on-sale-tomorrow-at-9am/120326 "2007-11-15T19:58:45Z")

</div>

Hey all, Registration for acts\_as\_conference goes live at 9am EST tomorrow morning. We will be updating the AAC site before then (http:// www.actsasconference.com) so you can learn about the charity session and all o…

---

## [Help Requested: Online resource for RJS](https://www.ruby-forum.com/t/help-requested-online-resource-for-rjs/120318)

<div class="topic-metadata">

**Author:** [@ByteSmith](https://www.ruby-forum.com/u/ByteSmith)\
**Replies:** 1\
**Last updated:** [November 15, 2007, 7:46pm UTC](https://www.ruby-forum.com/t/help-requested-online-resource-for-rjs/120318 "2007-11-15T19:46:26Z")

</div>

Hello all, I am new to RoR and Javascript. Please guide me to comprehensive learning for RJS. Thank you!

---

## [Mongrel\_rails\_service is not recognized command error](https://www.ruby-forum.com/t/mongrel-rails-service-is-not-recognized-command-error/120193)

<div class="topic-metadata">

**Author:** [@backz](https://www.ruby-forum.com/u/backz)\
**Replies:** 3\
**Last updated:** [November 15, 2007, 7:06pm UTC](https://www.ruby-forum.com/t/mongrel-rails-service-is-not-recognized-command-error/120193 "2007-11-15T19:06:34Z")

</div>

Hi, I am trying to deploy RoR web app on windows server by using apache http server and mongrel (by Brian H.). Mongrel runs ok, but when I was trying to install mongrel as a windows service, I couldn’t execute ‘mongr…

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

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