# Rails

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

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

---

## [Problem accessing item using has many through](https://www.ruby-forum.com/t/problem-accessing-item-using-has-many-through/119410)

<div class="topic-metadata">

**Author:** [@martinevans](https://www.ruby-forum.com/u/martinevans)\
**Replies:** 6\
**Last updated:** [November 6, 2007, 10:36pm UTC](https://www.ruby-forum.com/t/problem-accessing-item-using-has-many-through/119410 "2007-11-06T22:36:52Z")

</div>

My models are class BakeryOutput \< ActiveRecord::Base belongs\_to :recipe belongs\_to :customer end class Recipe \< ActiveRecord::Base has\_many :ingredient\_recipes has\_many :ingredients, :through =\> :ingredient\_r…

---

## [Testing anomaly](https://www.ruby-forum.com/t/testing-anomaly/119309)

<div class="topic-metadata">

**Author:** [@keynan](https://www.ruby-forum.com/u/keynan)\
**Replies:** 4\
**Last updated:** [November 6, 2007, 9:38pm UTC](https://www.ruby-forum.com/t/testing-anomaly/119309 "2007-11-06T21:38:23Z")

</div>

I am attempting to load relations via database data in the model belongs\_to :asset\_type AssetType.asset\_connection\_names.each do |at| belongs\_to at, :foreign\_key =\> ‘asset\_id’ end def method\_missing(method, \*arg…

---

## [Why is this migration trying to re-create schema\_info?](https://www.ruby-forum.com/t/why-is-this-migration-trying-to-re-create-schema-info/119370)

<div class="topic-metadata">

**Author:** [@fredistic](https://www.ruby-forum.com/u/fredistic)\
**Replies:** 7\
**Last updated:** [November 6, 2007, 9:37pm UTC](https://www.ruby-forum.com/t/why-is-this-migration-trying-to-re-create-schema-info/119370 "2007-11-06T21:37:28Z")

</div>

Postgresql Migration Failure on 4th migration (attachment\_fu). A migration fails mysteriously. The console says: rake aborted! uninitialized constant AttachmentImages The log says: SQL (0.000000) PGError: ERROR: …

---

## [HTTP POSTs](https://www.ruby-forum.com/t/http-posts/119299)

<div class="topic-metadata">

**Author:** [@doug3](https://www.ruby-forum.com/u/doug3)\
**Replies:** 2\
**Last updated:** [November 6, 2007, 9:35pm UTC](https://www.ruby-forum.com/t/http-posts/119299 "2007-11-06T21:35:56Z")

</div>

Hi all, this may sound basic, but I’m not able to figure out how to initiate an http post action from within a controller. What I’m trying to do is use a def function in one of my application controllers to send a pos…

---

## [Install rails plugins when behind a proxy](https://www.ruby-forum.com/t/install-rails-plugins-when-behind-a-proxy/119415)

<div class="topic-metadata">

**Author:** [@MarcS](https://www.ruby-forum.com/u/MarcS)\
**Replies:** 1\
**Last updated:** [November 6, 2007, 9:20pm UTC](https://www.ruby-forum.com/t/install-rails-plugins-when-behind-a-proxy/119415 "2007-11-06T21:20:50Z")

</div>

Hi, I’m behind a proxy server and I can’t seem to install any rails plugins Whenever I’m trying to install a plugin I get this exists create app/controller File exists - script/plugin which I guess means that …

---

## [Using page variables in rjs templates](https://www.ruby-forum.com/t/using-page-variables-in-rjs-templates/119409)

<div class="topic-metadata">

**Author:** [@magic\_hat](https://www.ruby-forum.com/u/magic_hat)\
**Replies:** 1\
**Last updated:** [November 6, 2007, 8:50pm UTC](https://www.ruby-forum.com/t/using-page-variables-in-rjs-templates/119409 "2007-11-06T20:50:39Z")

</div>

Hi everyone. I have a CMS that uses a fckeditor-like WSIWYG setup. I’m writing an ajax action that toggles the view between WSIWYG and a textarea that shows the actual html. To do that, I need to pull the existing co…

---

## [Re: Question about how engine plugin handlesmigrations](https://www.ruby-forum.com/t/re-question-about-how-engine-plugin-handlesmigrations/119402)

<div class="topic-metadata">

**Author:** [@Trevor\_Rowe](https://www.ruby-forum.com/u/Trevor_Rowe)\
**Replies:** 1\
**Last updated:** [November 6, 2007, 8:38pm UTC](https://www.ruby-forum.com/t/re-question-about-how-engine-plugin-handlesmigrations/119402 "2007-11-06T20:38:02Z")

</div>

Plugin Migrations have their own version history. Their version numbers are kept in a table called ‘plugin\_schema\_info’, which has 1 row per plugin with migrations. The script/generate plugin\_migration generates clie…

---

## [To Enable a disabled text\_field onclick of radio button?](https://www.ruby-forum.com/t/to-enable-a-disabled-text-field-onclick-of-radio-button/119407)

<div class="topic-metadata">

**Author:** [@sgudibanda](https://www.ruby-forum.com/u/sgudibanda)\
**Replies:** 1\
**Last updated:** [November 6, 2007, 8:19pm UTC](https://www.ruby-forum.com/t/to-enable-a-disabled-text-field-onclick-of-radio-button/119407 "2007-11-06T20:19:54Z")

</div>

Hi, I have 3 radio buttons, with 1st checked. If the 3rd radio button is clicked, i want to enable the text\_field. Anything wrong in the code below? It doesn’t work :frowning: \<%= radio\_button :profile, :nick\_name, “…

---

## [How to install plugins?](https://www.ruby-forum.com/t/how-to-install-plugins/119408)

<div class="topic-metadata">

**Author:** [@jamal](https://www.ruby-forum.com/u/jamal)\
**Replies:** 1\
**Last updated:** [November 6, 2007, 8:17pm UTC](https://www.ruby-forum.com/t/how-to-install-plugins/119408 "2007-11-06T20:17:34Z")

</div>

Hello, I’m having problems installing any plugins :S I wanna know if I’m doing something wrong $ruby script/plugin discover …Y…Y…Y answering to add urls…then $ruby script/plugin install query\_trace svn: Connection …

---

## [Suggested Authentication Plugin?](https://www.ruby-forum.com/t/suggested-authentication-plugin/119379)

<div class="topic-metadata">

**Author:** [@josef](https://www.ruby-forum.com/u/josef)\
**Replies:** 1\
**Last updated:** [November 6, 2007, 7:47pm UTC](https://www.ruby-forum.com/t/suggested-authentication-plugin/119379 "2007-11-06T19:47:26Z")

</div>

Hi Everyone, I have progressed my application, it’s coming along nicely. I have just installed acts\_as\_authenticated plug-in to set up basic login controls. The thing is I want something that will also give me user/ad…

---

## [Has\_many :through problem](https://www.ruby-forum.com/t/has-many-through-problem/119405)

<div class="topic-metadata">

**Author:** [@colemanm](https://www.ruby-forum.com/u/colemanm)\
**Replies:** 1\
**Last updated:** [November 6, 2007, 7:45pm UTC](https://www.ruby-forum.com/t/has-many-through-problem/119405 "2007-11-06T19:45:20Z")

</div>

(sorry for the double post, somehow I accidentally prematurely posted part of this…) I’m building a simple support ticket system for use in our office. I’ve got a model called Ticket and one called Category and I’m t…

---

## [RailsLodge - Now tagging / documenting gems](https://www.ruby-forum.com/t/railslodge-now-tagging-documenting-gems/119404)

<div class="topic-metadata">

**Author:** [@ss\_1982](https://www.ruby-forum.com/u/ss_1982)\
**Replies:** 1\
**Last updated:** [November 6, 2007, 7:38pm UTC](https://www.ruby-forum.com/t/railslodge-now-tagging-documenting-gems/119404 "2007-11-06T19:38:46Z")

</div>

A recent update to RailsLodge now means that we are now starting to document / tag gems as has been done with plugins. As usual, if anyone has any suggestions on how to improve the site further, please send them over. …

---

## [Has\_many :through problem](https://www.ruby-forum.com/t/has-many-through-problem/119403)

<div class="topic-metadata">

**Author:** [@colemanm](https://www.ruby-forum.com/u/colemanm)\
**Replies:** 0\
**Last updated:** [November 6, 2007, 7:35pm UTC](https://www.ruby-forum.com/t/has-many-through-problem/119403 "2007-11-06T19:35:52Z")

</div>

I’m building a simple support ticket system for use in our office. I’ve got a model called Ticket and one called Category and I’m trying to set it up so that I can add categories at will and assign many categories to …

---

## [Question about how engine plugin handles migrations](https://www.ruby-forum.com/t/question-about-how-engine-plugin-handles-migrations/119400)

<div class="topic-metadata">

**Author:** [@Daniel\_Wintschel](https://www.ruby-forum.com/u/Daniel_Wintschel)\
**Replies:** 0\
**Last updated:** [November 6, 2007, 6:59pm UTC](https://www.ruby-forum.com/t/question-about-how-engine-plugin-handles-migrations/119400 "2007-11-06T18:59:01Z")

</div>

Hi all, I have a question about how engines deals with migrations (really, I could test this myself, but since I haven’t used engines I was wondering if someone might have a definitive or ‘official’ answer). Let’s …

---

## [Force the download](https://www.ruby-forum.com/t/force-the-download/119396)

<div class="topic-metadata">

**Author:** [@david](https://www.ruby-forum.com/u/david)\
**Replies:** 2\
**Last updated:** [November 6, 2007, 6:53pm UTC](https://www.ruby-forum.com/t/force-the-download/119396 "2007-11-06T18:53:45Z")

</div>

Hello, I wonder if you could tell me how to make the navigator force the download. In PHP it works like this: $downloadfile=“fichero.gpx”; header(“Content-disposition: attachment; filename=$downloadfile”); header(“…

---

## [An optional params](https://www.ruby-forum.com/t/an-optional-params/119312)

<div class="topic-metadata">

**Author:** [@chil](https://www.ruby-forum.com/u/chil)\
**Replies:** 2\
**Last updated:** [November 6, 2007, 6:40pm UTC](https://www.ruby-forum.com/t/an-optional-params/119312 "2007-11-06T18:40:17Z")

</div>

Hi! In order to respect DRY principles, I had to regroup two controller in one. To sum up, I have to build one controller which can make a ‘simple’ page and this same page with other features when a second id param is …

---

## [Passing a parameter only if not blank](https://www.ruby-forum.com/t/passing-a-parameter-only-if-not-blank/119394)

<div class="topic-metadata">

**Author:** [@snantz](https://www.ruby-forum.com/u/snantz)\
**Replies:** 2\
**Last updated:** [November 6, 2007, 6:39pm UTC](https://www.ruby-forum.com/t/passing-a-parameter-only-if-not-blank/119394 "2007-11-06T18:39:18Z")

</div>

I have this form tag: \<% form\_remote\_tag :update =\> ‘hotel-loyalties’, :url =\> { :action =\> ‘make\_hotel\_loyalty’, :id =\> @user.id, :manager =\> @manager.id end } do -%\> I only want to pass the @manager value if it is…

---

## [Scaffold for boolean fields](https://www.ruby-forum.com/t/scaffold-for-boolean-fields/119391)

<div class="topic-metadata">

**Author:** [@Bhaskar\_Jayakrishna](https://www.ruby-forum.com/u/Bhaskar_Jayakrishna)\
**Replies:** 2\
**Last updated:** [November 6, 2007, 6:19pm UTC](https://www.ruby-forum.com/t/scaffold-for-boolean-fields/119391 "2007-11-06T18:19:50Z")

</div>

The default scaffold generator generates the following code for a boolean field. This results in a past selection not being remembered during edits. Active False True I guess it should be: Active \<%= select(…

---

## [Attr\_accessor](https://www.ruby-forum.com/t/attr-accessor/119341)

<div class="topic-metadata">

**Author:** [@pat](https://www.ruby-forum.com/u/pat)\
**Replies:** 2\
**Last updated:** [November 6, 2007, 6:00pm UTC](https://www.ruby-forum.com/t/attr-accessor/119341 "2007-11-06T18:00:31Z")

</div>

Folks, newbie here and I have a quick question about attr\_accessor. I’m developing a very basic CMS and I set up a simple class for a user. In that class I use attr\_accessor to set up the read, write, etc methods. T…

---

## [Table search question](https://www.ruby-forum.com/t/table-search-question/119339)

<div class="topic-metadata">

**Author:** [@agilehack](https://www.ruby-forum.com/u/agilehack)\
**Replies:** 1\
**Last updated:** [November 6, 2007, 5:54pm UTC](https://www.ruby-forum.com/t/table-search-question/119339 "2007-11-06T17:54:05Z")

</div>

i have a procedures table and a procedure model - it contain procedure descriptions as well as procedure codes. I would like the user to enter a procedure description (eye surgery) into a test field and then i would l…

---

## [Question for rails multidomain application design](https://www.ruby-forum.com/t/question-for-rails-multidomain-application-design/118855)

<div class="topic-metadata">

**Author:** [@gianluca\_t](https://www.ruby-forum.com/u/gianluca_t)\
**Replies:** 6\
**Last updated:** [November 6, 2007, 4:47pm UTC](https://www.ruby-forum.com/t/question-for-rails-multidomain-application-design/118855 "2007-11-06T16:47:55Z")

</div>

Hi to all, I would design an application for multidomain support and my question is what is the best practice to do this kind of application ? Eg.: I think to write my application handling the multidomain into routin…

---

## [Sleep function duration changes when system clock is modifie](https://www.ruby-forum.com/t/sleep-function-duration-changes-when-system-clock-is-modifie/85339)

<div class="topic-metadata">

**Author:** [@jan](https://www.ruby-forum.com/u/jan)\
**Replies:** 3\
**Last updated:** [November 6, 2007, 3:46pm UTC](https://www.ruby-forum.com/t/sleep-function-duration-changes-when-system-clock-is-modifie/85339 "2007-11-06T15:46:08Z")

</div>

My problem is related to the behaviour of sleep function. If, during the execution of sleep function, I change the system clock of my PC, sleep function will not recover from sleeping when it should. Example: My cont…

---

## [HABTM and REST](https://www.ruby-forum.com/t/habtm-and-rest/119320)

<div class="topic-metadata">

**Author:** [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Replies:** 2\
**Last updated:** [November 6, 2007, 3:30pm UTC](https://www.ruby-forum.com/t/habtm-and-rest/119320 "2007-11-06T15:30:08Z")

</div>

I have found a few places that have said that they don’t mix well, but I haven’t been able to find any reasoning as to why. Does anyone have any knowledge to why this is? Thanks

---

## [Trouble using drop down box](https://www.ruby-forum.com/t/trouble-using-drop-down-box/119353)

<div class="topic-metadata">

**Author:** [@subhash](https://www.ruby-forum.com/u/subhash)\
**Replies:** 2\
**Last updated:** [November 6, 2007, 3:16pm UTC](https://www.ruby-forum.com/t/trouble-using-drop-down-box/119353 "2007-11-06T15:16:00Z")

</div>

I am using a drop down box in a form, the method is GET. The data that i am selecting in the box is not getting stored in the database. But when i am not using the drop down box the rest of the data is getting stored…

---

## [\*name in Rails routes?](https://www.ruby-forum.com/t/name-in-rails-routes/119290)

<div class="topic-metadata">

**Author:** [@acampos](https://www.ruby-forum.com/u/acampos)\
**Replies:** 1\
**Last updated:** [November 6, 2007, 2:56pm UTC](https://www.ruby-forum.com/t/name-in-rails-routes/119290 "2007-11-06T14:56:06Z")

</div>

I’ve created a route with a trailing \*name component like this map.connect ‘foo/bar/\*path’ which will hopefully map routes of the form foo/bar/u/f/a to :controller =\> foo :action -\> bar :path =\> \[“u”, “f”, “a”\] Ho…

---

## [Newbie question](https://www.ruby-forum.com/t/newbie-question/119343)

<div class="topic-metadata">

**Author:** [@remco](https://www.ruby-forum.com/u/remco)\
**Replies:** 2\
**Last updated:** [November 6, 2007, 2:38pm UTC](https://www.ruby-forum.com/t/newbie-question/119343 "2007-11-06T14:38:00Z")

</div>

Hi there, I my edit-user-page i have the following code and this works fine. Kwalificaties \<% for education in Education.find(:all) %\> \<%= check\_box\_tag "user\[education\_ids\]\[\]", education.id, @user.education…

---

## [Accounts with multiple users and routing](https://www.ruby-forum.com/t/accounts-with-multiple-users-and-routing/119371)

<div class="topic-metadata">

**Author:** [@gmlk](https://www.ruby-forum.com/u/gmlk)\
**Replies:** 0\
**Last updated:** [November 6, 2007, 2:07pm UTC](https://www.ruby-forum.com/t/accounts-with-multiple-users-and-routing/119371 "2007-11-06T14:07:35Z")

</div>

I’m building an application where a person/group can make an account and then create users within this account. The idear is to store al the data with a :account\_id so that users can only see the data which belongs to…

---

## [Primary key storing strings](https://www.ruby-forum.com/t/primary-key-storing-strings/119361)

<div class="topic-metadata">

**Author:** [@Kless](https://www.ruby-forum.com/u/Kless)\
**Replies:** 4\
**Last updated:** [November 6, 2007, 1:54pm UTC](https://www.ruby-forum.com/t/primary-key-storing-strings/119361 "2007-11-06T13:54:05Z")

</div>

Can a ‘:primary\_key’ to store strings or has to be integers? t.primary\_key :text\_code

---

## [Barcode Generation : Code 128](https://www.ruby-forum.com/t/barcode-generation-code-128/119307)

<div class="topic-metadata">

**Author:** [@leei](https://www.ruby-forum.com/u/leei)\
**Replies:** 2\
**Last updated:** [November 6, 2007, 1:12pm UTC](https://www.ruby-forum.com/t/barcode-generation-code-128/119307 "2007-11-06T13:12:29Z")

</div>

Anyone know of any libraries for creating code 128 barcodes ? Ideally we would like to include them in a PDF form. Any suggestions greatly appreciated.

---

## [Urgent! responds\_to\_parent error](https://www.ruby-forum.com/t/urgent-responds-to-parent-error/119357)

<div class="topic-metadata">

**Author:** [@zaid](https://www.ruby-forum.com/u/zaid)\
**Replies:** 3\
**Last updated:** [November 6, 2007, 1:03pm UTC](https://www.ruby-forum.com/t/urgent-responds-to-parent-error/119357 "2007-11-06T13:03:07Z")

</div>

Hello I am trying to upload a picture and refrecar layer with responds\_to\_parent. I have this form rhtml \<% form\_for(photo, :url =\> {:action =\> “create”, :tID =\> params\[:tID\] }, :html =\> { :multipart =\> true, :target…

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

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