# Rails

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

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

---

## [Agile book #3](https://www.ruby-forum.com/t/agile-book-3/170456)

<div class="topic-metadata">

**Author:** [@Jedrin](https://www.ruby-forum.com/u/Jedrin)\
**Replies:** 1\
**Last updated:** [June 17, 2009, 9:17pm UTC](https://www.ruby-forum.com/t/agile-book-3/170456 "2009-06-17T21:17:19Z")

</div>

I’ve got books 1 and 2 and am wondering if I should get book 3 or not …

---

## [Controller subfolders and routing](https://www.ruby-forum.com/t/controller-subfolders-and-routing/170248)

<div class="topic-metadata">

**Author:** [@zambezi](https://www.ruby-forum.com/u/zambezi)\
**Replies:** 10\
**Last updated:** [June 17, 2009, 7:46pm UTC](https://www.ruby-forum.com/t/controller-subfolders-and-routing/170248 "2009-06-17T19:46:22Z")

</div>

Greetings folks, I’m looking for some confirmation before I go further astray. I decided to anticipate future growth and rather than use a flat controller directory (app/controllers ) without subfolders , I would try…

---

## [Transfering information among view and action](https://www.ruby-forum.com/t/transfering-information-among-view-and-action/170438)

<div class="topic-metadata">

**Author:** [@moya](https://www.ruby-forum.com/u/moya)\
**Replies:** 2\
**Last updated:** [June 17, 2009, 7:27pm UTC](https://www.ruby-forum.com/t/transfering-information-among-view-and-action/170438 "2009-06-17T19:27:57Z")

</div>

hi every one . i am a newbie in rails . please help me with this question i have a controller named home\_page and one action inside it named index . in view part of this controller for index action i have a login box …

---

## [Url\_for and rake routes differences](https://www.ruby-forum.com/t/url-for-and-rake-routes-differences/170448)

<div class="topic-metadata">

**Author:** [@diarmuid](https://www.ruby-forum.com/u/diarmuid)\
**Replies:** 1\
**Last updated:** [June 17, 2009, 7:26pm UTC](https://www.ruby-forum.com/t/url-for-and-rake-routes-differences/170448 "2009-06-17T19:26:24Z")

</div>

I am caching and expiring pages/actions/fragments in my code and I’ve come across a really frustrating problem In my routes I have prefixed all controllers with the :locale. This works well for the most part. When I c…

---

## [Role\_requirement question](https://www.ruby-forum.com/t/role-requirement-question/165400)

<div class="topic-metadata">

**Author:** [@elliottg](https://www.ruby-forum.com/u/elliottg)\
**Replies:** 10\
**Last updated:** [June 17, 2009, 7:13pm UTC](https://www.ruby-forum.com/t/role-requirement-question/165400 "2009-06-17T19:13:56Z")

</div>

I am using restful\_authentication in combination with role\_requirment. At the beginning of the controllers that I want to have login control over, I include require\_role “user” require\_role “admin” For instance. If …

---

## [HABTM relationships in views](https://www.ruby-forum.com/t/habtm-relationships-in-views/196971)

<div class="topic-metadata">

**Author:** [@hugues](https://www.ruby-forum.com/u/hugues)\
**Replies:** 5\
**Last updated:** [June 17, 2009, 7:07pm UTC](https://www.ruby-forum.com/t/habtm-relationships-in-views/196971 "2009-06-17T19:07:02Z")

</div>

Hi everyone. I’m currently working on a bodybuilding supplement Website which have 3 models : Stack : has\_and\_belongs\_to\_many :products Product : has\_and\_belongs\_to\_many :stacks has\_and\_belongs\_to\_many :ingredient…

---

## [Modify values after update/create](https://www.ruby-forum.com/t/modify-values-after-update-create/170450)

<div class="topic-metadata">

**Author:** [@jdunneuk](https://www.ruby-forum.com/u/jdunneuk)\
**Replies:** 0\
**Last updated:** [June 17, 2009, 7:04pm UTC](https://www.ruby-forum.com/t/modify-values-after-update-create/170450 "2009-06-17T19:04:47Z")

</div>

Hi Guys, I’m playing with nested attributes (accepts\_nested\_attributes\_for). There are two models: Location Event (Fields: title, at\_date, is\_booked, …) Locations can have multiple events, and the events can be adde…

---

## [Max function in ruby](https://www.ruby-forum.com/t/max-function-in-ruby/170444)

<div class="topic-metadata">

**Author:** [@Developer\_In\_London](https://www.ruby-forum.com/u/Developer_In_London)\
**Replies:** 2\
**Last updated:** [June 17, 2009, 6:06pm UTC](https://www.ruby-forum.com/t/max-function-in-ruby/170444 "2009-06-17T18:06:02Z")

</div>

is there a max function in ruby? eg max(number1, number2) thanks nayeem

---

## [Multiple simultaneous drag-and-drop item sâ€¦?](https://www.ruby-forum.com/t/multiple-simultaneous-drag-and-drop-item-sa/170445)

<div class="topic-metadata">

**Author:** [@dezrtdude](https://www.ruby-forum.com/u/dezrtdude)\
**Replies:** 0\
**Last updated:** [June 17, 2009, 5:54pm UTC](https://www.ruby-forum.com/t/multiple-simultaneous-drag-and-drop-item-sa/170445 "2009-06-17T17:54:53Z")

</div>

Hi All, I’m looking for a mechanism in Rails by which to facilitate multiple drag-and-drop items simultaneously. Basically I want to select multiple and drag. Obviously I’d prefer to stick with standard HTML items …

---

## [Blog Screencast Questions](https://www.ruby-forum.com/t/blog-screencast-questions/170295)

<div class="topic-metadata">

**Author:** [@djames](https://www.ruby-forum.com/u/djames)\
**Replies:** 11\
**Last updated:** [June 17, 2009, 5:46pm UTC](https://www.ruby-forum.com/t/blog-screencast-questions/170295 "2009-06-17T17:46:34Z")

</div>

In the blog screencast the commentator creates two model classes, ‘Post’ and ‘Comment’. Note that both of these model classes are singular. However, when he creates the association he says in the Post model ‘has\_man…

---

## [Graphs over time, where to store data and how to?](https://www.ruby-forum.com/t/graphs-over-time-where-to-store-data-and-how-to/170343)

<div class="topic-metadata">

**Author:** [@trib4lmaniac](https://www.ruby-forum.com/u/trib4lmaniac)\
**Replies:** 6\
**Last updated:** [June 17, 2009, 5:36pm UTC](https://www.ruby-forum.com/t/graphs-over-time-where-to-store-data-and-how-to/170343 "2009-06-17T17:36:24Z")

</div>

Hi there, interesting one here. Usually I take a problem like this, sit down with MySQL and play about but i’m coming stuck and would like to know what you guys think or what you best practices are! OK, so lets say I’…

---

## [Client side caching problems](https://www.ruby-forum.com/t/client-side-caching-problems/170441)

<div class="topic-metadata">

**Author:** [@manchoman](https://www.ruby-forum.com/u/manchoman)\
**Replies:** 0\
**Last updated:** [June 17, 2009, 5:15pm UTC](https://www.ruby-forum.com/t/client-side-caching-problems/170441 "2009-06-17T17:15:35Z")

</div>

Hi guys, Here is the action I request: def index @producteurs=Producteur.find(:all) last=Producteur.maximum(“updated\_at”).utc if stale?(:last\_modified=\>last) ip=request.remote\_ip @centre=centrage(ip) respond\_to d…

---

## [Rip: A new package manager for Ruby](https://www.ruby-forum.com/t/rip-a-new-package-manager-for-ruby/170437)

<div class="topic-metadata">

**Author:** [@msojka](https://www.ruby-forum.com/u/msojka)\
**Replies:** 0\
**Last updated:** [June 17, 2009, 5:00pm UTC](https://www.ruby-forum.com/t/rip-a-new-package-manager-for-ruby/170437 "2009-06-17T17:00:21Z")

</div>

I’ve written an article on Github’s new Rip package manager. You can find it online at Stowarzyszenie Polski Recykling Martin

---

## [Why is map.root not calling action to set vars...?](https://www.ruby-forum.com/t/why-is-map-root-not-calling-action-to-set-vars/170428)

<div class="topic-metadata">

**Author:** [@dezrtdude](https://www.ruby-forum.com/u/dezrtdude)\
**Replies:** 4\
**Last updated:** [June 17, 2009, 4:59pm UTC](https://www.ruby-forum.com/t/why-is-map-root-not-calling-action-to-set-vars/170428 "2009-06-17T16:59:46Z")

</div>

Hi All, I’ve got a small problem with map.root in the following code: map.root :controller =\> "site\_manager", :action =\> :index It would appear that, for whatever reason, it isn’t calling the “index” action on my co…

---

## [File UPLOAD and put it on a DB BLOB](https://www.ruby-forum.com/t/file-upload-and-put-it-on-a-db-blob/170427)

<div class="topic-metadata">

**Author:** [@bakkhoz](https://www.ruby-forum.com/u/bakkhoz)\
**Replies:** 1\
**Last updated:** [June 17, 2009, 4:55pm UTC](https://www.ruby-forum.com/t/file-upload-and-put-it-on-a-db-blob/170427 "2009-06-17T16:55:04Z")

</div>

@contact = Contact.new @contact.file\_file\_name=params\[:contact\]\[:file\].original\_filename @contact.file\_content\_type=params\[:contact\]\[:file\].content\_type.chomp @contact.file=params\[:contact\]\[:file\].read @contact.save …

---

## [Documenting Models](https://www.ruby-forum.com/t/documenting-models/170424)

<div class="topic-metadata">

**Author:** [@andy](https://www.ruby-forum.com/u/andy)\
**Replies:** 2\
**Last updated:** [June 17, 2009, 4:11pm UTC](https://www.ruby-forum.com/t/documenting-models/170424 "2009-06-17T16:11:02Z")

</div>

All, I’m trying to do some documentation on the models for our interfaces team. I espcially need them to be able to see the relationships belongs\_to and validations. However, I must be stupid with rdoc because I can’…

---

## [Aliasing AR attributes](https://www.ruby-forum.com/t/aliasing-ar-attributes/170291)

<div class="topic-metadata">

**Author:** [@Martin\_Vielsmaier](https://www.ruby-forum.com/u/Martin_Vielsmaier)\
**Replies:** 2\
**Last updated:** [June 17, 2009, 3:30pm UTC](https://www.ruby-forum.com/t/aliasing-ar-attributes/170291 "2009-06-17T15:30:32Z")

</div>

Hey, I’d like to add some “magic” functionality to some model by chain aliasing an attributes setter method like this: class Thing \< ActiveRecord::Base def registration\_with\_upcase=® self.registration\_without\_upcase…

---

## [Display google static map](https://www.ruby-forum.com/t/display-google-static-map/170322)

<div class="topic-metadata">

**Author:** [@zoran](https://www.ruby-forum.com/u/zoran)\
**Replies:** 17\
**Last updated:** [June 17, 2009, 2:42pm UTC](https://www.ruby-forum.com/t/display-google-static-map/170322 "2009-06-17T14:42:23Z")

</div>

how can I display a static map in my view from such a url: http://maps.google.com/staticmap?center=40.714728,-73.998672&zoom=14&size=512x512&maptype=mobile&markers=40.702147,-74.015794,blues|40.711614,-74.012318,greeng|…

---

## [Great Opening for ROR](https://www.ruby-forum.com/t/great-opening-for-ror/170425)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [June 17, 2009, 2:34pm UTC](https://www.ruby-forum.com/t/great-opening-for-ror/170425 "2009-06-17T14:34:11Z")

</div>

This is JEEVITHA from Progressions. (About PROGRESSIONS: Progressions, a TOTAL HR Solutions company with deep domain knowledge spanning recruitment consultancy, placements, contract staffing, flexi staffing, permanent…

---

## [Restful\_ACL db structure](https://www.ruby-forum.com/t/restful-acl-db-structure/169846)

<div class="topic-metadata">

**Author:** [@shahroon\_ali](https://www.ruby-forum.com/u/shahroon_ali)\
**Replies:** 3\
**Last updated:** [June 17, 2009, 12:59pm UTC](https://www.ruby-forum.com/t/restful-acl-db-structure/169846 "2009-06-17T12:59:09Z")

</div>

Hi All, I am going to use restful\_acl in my application on every record in simple words i want to implement record based acl. I explored restful\_acl and I applied it too, but so for I am not successful in doing so. …

---

## [How to bulid additional link to](https://www.ruby-forum.com/t/how-to-bulid-additional-link-to/170408)

<div class="topic-metadata">

**Author:** [@beny18241](https://www.ruby-forum.com/u/beny18241)\
**Replies:** 0\
**Last updated:** [June 17, 2009, 9:36am UTC](https://www.ruby-forum.com/t/how-to-bulid-additional-link-to/170408 "2009-06-17T09:36:23Z")

</div>

Hi I have a small problem. I have created simple scaffold project. On index site i wanted to add second edit link but with different text fields. on index.html.erb inserted \<%= link\_to 'EDIT2', edit2\_list\_path(lis…

---

## [I have been trying to get bureau name and count](https://www.ruby-forum.com/t/i-have-been-trying-to-get-bureau-name-and-count/170407)

<div class="topic-metadata">

**Author:** [@ykazu714](https://www.ruby-forum.com/u/ykazu714)\
**Replies:** 0\
**Last updated:** [June 17, 2009, 9:20am UTC](https://www.ruby-forum.com/t/i-have-been-trying-to-get-bureau-name-and-count/170407 "2009-06-17T09:20:07Z")

</div>

I have been trying to get bureau name and count. show\_graph\_controller.rb def index8 @bureau=Incident.find(:all,:conditions=\>“receipt\_date LIKE ‘2009-05%’”,:select=\>“distinct bureau\_id,count (\*)”,:group=\>“bureau\_id”…

---

## [Model.scope.all.size != Model.scope.count](https://www.ruby-forum.com/t/model-scope-all-size-model-scope-count/170406)

<div class="topic-metadata">

**Author:** [@benjohnson](https://www.ruby-forum.com/u/benjohnson)\
**Replies:** 0\
**Last updated:** [June 17, 2009, 8:26am UTC](https://www.ruby-forum.com/t/model-scope-all-size-model-scope-count/170406 "2009-06-17T08:26:40Z")

</div>

Here’s the quick and dirty: Ticket.wasted.all.size =\> 1 Ticket.wasted.count =\> 10 It looks like the count operation is completely ignoring the :group option that the “wasted” named scope is setting. I am pretty sur…

---

## [Restful Authentication (Error Formatting location..)](https://www.ruby-forum.com/t/restful-authentication-error-formatting-location/170401)

<div class="topic-metadata">

**Author:** [@elricstorm](https://www.ruby-forum.com/u/elricstorm)\
**Replies:** 4\
**Last updated:** [June 17, 2009, 5:58am UTC](https://www.ruby-forum.com/t/restful-authentication-error-formatting-location/170401 "2009-06-17T05:58:37Z")

</div>

I’ve been trying to use Restful Authentication and I have the latest version installed. The issue I’m having is for example: During user signup, if any fields are not properly completed the user should get an error m…

---

## [Write a File with JS](https://www.ruby-forum.com/t/write-a-file-with-js/170378)

<div class="topic-metadata">

**Author:** [@GGC](https://www.ruby-forum.com/u/GGC)\
**Replies:** 5\
**Last updated:** [June 17, 2009, 4:46am UTC](https://www.ruby-forum.com/t/write-a-file-with-js/170378 "2009-06-17T04:46:21Z")

</div>

I want to write into a plain text file using JavaScript (client side), how i can do that? Any idea could be good, but a sample could be better. grettings :smiley:

---

## [Using a cgi perl program?](https://www.ruby-forum.com/t/using-a-cgi-perl-program/170400)

<div class="topic-metadata">

**Author:** [@Sean\_McGilvray](https://www.ruby-forum.com/u/Sean_McGilvray)\
**Replies:** 2\
**Last updated:** [June 17, 2009, 4:42am UTC](https://www.ruby-forum.com/t/using-a-cgi-perl-program/170400 "2009-06-17T04:42:36Z")

</div>

I have a cgi/perl program that I want to use on the same server as my RoR app and I keep getting: The page you were looking for doesn’t exist. You may have mistyped the address or the page may have moved. I load the …

---

## [Decoupling the View from the Model](https://www.ruby-forum.com/t/decoupling-the-view-from-the-model/170391)

<div class="topic-metadata">

**Author:** [@fipa](https://www.ruby-forum.com/u/fipa)\
**Replies:** 7\
**Last updated:** [June 17, 2009, 2:02am UTC](https://www.ruby-forum.com/t/decoupling-the-view-from-the-model/170391 "2009-06-17T02:02:19Z")

</div>

Hi, In my views I often find myself doing: \<%= user.login %\> These get scattered all over the application. Now imagine I change the user’s login to name. What happens? It blows in my face. Sure tests can catch it, b…

---

## [Rails page timing out after 10 seconds...?](https://www.ruby-forum.com/t/rails-page-timing-out-after-10-seconds/170381)

<div class="topic-metadata">

**Author:** [@rustybucket](https://www.ruby-forum.com/u/rustybucket)\
**Replies:** 3\
**Last updated:** [June 17, 2009, 1:21am UTC](https://www.ruby-forum.com/t/rails-page-timing-out-after-10-seconds/170381 "2009-06-17T01:21:35Z")

</div>

I’ve migrated a Rails app that I didn’t build to a new server for a customer. Now there are certain pages which are timing out almost exactly at 10 seconds. They do not report an error, they just go to a blank white…

---

## [Strings from a Sockets Client](https://www.ruby-forum.com/t/strings-from-a-sockets-client/170384)

<div class="topic-metadata">

**Author:** [@JannaB](https://www.ruby-forum.com/u/JannaB)\
**Replies:** 0\
**Last updated:** [June 16, 2009, 9:57pm UTC](https://www.ruby-forum.com/t/strings-from-a-sockets-client/170384 "2009-06-16T21:57:27Z")

</div>

It seems Ruby Strings are a mess if you are trying to send them to a server listening on a given socket (that is not a ruby server. Say it is a Java server). Has anyone found a workaround for this? I have a ruby clien…

---

## [Observe\_field, :function, same value](https://www.ruby-forum.com/t/observe-field-function-same-value/170383)

<div class="topic-metadata">

**Author:** [@spencer](https://www.ruby-forum.com/u/spencer)\
**Replies:** 2\
**Last updated:** [June 16, 2009, 9:01pm UTC](https://www.ruby-forum.com/t/observe-field-function-same-value/170383 "2009-06-16T21:01:19Z")

</div>

Hey all I’m having problems getting the correct value of a checkbox. I have an observe field that calls a javascript function whenever the checkbox is changed. But for whatever reason the checkbox value always seems…

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

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