# Rails

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

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

---

## [Self referential model?](https://www.ruby-forum.com/t/self-referential-model/177941)

<div class="topic-metadata">

**Author:** [@spacechurro](https://www.ruby-forum.com/u/spacechurro)\
**Replies:** 5\
**Last updated:** [October 27, 2009, 5:33am UTC](https://www.ruby-forum.com/t/self-referential-model/177941 "2009-10-27T05:33:23Z")

</div>

is it possible to have a model be belong to itself? say i have a category, and the category can be a subcategory of another category (or it might be a parent category)… is this possible, and does it make sense? somet…

---

## [Trying to remove invalid characters](https://www.ruby-forum.com/t/trying-to-remove-invalid-characters/177915)

<div class="topic-metadata">

**Author:** [@elricstorm](https://www.ruby-forum.com/u/elricstorm)\
**Replies:** 8\
**Last updated:** [October 27, 2009, 5:20am UTC](https://www.ruby-forum.com/t/trying-to-remove-invalid-characters/177915 "2009-10-27T05:20:15Z")

</div>

When parsing win/loss scores from ESPN, I notice that the output looks perfectly normal, even when I carefully inspect the output. It looks like this: wloss = /^\\w\\s\\d{1,2}-\\d{1,2}/ puts @rows\[i\]\[3\] @rows\[i\]\[4\] = @r…

---

## [Bug or not](https://www.ruby-forum.com/t/bug-or-not/177948)

<div class="topic-metadata">

**Author:** [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Replies:** 0\
**Last updated:** [October 27, 2009, 5:05am UTC](https://www.ruby-forum.com/t/bug-or-not/177948 "2009-10-27T05:05:13Z")

</div>

I update rails from 2.0.2 to 2.2.3, and I start server by ruby script/server or mongrel\_rails. But when I use my system, for test or view, the system often exit auto and report a failed to allocate memory error. I tr…

---

## [Redirect fails](https://www.ruby-forum.com/t/redirect-fails/177945)

<div class="topic-metadata">

**Author:** [@slavix](https://www.ruby-forum.com/u/slavix)\
**Replies:** 0\
**Last updated:** [October 27, 2009, 2:50am UTC](https://www.ruby-forum.com/t/redirect-fails/177945 "2009-10-27T02:50:07Z")

</div>

hello, I am testing an ActiveResource model create method. The remote service is sending back a redirect request with newly created record url, but for some reason redirection fails and I get Error: test\_should\_cre…

---

## [Fine-tuned scheduling: backgroundrb?](https://www.ruby-forum.com/t/fine-tuned-scheduling-backgroundrb/177892)

<div class="topic-metadata">

**Author:** [@jhaagmans](https://www.ruby-forum.com/u/jhaagmans)\
**Replies:** 2\
**Last updated:** [October 27, 2009, 1:42am UTC](https://www.ruby-forum.com/t/fine-tuned-scheduling-backgroundrb/177892 "2009-10-27T01:42:48Z")

</div>

Hi, I’d like to make a few requests per second to another method using, for example, backgroundrb (any other suggestions are welcome as well!). I have considered using jRuby to enhance the use of threads and I’m qui…

---

## [Self and Protected Methods question/confusion](https://www.ruby-forum.com/t/self-and-protected-methods-question-confusion/177942)

<div class="topic-metadata">

**Author:** [@cswebgrl](https://www.ruby-forum.com/u/cswebgrl)\
**Replies:** 2\
**Last updated:** [October 27, 2009, 12:15am UTC](https://www.ruby-forum.com/t/self-and-protected-methods-question-confusion/177942 "2009-10-27T00:15:34Z")

</div>

Hi, I’m still trying to learn the in’s and out’s of Ruby and Rails. I’ve been testing my code a million different ways and have read a number of books and web sites, but something is still not clicking for me. I wan…

---

## [Hacking Contest](https://www.ruby-forum.com/t/hacking-contest/177938)

<div class="topic-metadata">

**Author:** [@John\_M.Crist](https://www.ruby-forum.com/u/John_M.Crist)\
**Replies:** 0\
**Last updated:** [October 26, 2009, 11:08pm UTC](https://www.ruby-forum.com/t/hacking-contest/177938 "2009-10-26T23:08:48Z")

</div>

Hello, We’re going to start a hacking contest soon, hope you all join us :slight\_smile: http://www.wablab.com You’ll notice that there still some missed functionalities on the website, don’t worry, everything will be…

---

## [Error handling on ajax form](https://www.ruby-forum.com/t/error-handling-on-ajax-form/177924)

<div class="topic-metadata">

**Author:** [@ronald](https://www.ruby-forum.com/u/ronald)\
**Replies:** 2\
**Last updated:** [October 26, 2009, 11:05pm UTC](https://www.ruby-forum.com/t/error-handling-on-ajax-form/177924 "2009-10-26T23:05:17Z")

</div>

I have a page displaying a form and a table. The form is used to add record to the table using ajax. I am using jQeury for this. Submitting the form with all fields filled in works just fine, but when I leave field e…

---

## [Rails 2.3.4 breaks if I set a cookie's value to a FixNum?](https://www.ruby-forum.com/t/rails-2-3-4-breaks-if-i-set-a-cookies-value-to-a-fixnum/177933)

<div class="topic-metadata">

**Author:** [@phallstrom](https://www.ruby-forum.com/u/phallstrom)\
**Replies:** 2\
**Last updated:** [October 26, 2009, 10:31pm UTC](https://www.ruby-forum.com/t/rails-2-3-4-breaks-if-i-set-a-cookies-value-to-a-fixnum/177933 "2009-10-26T22:31:54Z")

</div>

Hi all - I just upgraded a project to 2.3.4 (a54f572d6f994615a2053c361728b65520a1cb53) and I get errors if I set a cookie to a number like this: cookies\[‘foo’\] = 123 # errors out on a call to CGI::escape(123) priv…

---

## [Added restful authentication features](https://www.ruby-forum.com/t/added-restful-authentication-features/177928)

<div class="topic-metadata">

**Author:** [@biqut2](https://www.ruby-forum.com/u/biqut2)\
**Replies:** 2\
**Last updated:** [October 26, 2009, 10:30pm UTC](https://www.ruby-forum.com/t/added-restful-authentication-features/177928 "2009-10-26T22:30:35Z")

</div>

Pardon mf ignorance but what is the easiest way to take the crypted\_password that the restful authentication plugin stores in the DB and extract the real password from it so that it can be placed in a variable and the…

---

## [Load custom library path](https://www.ruby-forum.com/t/load-custom-library-path/177890)

<div class="topic-metadata">

**Author:** [@nic](https://www.ruby-forum.com/u/nic)\
**Replies:** 2\
**Last updated:** [October 26, 2009, 9:53pm UTC](https://www.ruby-forum.com/t/load-custom-library-path/177890 "2009-10-26T21:53:15Z")

</div>

I’m trying to use a rails app that uses a newer version of RubyGems than my host provides. Since I don’t have root access, I decided to try to install my own version of gems in my home directory. I did so by downloadi…

---

## [Active Merchant](https://www.ruby-forum.com/t/active-merchant/177930)

<div class="topic-metadata">

**Author:** [@dustin](https://www.ruby-forum.com/u/dustin)\
**Replies:** 0\
**Last updated:** [October 26, 2009, 9:25pm UTC](https://www.ruby-forum.com/t/active-merchant/177930 "2009-10-26T21:25:09Z")

</div>

Has anyone experienced success implementing the processor\_id option (for the Braintree gateway) with Active Merchant? If I could just get help on this or at least pointed in the right direction to modify or add on to …

---

## [How to write this SQL in Rails](https://www.ruby-forum.com/t/how-to-write-this-sql-in-rails/177917)

<div class="topic-metadata">

**Author:** [@mitch\_newbie](https://www.ruby-forum.com/u/mitch_newbie)\
**Replies:** 5\
**Last updated:** [October 26, 2009, 9:19pm UTC](https://www.ruby-forum.com/t/how-to-write-this-sql-in-rails/177917 "2009-10-26T21:19:53Z")

</div>

I would like to write the following sql in Rails form. SELECT manufacturers., manuf\_descriptions. FROM manufacturers INNER JOIN manuf\_descriptions ON manuf\_descriptions.manufacturer\_id = manufacturers.id WHERE (manuf\_…

---

## [HTML Button to call RESTful URL?](https://www.ruby-forum.com/t/html-button-to-call-restful-url/177909)

<div class="topic-metadata">

**Author:** [@RVince](https://www.ruby-forum.com/u/RVince)\
**Replies:** 1\
**Last updated:** [October 26, 2009, 7:50pm UTC](https://www.ruby-forum.com/t/html-button-to-call-restful-url/177909 "2009-10-26T19:50:42Z")

</div>

How can I amend a button on my form that looks like: To invoke a method def leads … end in my ChannelsController ? Thanks, Rvince

---

## [Multi Select with fields\_for](https://www.ruby-forum.com/t/multi-select-with-fields-for/177920)

<div class="topic-metadata">

**Author:** [@acgreen](https://www.ruby-forum.com/u/acgreen)\
**Replies:** 1\
**Last updated:** [October 26, 2009, 7:43pm UTC](https://www.ruby-forum.com/t/multi-select-with-fields-for/177920 "2009-10-26T19:43:40Z")

</div>

I’m trying to get a multi select box working with fields\_for but am having a few problems. My view has … \<% form\_for(@teacher) do |f| %\> \<%= f.label :surname %\> \<%= f.text\_field :surname %\> \<% f.fields\_for :qualif…

---

## [Two text\_field\_with\_auto\_complete field with the same search content](https://www.ruby-forum.com/t/two-text-field-with-auto-complete-field-with-the-same-search-content/140429)

<div class="topic-metadata">

**Author:** [@toddlc](https://www.ruby-forum.com/u/toddlc)\
**Replies:** 14\
**Last updated:** [October 26, 2009, 7:43pm UTC](https://www.ruby-forum.com/t/two-text-field-with-auto-complete-field-with-the-same-search-content/140429 "2009-10-26T19:43:29Z")

</div>

Hi all, I have a form with two text\_field\_with\_auto\_complete s, both of which do a lookup from the same table: \<!-- good guys --\>\<td\>\<%= text\_field\_with\_auto\_complete :person, :name %\> \<%= text\_field\_with\_au…

---

## [\[ANN/ADV\] THE COMPLEAT RUBYIST: training with Black/Brown/McAnally, FL, Jan 2010](https://www.ruby-forum.com/t/ann-adv-the-compleat-rubyist-training-with-black-brown-mcanally-fl-jan-2010/177922)

<div class="topic-metadata">

**Author:** [@David\_ASBlack](https://www.ruby-forum.com/u/David_ASBlack)\
**Replies:** 0\
**Last updated:** [October 26, 2009, 7:38pm UTC](https://www.ruby-forum.com/t/ann-adv-the-compleat-rubyist-training-with-black-brown-mcanally-fl-jan-2010/177922 "2009-10-26T19:38:35Z")

</div>

Imagine spending two days exploring Ruby with the authors of: \* The Well-Grounded Rubyist/Ruby For Rails \* Ruby Best Practices \* Ruby in Practice Now imagine it in a warm city in January… THE COMPLEAT RUBY…

---

## [ActiveRecord is being converted to Hash unexpectedly](https://www.ruby-forum.com/t/activerecord-is-being-converted-to-hash-unexpectedly/177822)

<div class="topic-metadata">

**Author:** [@drewB](https://www.ruby-forum.com/u/drewB)\
**Replies:** 17\
**Last updated:** [October 26, 2009, 6:56pm UTC](https://www.ruby-forum.com/t/activerecord-is-being-converted-to-hash-unexpectedly/177822 "2009-10-26T18:56:25Z")

</div>

I am running into a very odd problem. I have an ActiveRecord called Objective with a public create method. When this method is called in a controller the return value is a Hash instead of Objective. When I test the…

---

## [Trouble getting child table information based on locale](https://www.ruby-forum.com/t/trouble-getting-child-table-information-based-on-locale/177914)

<div class="topic-metadata">

**Author:** [@mitch\_newbie](https://www.ruby-forum.com/u/mitch_newbie)\
**Replies:** 0\
**Last updated:** [October 26, 2009, 5:39pm UTC](https://www.ruby-forum.com/t/trouble-getting-child-table-information-based-on-locale/177914 "2009-10-26T17:39:03Z")

</div>

I have two tables manufacturers manuf\_details (details are in several languages) id id name manufacturer\_id . details . locale …

---

## [GIT help](https://www.ruby-forum.com/t/git-help/177888)

<div class="topic-metadata">

**Author:** [@Trausti\_Thor\_J](https://www.ruby-forum.com/u/Trausti_Thor_J)\
**Replies:** 2\
**Last updated:** [October 26, 2009, 5:12pm UTC](https://www.ruby-forum.com/t/git-help/177888 "2009-10-26T17:12:02Z")

</div>

Hi All, I have my own development area on my laptop, and I of course use git extensively. Then once I am done with required changes I do ‘git push origin master’. But I always have to do ‘git reset --hard’ to make m…

---

## [Json](https://www.ruby-forum.com/t/json/177911)

<div class="topic-metadata">

**Author:** [@Sergio\_ASGmail](https://www.ruby-forum.com/u/Sergio_ASGmail)\
**Replies:** 0\
**Last updated:** [October 26, 2009, 4:49pm UTC](https://www.ruby-forum.com/t/json/177911 "2009-10-26T16:49:24Z")

</div>

If you have to implement JSON cals can you give me an conseil? Sergio

---

## [Model.find(:id) and model.find(:all) giving different result](https://www.ruby-forum.com/t/model-find-id-and-model-find-all-giving-different-result/177907)

<div class="topic-metadata">

**Author:** [@mitch\_newbie](https://www.ruby-forum.com/u/mitch_newbie)\
**Replies:** 1\
**Last updated:** [October 26, 2009, 4:26pm UTC](https://www.ruby-forum.com/t/model-find-id-and-model-find-all-giving-different-result/177907 "2009-10-26T16:26:33Z")

</div>

I have the following code that works very well @manufacturer = Manufacturer.find\_manufacturer(params\[:id\]) which produces the following SQL: SELECT \* FROM manufacturers WHERE (manufacturers.id = 4) #Here params\[:id\] …

---

## [How to Read attachent coming from a webservice](https://www.ruby-forum.com/t/how-to-read-attachent-coming-from-a-webservice/177906)

<div class="topic-metadata">

**Author:** [@santoshturamari](https://www.ruby-forum.com/u/santoshturamari)\
**Replies:** 0\
**Last updated:** [October 26, 2009, 3:53pm UTC](https://www.ruby-forum.com/t/how-to-read-attachent-coming-from-a-webservice/177906 "2009-10-26T15:53:23Z")

</div>

Hi All, I am having problem reading a file witch is coming from a web service. When I execute my web service method it retunes a response with an attachment. How to save this attachment in rails application?

---

## [Rspec Tutorial](https://www.ruby-forum.com/t/rspec-tutorial/177777)

<div class="topic-metadata">

**Author:** [@Rails\_ROR](https://www.ruby-forum.com/u/Rails_ROR)\
**Replies:** 10\
**Last updated:** [October 26, 2009, 3:23pm UTC](https://www.ruby-forum.com/t/rspec-tutorial/177777 "2009-10-26T15:23:55Z")

</div>

Hi Everybody, Greetings!! I want to use rspec for my applications. Please guide me with the Rspec tutorial. I want a good example to start with. Please help me by providing good tutorials on Rspec to start with. I …

---

## [Inserting multiple records from one table (model) to another](https://www.ruby-forum.com/t/inserting-multiple-records-from-one-table-model-to-another/177898)

<div class="topic-metadata">

**Author:** [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Replies:** 8\
**Last updated:** [October 26, 2009, 3:17pm UTC](https://www.ruby-forum.com/t/inserting-multiple-records-from-one-table-model-to-another/177898 "2009-10-26T15:17:10Z")

</div>

Hello all, I’ve been getter better with Rails but I’m still just learning. Here’s what I have. I have one table (imports) and I read in a csv into this table. After doing some preliminary editing to each record I wis…

---

## [Which version of Chronic is best these days?](https://www.ruby-forum.com/t/which-version-of-chronic-is-best-these-days/177902)

<div class="topic-metadata">

**Author:** [@rykkers](https://www.ruby-forum.com/u/rykkers)\
**Replies:** 0\
**Last updated:** [October 26, 2009, 2:56pm UTC](https://www.ruby-forum.com/t/which-version-of-chronic-is-best-these-days/177902 "2009-10-26T14:56:58Z")

</div>

There seem to be quite a few variations of the chronic gem $ gem list -ra | grep chronic bjornblomqvist-input\_chronic (1.0.5, 1.0.3, 1.0.0) blakechambers-chronic (0.3.0.2) chronic (0.2.3, 0.2.2, 0.2.1, 0.2.0, 0.1.6, …

---

## [Instance var getting lost during template render](https://www.ruby-forum.com/t/instance-var-getting-lost-during-template-render/177893)

<div class="topic-metadata">

**Author:** [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Replies:** 2\
**Last updated:** [October 26, 2009, 2:04pm UTC](https://www.ruby-forum.com/t/instance-var-getting-lost-during-template-render/177893 "2009-10-26T14:04:50Z")

</div>

hey all I’m using rescue\_from to catch exceptions and render a ‘whoops - we had a problem’ kind of page. Before i render the page, i set an instance variable @message which i want to use on the page. But, it’s not b…

---

## [Stop outside access to directory](https://www.ruby-forum.com/t/stop-outside-access-to-directory/177889)

<div class="topic-metadata">

**Author:** [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Replies:** 3\
**Last updated:** [October 26, 2009, 12:18pm UTC](https://www.ruby-forum.com/t/stop-outside-access-to-directory/177889 "2009-10-26T12:18:54Z")

</div>

How could I stop access to a directory from the outside, for example a dir with images, and only allow it via the Rails app?

---

## [Api routes with versions](https://www.ruby-forum.com/t/api-routes-with-versions/177815)

<div class="topic-metadata">

**Author:** [@arvias](https://www.ruby-forum.com/u/arvias)\
**Replies:** 1\
**Last updated:** [October 26, 2009, 12:14pm UTC](https://www.ruby-forum.com/t/api-routes-with-versions/177815 "2009-10-26T12:14:48Z")

</div>

Hi, I’ve been trying to implement a versioned API, I went through different versions that I didn’t like. I am wondering if I can do something like this with routes, and if it’s possible how can it be implemented: ap…

---

## [Rails Syntax](https://www.ruby-forum.com/t/rails-syntax/177891)

<div class="topic-metadata">

**Author:** [@smit\_shah](https://www.ruby-forum.com/u/smit_shah)\
**Replies:** 3\
**Last updated:** [October 26, 2009, 12:03pm UTC](https://www.ruby-forum.com/t/rails-syntax/177891 "2009-10-26T12:03:40Z")

</div>

Hi All… I want some sites that provides all the basic syntax that rails support. If u have any document than please share it with me… Please help me out… Thanks…

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

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