# Rails

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

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

---

## [Creating a REST Client](https://www.ruby-forum.com/t/creating-a-rest-client/137341)

<div class="topic-metadata">

**Author:** [@sameera](https://www.ruby-forum.com/u/sameera)\
**Replies:** 4\
**Last updated:** [July 22, 2008, 3:55am UTC](https://www.ruby-forum.com/t/creating-a-rest-client/137341 "2008-07-22T03:55:44Z")

</div>

Hi all, I would like to create a RESTful rails application. My idea is to have 2 web sites. 1 - REST server. This will have all the methods (Ex: getName()) 2 - REST client. This will be another website which will cal…

---

## [Creating dependent models in the same form](https://www.ruby-forum.com/t/creating-dependent-models-in-the-same-form/143714)

<div class="topic-metadata">

**Author:** [@validkeys](https://www.ruby-forum.com/u/validkeys)\
**Replies:** 0\
**Last updated:** [July 22, 2008, 3:53am UTC](https://www.ruby-forum.com/t/creating-dependent-models-in-the-same-form/143714 "2008-07-22T03:53:44Z")

</div>

Hey Guys, I just wanted to get some feedback on what I have done here and how to improve it. As I am just starting rails, I think this would be super helpful if any of you have time So I have a table of songs. Each s…

---

## [Meaningless REST resources for n:n relationships](https://www.ruby-forum.com/t/meaningless-rest-resources-for-n-n-relationships/143707)

<div class="topic-metadata">

**Author:** [@mhfs](https://www.ruby-forum.com/u/mhfs)\
**Replies:** 2\
**Last updated:** [July 22, 2008, 3:53am UTC](https://www.ruby-forum.com/t/meaningless-rest-resources-for-n-n-relationships/143707 "2008-07-22T03:53:44Z")

</div>

Hello all, I’m designing a Rails application that has a Group resource that habtm Permissions. Since I’m following the RESTful pattern, I thought on creating a GroupsPermissions (via Group has\_many Permissions :thro…

---

## [Polymorphic DRYness? (Acts as Commentable)](https://www.ruby-forum.com/t/polymorphic-dryness-acts-as-commentable/143706)

<div class="topic-metadata">

**Author:** [@Sav](https://www.ruby-forum.com/u/Sav)\
**Replies:** 1\
**Last updated:** [July 22, 2008, 2:32am UTC](https://www.ruby-forum.com/t/polymorphic-dryness-acts-as-commentable/143706 "2008-07-22T02:32:58Z")

</div>

I’m using the polymorphic “acts\_as\_commentable” plugin… But I’m new to RoR and don’t understand how to avoid repeating myself. Is there a way to create a single “comment\_form” partial and action to handle any model …

---

## [Flash\[:error\] not displayed](https://www.ruby-forum.com/t/flash-error-not-displayed/143703)

<div class="topic-metadata">

**Author:** [@amrita](https://www.ruby-forum.com/u/amrita)\
**Replies:** 4\
**Last updated:** [July 22, 2008, 1:56am UTC](https://www.ruby-forum.com/t/flash-error-not-displayed/143703 "2008-07-22T01:56:42Z")

</div>

Hello, I am a Rails newbie and have a two-fold question. I recently started working with authentication. The basic authentication system is working for me, but I would like to catch errors and exceptions and display …

---

## [Time](https://www.ruby-forum.com/t/time/143705)

<div class="topic-metadata">

**Author:** [@jturney](https://www.ruby-forum.com/u/jturney)\
**Replies:** 1\
**Last updated:** [July 22, 2008, 1:29am UTC](https://www.ruby-forum.com/t/time/143705 "2008-07-22T01:29:14Z")

</div>

Activerecord automatically stores the time for created\_at and updated\_at as UTC, and this is what it looks like: 2008-07-21 18:55:29 UTC How can I get the Time.now to look like that? I’m trying to find the difference …

---

## [Session updates](https://www.ruby-forum.com/t/session-updates/143701)

<div class="topic-metadata">

**Author:** [@jturney](https://www.ruby-forum.com/u/jturney)\
**Replies:** 1\
**Last updated:** [July 22, 2008, 1:23am UTC](https://www.ruby-forum.com/t/session-updates/143701 "2008-07-22T01:23:58Z")

</div>

session.model.update\_attribute(:user\_id, session\[:user\_id\]) session.model.update\_attribute(:requirement\_title, params\[:thread\]) I found this on the net. Not sure how it works. Whenever a user clicks on a certain link,…

---

## [Bugs caused by ActiveRecord::Base#first](https://www.ruby-forum.com/t/bugs-caused-by-activerecord-base-first/143697)

<div class="topic-metadata">

**Author:** [@Eric\_LIn](https://www.ruby-forum.com/u/Eric_LIn)\
**Replies:** 5\
**Last updated:** [July 22, 2008, 1:01am UTC](https://www.ruby-forum.com/t/bugs-caused-by-activerecord-base-first/143697 "2008-07-22T01:01:09Z")

</div>

The latest version of Rails introduces the convenience method “first” in ActiveRecord, which acts as find(:first). This is breaking my application wherever the following type of interaction takes place: blog.posts.fi…

---

## [Garbled Page Caching](https://www.ruby-forum.com/t/garbled-page-caching/143700)

<div class="topic-metadata">

**Author:** [@subv3](https://www.ruby-forum.com/u/subv3)\
**Replies:** 1\
**Last updated:** [July 22, 2008, 12:50am UTC](https://www.ruby-forum.com/t/garbled-page-caching/143700 "2008-07-22T00:50:02Z")

</div>

Hello all, I’m having some issues with page caching in our app. We’re on 2.1.0 and using standard page caching. We seem to be getting a weird problem where the page will get cached (as .html a file) but the contents …

---

## [Is ActiveResource buggy or am I?](https://www.ruby-forum.com/t/is-activeresource-buggy-or-am-i/143566)

<div class="topic-metadata">

**Author:** [@jblanche](https://www.ruby-forum.com/u/jblanche)\
**Replies:** 10\
**Last updated:** [July 22, 2008, 12:03am UTC](https://www.ruby-forum.com/t/is-activeresource-buggy-or-am-i/143566 "2008-07-22T00:03:48Z")

</div>

Hi, I’m currently working with ActiveResource and I have some troubles with it. I have two models on the server side, Artist and Song Songs: belong\_to :artist and Artist: has\_many :songs I also have two controllers m…

---

## [Caching controller code in development](https://www.ruby-forum.com/t/caching-controller-code-in-development/143584)

<div class="topic-metadata">

**Author:** [@covertrails](https://www.ruby-forum.com/u/covertrails)\
**Replies:** 1\
**Last updated:** [July 21, 2008, 11:45pm UTC](https://www.ruby-forum.com/t/caching-controller-code-in-development/143584 "2008-07-21T23:45:40Z")

</div>

I am running Rails 2.1.0 on an XP box. In development I have config.cache\_classes = false. But…when I mod my controller code it does not pick up the change. This happens in Webrick and Mongrel (1.1.5) Ideas?

---

## [Selected attribute in options\_for\_select](https://www.ruby-forum.com/t/selected-attribute-in-options-for-select/143593)

<div class="topic-metadata">

**Author:** [@mailbox\_abhishek](https://www.ruby-forum.com/u/mailbox_abhishek)\
**Replies:** 3\
**Last updated:** [July 21, 2008, 11:43pm UTC](https://www.ruby-forum.com/t/selected-attribute-in-options-for-select/143593 "2008-07-21T23:43:19Z")

</div>

Hello Everyone I have a select\_tag which I populate using a map, I use options\_for\_select method to pass the map and “selected” value. For some reason I can not get the option “selected” based on the value I pass to …

---

## [Has\_and\_belongs\_to\_many problems when editing](https://www.ruby-forum.com/t/has-and-belongs-to-many-problems-when-editing/142757)

<div class="topic-metadata">

**Author:** [@elioncho](https://www.ruby-forum.com/u/elioncho)\
**Replies:** 3\
**Last updated:** [July 21, 2008, 11:43pm UTC](https://www.ruby-forum.com/t/has-and-belongs-to-many-problems-when-editing/142757 "2008-07-21T23:43:18Z")

</div>

Hello, Right now I have a has\_and\_belongs\_to\_many relationship between an events table and a users table. So the join table rows look something like this: event\_id user\_id 1 2 1 3 1 …

---

## [Remove trailing zeros from currency and qty](https://www.ruby-forum.com/t/remove-trailing-zeros-from-currency-and-qty/143652)

<div class="topic-metadata">

**Author:** [@gorgeoussoul](https://www.ruby-forum.com/u/gorgeoussoul)\
**Replies:** 2\
**Last updated:** [July 21, 2008, 11:15pm UTC](https://www.ruby-forum.com/t/remove-trailing-zeros-from-currency-and-qty/143652 "2008-07-21T23:15:45Z")

</div>

I’m storing qty and currency data in MySQL Decimal(12,3) fields. Most of the time, people are entering Qty = 1. Occasionally, they’re entering Qty = 1.25 though. If the value is 1, I’d like to display Qty = 1 rather …

---

## [Listing user jobs](https://www.ruby-forum.com/t/listing-user-jobs/143684)

<div class="topic-metadata">

**Author:** [@amrita](https://www.ruby-forum.com/u/amrita)\
**Replies:** 1\
**Last updated:** [July 21, 2008, 10:56pm UTC](https://www.ruby-forum.com/t/listing-user-jobs/143684 "2008-07-21T22:56:24Z")

</div>

Hi, I am still on my first Rails application which consists of several models and their controllers and views. Recently, I added user authentication to the project and have been able to make it work so far. For all v…

---

## [How do I test if variable Name starts with Alphabet or not?](https://www.ruby-forum.com/t/how-do-i-test-if-variable-name-starts-with-alphabet-or-not/143687)

<div class="topic-metadata">

**Author:** [@sgudibanda](https://www.ruby-forum.com/u/sgudibanda)\
**Replies:** 1\
**Last updated:** [July 21, 2008, 9:55pm UTC](https://www.ruby-forum.com/t/how-do-i-test-if-variable-name-starts-with-alphabet-or-not/143687 "2008-07-21T21:55:24Z")

</div>

Hi, I need to check if a variable “name” starts with a variable or not, how do i do that? Essential, i want to sort array of names alphabetically : i was using names.sort\_by{|c| "c\[‘name’\]} But if name has numerical…

---

## [Stop thin webserver](https://www.ruby-forum.com/t/stop-thin-webserver/143618)

<div class="topic-metadata">

**Author:** [@ganana\_srishti](https://www.ruby-forum.com/u/ganana_srishti)\
**Replies:** 1\
**Last updated:** [July 21, 2008, 9:45pm UTC](https://www.ruby-forum.com/t/stop-thin-webserver/143618 "2008-07-21T21:45:24Z")

</div>

Hi, How to stop thin server i have tried the following command but it is giving error $\>thin stop Error:Can’t stop process, no PID found in tmp/pids/thin.pid plz reply

---

## [How to Keep Format of Temporary File (How do I?)](https://www.ruby-forum.com/t/how-to-keep-format-of-temporary-file-how-do-i/143685)

<div class="topic-metadata">

**Author:** [@joep](https://www.ruby-forum.com/u/joep)\
**Replies:** 2\
**Last updated:** [July 21, 2008, 9:13pm UTC](https://www.ruby-forum.com/t/how-to-keep-format-of-temporary-file-how-do-i/143685 "2008-07-21T21:13:21Z")

</div>

Hi, Alright, here is the problem. In one action, I store an array of arrays in a temporary file, like this: @temp\_file = Tempfile.new(“temporary\_csv\_file”) @temp\_file.puts @parsed\_file @temp\_file.close By array of…

---

## [How to get json format data without the .json or ?format=json postfix in the url?](https://www.ruby-forum.com/t/how-to-get-json-format-data-without-the-json-or-format-json-postfix-in-the-url/143688)

<div class="topic-metadata">

**Author:** [@Fivesheep](https://www.ruby-forum.com/u/Fivesheep)\
**Replies:** 0\
**Last updated:** [July 21, 2008, 9:06pm UTC](https://www.ruby-forum.com/t/how-to-get-json-format-data-without-the-json-or-format-json-postfix-in-the-url/143688 "2008-07-21T21:06:38Z")

</div>

I have tried to set the “Accept: application/json” header, but it didn’t work. all i could get was the “406 Not Acceptable” status code. Below was the command what i used to make the request: curl -i -X POST -H “Conte…

---

## [Removing format from routes](https://www.ruby-forum.com/t/removing-format-from-routes/143683)

<div class="topic-metadata">

**Author:** [@xwordguy](https://www.ruby-forum.com/u/xwordguy)\
**Replies:** 0\
**Last updated:** [July 21, 2008, 8:21pm UTC](https://www.ruby-forum.com/t/removing-format-from-routes/143683 "2008-07-21T20:21:29Z")

</div>

Hi all, We’re currently using format to serve up multiple versions of the same site (e.g., www and mobile). The choice as to which to serve is either set as the format GET parameter or via the subdomain of the reque…

---

## [Help on using Git to pull acts\_as\_ferret](https://www.ruby-forum.com/t/help-on-using-git-to-pull-acts-as-ferret/143679)

<div class="topic-metadata">

**Author:** [@janus](https://www.ruby-forum.com/u/janus)\
**Replies:** 0\
**Last updated:** [July 21, 2008, 7:56pm UTC](https://www.ruby-forum.com/t/help-on-using-git-to-pull-acts-as-ferret/143679 "2008-07-21T19:56:49Z")

</div>

I was able to clone act\_as\_ferret, however, I need to have it as a plugin. As it is now, it is not visible to my application. It resides at the root directory. Could somebody direct me on what to do? Janus

---

## [Need help on software](https://www.ruby-forum.com/t/need-help-on-software/143675)

<div class="topic-metadata">

**Author:** [@Spumato](https://www.ruby-forum.com/u/Spumato)\
**Replies:** 1\
**Last updated:** [July 21, 2008, 7:48pm UTC](https://www.ruby-forum.com/t/need-help-on-software/143675 "2008-07-21T19:48:35Z")

</div>

The presentation demo on RoR website, the presenter is using OSX with Textmate. What does the presenter use to edit the db? Thanks.

---

## [Digital Downloads](https://www.ruby-forum.com/t/digital-downloads/143676)

<div class="topic-metadata">

**Author:** [@nek4life](https://www.ruby-forum.com/u/nek4life)\
**Replies:** 1\
**Last updated:** [July 21, 2008, 7:07pm UTC](https://www.ruby-forum.com/t/digital-downloads/143676 "2008-07-21T19:07:49Z")

</div>

Looking for some tutorials on the digital delivery of products. I’ve seen lots of books on stores with physical products, but I can’t find any tutorials on a store that can handle digital products. Any suggestions w…

---

## [Session expires, automatic logout](https://www.ruby-forum.com/t/session-expires-automatic-logout/143656)

<div class="topic-metadata">

**Author:** [@snantz](https://www.ruby-forum.com/u/snantz)\
**Replies:** 2\
**Last updated:** [July 21, 2008, 7:06pm UTC](https://www.ruby-forum.com/t/session-expires-automatic-logout/143656 "2008-07-21T19:06:00Z")

</div>

I am trying to implement an automatic logout for an online application I am building. The idea is that after an hour of inactivity to have the page autmoatically logout itself. The main part of my code is as follows: …

---

## [Find\_by\_name won't return record id](https://www.ruby-forum.com/t/find-by-name-wont-return-record-id/143668)

<div class="topic-metadata">

**Author:** [@bubba\_baloo](https://www.ruby-forum.com/u/bubba_baloo)\
**Replies:** 1\
**Last updated:** [July 21, 2008, 6:55pm UTC](https://www.ruby-forum.com/t/find-by-name-wont-return-record-id/143668 "2008-07-21T18:55:54Z")

</div>

Okay - so I’m finally making my first post after a couple of months with RoR. Thanks for all the great information so far. I’m using mysql. I have a model called “Role”. I’m trying to retrieve the id for a record that…

---

## [.htaccess exceptions](https://www.ruby-forum.com/t/htaccess-exceptions/143673)

<div class="topic-metadata">

**Author:** [@stoneferry](https://www.ruby-forum.com/u/stoneferry)\
**Replies:** 0\
**Last updated:** [July 21, 2008, 6:40pm UTC](https://www.ruby-forum.com/t/htaccess-exceptions/143673 "2008-07-21T18:40:43Z")

</div>

Hi I’m a .php coder trying to allow a Ruby on Rails website to access some .php scripts. I notice everything get redirected with Ruby on Rails in the .htaccess file. How do I stop Rails from redirecting my .php script…

---

## [Out of box authentication](https://www.ruby-forum.com/t/out-of-box-authentication/143478)

<div class="topic-metadata">

**Author:** [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Replies:** 5\
**Last updated:** [July 21, 2008, 6:40pm UTC](https://www.ruby-forum.com/t/out-of-box-authentication/143478 "2008-07-21T18:40:03Z")

</div>

I have a bit of a dilemma that I can’t figure out a suitable method. I have an existing system in production (Rails 1.2.6) that I don’t want to modify as I’ve got lots of modifications in development which will be mer…

---

## [Quick Question about the 15 minute RoR Blog Demo](https://www.ruby-forum.com/t/quick-question-about-the-15-minute-ror-blog-demo/143669)

<div class="topic-metadata">

**Author:** [@Spumato](https://www.ruby-forum.com/u/Spumato)\
**Replies:** 1\
**Last updated:** [July 21, 2008, 6:11pm UTC](https://www.ruby-forum.com/t/quick-question-about-the-15-minute-ror-blog-demo/143669 "2008-07-21T18:11:53Z")

</div>

During the presentation on the RoR demonstration within the RoR website, the presenter who is using a Mac w/ Textmate opens a program where he edits a database table. I am not familiar with what application is being u…

---

## [Get values](https://www.ruby-forum.com/t/get-values/143107)

<div class="topic-metadata">

**Author:** [@lexor](https://www.ruby-forum.com/u/lexor)\
**Replies:** 2\
**Last updated:** [July 21, 2008, 6:06pm UTC](https://www.ruby-forum.com/t/get-values/143107 "2008-07-21T18:06:08Z")

</div>

Hi all, I have a web with a table which list the values of a model and I want to add a toolbar for edit, show and delete a row. I have added OnClick event that calls a JavaScript method to highligth the selected row …

---

## [2.1 Gem Dependencies](https://www.ruby-forum.com/t/2-1-gem-dependencies/143666)

<div class="topic-metadata">

**Author:** [@andy](https://www.ruby-forum.com/u/andy)\
**Replies:** 0\
**Last updated:** [July 21, 2008, 6:03pm UTC](https://www.ruby-forum.com/t/2-1-gem-dependencies/143666 "2008-07-21T18:03:45Z")

</div>

I seem to be doing something wrong w/ gem dependencies: if I put a config.gem statement in environment, and then write some code to use that gem in a rake task or in a controller (such as a ‘require’ statment), then r…

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

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