# Rails

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

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

---

## [Why doesn't this helper work?](https://www.ruby-forum.com/t/why-doesnt-this-helper-work/189566)

<div class="topic-metadata">

**Author:** [@davidtl](https://www.ruby-forum.com/u/davidtl)\
**Replies:** 2\
**Last updated:** [June 3, 2010, 9:38am UTC](https://www.ruby-forum.com/t/why-doesnt-this-helper-work/189566 "2010-06-03T09:38:51Z")

</div>

So I’m cleaning up my views at the moment, and thought it’d be nice to create a couple of helpers, one that shows links if the user is logged in, and one that shows another set of links if they’re not logged in. Anywa…

---

## [Mysql driver giving problem on MAC 32 Bit](https://www.ruby-forum.com/t/mysql-driver-giving-problem-on-mac-32-bit/189523)

<div class="topic-metadata">

**Author:** [@gandhi-tush](https://www.ruby-forum.com/u/gandhi-tush)\
**Replies:** 8\
**Last updated:** [June 3, 2010, 7:46am UTC](https://www.ruby-forum.com/t/mysql-driver-giving-problem-on-mac-32-bit/189523 "2010-06-03T07:46:48Z")

</div>

HI, I have MAC operating system which is 32 bit. I am facing a problem while installing the mysql driver. I have installed mysql gem with following command:- “sudo env ARCHFLAGS=”-arch i386" gem install mysql -v=2.7 …

---

## [SMTP Configuration in Rails 2.3.4](https://www.ruby-forum.com/t/smtp-configuration-in-rails-2-3-4/189455)

<div class="topic-metadata">

**Author:** [@vasan\_cec](https://www.ruby-forum.com/u/vasan_cec)\
**Replies:** 1\
**Last updated:** [June 3, 2010, 7:43am UTC](https://www.ruby-forum.com/t/smtp-configuration-in-rails-2-3-4/189455 "2010-06-03T07:43:48Z")

</div>

Hello Everyone, I have a problem with SMTP configuration for my application. Previously I was using Rails version 1.1.6, and the SMTP settings would be configured in environment.rb as follows: ActionMailer::Base.deli…

---

## [Creating fixtures for has\_many :through](https://www.ruby-forum.com/t/creating-fixtures-for-has-many-through/189556)

<div class="topic-metadata">

**Author:** [@fearless\_fool](https://www.ruby-forum.com/u/fearless_fool)\
**Replies:** 2\
**Last updated:** [June 3, 2010, 3:24am UTC](https://www.ruby-forum.com/t/creating-fixtures-for-has-many-through/189556 "2010-06-03T03:24:07Z")

</div>

I’m stymied at how to create a fixture that establishes a has\_many :through relationship. I’ve watched the railscast at: http://media.railscasts.com/videos/081\_fixtures\_in\_rails\_2.mov … but that’s for HABTM relations…

---

## [One account several users with different privileges](https://www.ruby-forum.com/t/one-account-several-users-with-different-privileges/189509)

<div class="topic-metadata">

**Author:** [@dlucca](https://www.ruby-forum.com/u/dlucca)\
**Replies:** 3\
**Last updated:** [June 3, 2010, 2:09am UTC](https://www.ruby-forum.com/t/one-account-several-users-with-different-privileges/189509 "2010-06-03T02:09:00Z")

</div>

My app needs to have an account with several users inputting tasks on the same account. Only one of the users (the one that opened the account) will have admin privileges. I’m thinking on using Authlogic for authentic…

---

## [:joins VS :include =\> different results?](https://www.ruby-forum.com/t/joins-vs-include-different-results/189536)

<div class="topic-metadata">

**Author:** [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Replies:** 4\
**Last updated:** [June 2, 2010, 10:23pm UTC](https://www.ruby-forum.com/t/joins-vs-include-different-results/189536 "2010-06-02T22:23:51Z")

</div>

Hi there, assume that: 1 we have the following situation: Book :has\_many Pages :has\_many Illustrations ==== ===== ============= 2 certain pages have NO illustrations 3 the following 2 cases: A)…

---

## [How to pass a form DOM ID to submit\_to\_remote, just like with observe\_form?](https://www.ruby-forum.com/t/how-to-pass-a-form-dom-id-to-submit-to-remote-just-like-with-observe-form/189546)

<div class="topic-metadata">

**Author:** [@Lille](https://www.ruby-forum.com/u/Lille)\
**Replies:** 1\
**Last updated:** [June 2, 2010, 9:54pm UTC](https://www.ruby-forum.com/t/how-to-pass-a-form-dom-id-to-submit-to-remote-just-like-with-observe-form/189546 "2010-06-02T21:54:20Z")

</div>

Hi, I’d like to use submit\_to\_remote just like observe\_form: I want to supply a DOM ID to submit\_to\_remote. I’ve searched around, but I do not see any way to do this. It seems odd that I shouldn’t be able to use a fo…

---

## [Reloading page with errors](https://www.ruby-forum.com/t/reloading-page-with-errors/197139)

<div class="topic-metadata">

**Author:** [@Mlle](https://www.ruby-forum.com/u/Mlle)\
**Replies:** 1\
**Last updated:** [June 2, 2010, 9:10pm UTC](https://www.ruby-forum.com/t/reloading-page-with-errors/197139 "2010-06-02T21:10:13Z")

</div>

I use javascript to insert a nested model form into a page. If I use validation on the data entered and it reloads the page with an error displayed, the nested model form is gone because it’s not part of the original…

---

## [Only display 5 items at a time with more button](https://www.ruby-forum.com/t/only-display-5-items-at-a-time-with-more-button/189500)

<div class="topic-metadata">

**Author:** [@hazmatt](https://www.ruby-forum.com/u/hazmatt)\
**Replies:** 5\
**Last updated:** [June 2, 2010, 8:46pm UTC](https://www.ruby-forum.com/t/only-display-5-items-at-a-time-with-more-button/189500 "2010-06-02T20:46:08Z")

</div>

I have the following code: \<% @orders.reverse.each do |order| %\> \<%= link\_to\_remote( "#{order.id} #{order.name}" , :url =\> {:controller =\> 'orders', :action =\> 'show', :id =\> order.id }, :update =\> "order\_div", :met…

---

## [Combining Two Models into one form](https://www.ruby-forum.com/t/combining-two-models-into-one-form/189443)

<div class="topic-metadata">

**Author:** [@matsko](https://www.ruby-forum.com/u/matsko)\
**Replies:** 2\
**Last updated:** [June 2, 2010, 8:03pm UTC](https://www.ruby-forum.com/t/combining-two-models-into-one-form/189443 "2010-06-02T20:03:38Z")

</div>

Hey Guys. I’m very new with rails and I’ve been building a CMS application backend. All is going well, but I would like to know if this is possible? Basically I have two models: @page { id, name, number } @extended…

---

## [Multiple threads writing to the same Starling queue doesn't work?](https://www.ruby-forum.com/t/multiple-threads-writing-to-the-same-starling-queue-doesnt-work/189538)

<div class="topic-metadata">

**Author:** [@PierreW](https://www.ruby-forum.com/u/PierreW)\
**Replies:** 0\
**Last updated:** [June 2, 2010, 6:40pm UTC](https://www.ruby-forum.com/t/multiple-threads-writing-to-the-same-starling-queue-doesnt-work/189538 "2010-06-02T18:40:36Z")

</div>

Hi guys, I can’t find a clear answer to this: is it possible/correct to have several threads write to the same Starling queue at the “same time”? It doesn’t seem reliable according to my tests - but maybe I am doing …

---

## [Authorize state transitions](https://www.ruby-forum.com/t/authorize-state-transitions/182003)

<div class="topic-metadata">

**Author:** [@hjblok](https://www.ruby-forum.com/u/hjblok)\
**Replies:** 8\
**Last updated:** [June 2, 2010, 5:27pm UTC](https://www.ruby-forum.com/t/authorize-state-transitions/182003 "2010-06-02T17:27:25Z")

</div>

Does anybody know how to authorize state transitions? I’m using state\_machine in my rails app to define the state of an Article (published or unpublished). I’m also using declarative\_authorization to determine the aut…

---

## [Ajax with JQuery](https://www.ruby-forum.com/t/ajax-with-jquery/189526)

<div class="topic-metadata">

**Author:** [@jmanivannancse](https://www.ruby-forum.com/u/jmanivannancse)\
**Replies:** 1\
**Last updated:** [June 2, 2010, 3:23pm UTC](https://www.ruby-forum.com/t/ajax-with-jquery/189526 "2010-06-02T15:23:52Z")

</div>

I have used Ajax link and live validation in index.rhtml Ajax link requires JavaScript “prototype” and live validation requires “jquery”. i got “element.dispatchEvent is not a function” on the firebug console when i …

---

## [Active Record Associations and papermill](https://www.ruby-forum.com/t/active-record-associations-and-papermill/189528)

<div class="topic-metadata">

**Author:** [@DmitryPush](https://www.ruby-forum.com/u/DmitryPush)\
**Replies:** 0\
**Last updated:** [June 2, 2010, 2:44pm UTC](https://www.ruby-forum.com/t/active-record-associations-and-papermill/189528 "2010-06-02T14:44:39Z")

</div>

I have a model “Chapter” I figured out how to add assets to chapter through papermill plugin. Now the question: how can i add additional description to each asset? It can look like: chapter has\_many items item belo…

---

## [Error on rake command](https://www.ruby-forum.com/t/error-on-rake-command/189522)

<div class="topic-metadata">

**Author:** [@ziburudebian](https://www.ruby-forum.com/u/ziburudebian)\
**Replies:** 2\
**Last updated:** [June 2, 2010, 2:27pm UTC](https://www.ruby-forum.com/t/error-on-rake-command/189522 "2010-06-02T14:27:59Z")

</div>

Hi, Have you an idea about this error message when i run the rake db:migrate command under Aptana ? rake aborted! NoMethodError: undefined method \`ord’ for 0:Fixnum: SET SQL\_AUTO\_IS\_NULL=0 Thanks Here My Config : …

---

## [Argument Error?](https://www.ruby-forum.com/t/argument-error/189521)

<div class="topic-metadata">

**Author:** [@mercurius](https://www.ruby-forum.com/u/mercurius)\
**Replies:** 14\
**Last updated:** [June 2, 2010, 2:23pm UTC](https://www.ruby-forum.com/t/argument-error/189521 "2010-06-02T14:23:44Z")

</div>

View layer: \<%= thumbnail\_tag (@content\_page.picture1), :border =\> 0, :width =\> 489, :height =\> 236 %\> Helper layer: def thumbnail\_tag(picture, options = {}) link\_to(scale\_image\_tag(picture, options.merge({:border =\>…

---

## [Fixtures loading in Rails 3](https://www.ruby-forum.com/t/fixtures-loading-in-rails-3/189323)

<div class="topic-metadata">

**Author:** [@Ramos](https://www.ruby-forum.com/u/Ramos)\
**Replies:** 2\
**Last updated:** [June 2, 2010, 10:51am UTC](https://www.ruby-forum.com/t/fixtures-loading-in-rails-3/189323 "2010-06-02T10:51:04Z")

</div>

Hello folks, Anyone knows how can we load fixtures in Rails 3. Up to rails 2 there was a rake goal which performed the task rake db:fixtures:load But that disapeared with Rails 3. Any hints? Thanks, Ramos.

---

## [Is it possible to temporary cache an attribute's value in memory or do something similar?](https://www.ruby-forum.com/t/is-it-possible-to-temporary-cache-an-attributes-value-in-memory-or-do-something-similar/189510)

<div class="topic-metadata">

**Author:** [@Matthew\_Hillsboroug](https://www.ruby-forum.com/u/Matthew_Hillsboroug)\
**Replies:** 1\
**Last updated:** [June 2, 2010, 8:30am UTC](https://www.ruby-forum.com/t/is-it-possible-to-temporary-cache-an-attributes-value-in-memory-or-do-something-similar/189510 "2010-06-02T08:30:34Z")

</div>

Hello, I have a bit of code that depicts this hypothetical setup below. A class Foo which contains many Bars. Bar belongs to one and only one Foo. At some point, Foo can do a finite loop that lapses 2+ iterations. In…

---

## [Element.insert\_html is not function](https://www.ruby-forum.com/t/element-insert-html-is-not-function/189473)

<div class="topic-metadata">

**Author:** [@santoshd](https://www.ruby-forum.com/u/santoshd)\
**Replies:** 2\
**Last updated:** [June 2, 2010, 8:06am UTC](https://www.ruby-forum.com/t/element-insert-html-is-not-function/189473 "2010-06-02T08:06:40Z")

</div>

Hi I have created the application by following the railcast video However I am getting this error when I click “add element” RJS error: TypeError: Element.insert is not a function and then Element.insert(“docs”, …

---

## [Ruby on Rails installation issue](https://www.ruby-forum.com/t/ruby-on-rails-installation-issue/189477)

<div class="topic-metadata">

**Author:** [@yegeniy](https://www.ruby-forum.com/u/yegeniy)\
**Replies:** 2\
**Last updated:** [June 2, 2010, 7:11am UTC](https://www.ruby-forum.com/t/ruby-on-rails-installation-issue/189477 "2010-06-02T07:11:33Z")

</div>

Hello everyone. I am new to Rails (and Ruby) and when I was going through the example in chapter 4 of Agile Web D. on Rails, I ran into a problem. I think the issue is where rails is looking for sqlite3. Any help woul…

---

## [Creating text\_field by clicking button](https://www.ruby-forum.com/t/creating-text-field-by-clicking-button/189497)

<div class="topic-metadata">

**Author:** [@casid](https://www.ruby-forum.com/u/casid)\
**Replies:** 5\
**Last updated:** [June 1, 2010, 10:25pm UTC](https://www.ruby-forum.com/t/creating-text-field-by-clicking-button/189497 "2010-06-01T22:25:18Z")

</div>

Hi everyone, I like to learn how to create text\_field by cliking button as dynamicly. I need “add” button which creates 3 text\_fields on the same line, “height” \* “width” = “size” I like to click button and creating …

---

## [Model.find statements: SQL condition format -\> How?](https://www.ruby-forum.com/t/model-find-statements-sql-condition-format-how/189464)

<div class="topic-metadata">

**Author:** [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Replies:** 19\
**Last updated:** [June 1, 2010, 9:32pm UTC](https://www.ruby-forum.com/t/model-find-statements-sql-condition-format-how/189464 "2010-06-01T21:32:42Z")

</div>

Hi there, What’s the correct end part of “conditions” if: you assume that “Book :has\_many Authors” I’d like to have the find statement in the below format @books = Book.find(:all, :joins =\> \[:authors =\> \[…\]\], :incl…

---

## [ActiveRecord model relationship with YAML file](https://www.ruby-forum.com/t/activerecord-model-relationship-with-yaml-file/189434)

<div class="topic-metadata">

**Author:** [@judge](https://www.ruby-forum.com/u/judge)\
**Replies:** 5\
**Last updated:** [June 1, 2010, 8:34pm UTC](https://www.ruby-forum.com/t/activerecord-model-relationship-with-yaml-file/189434 "2010-06-01T20:34:57Z")

</div>

Hi, I have an ActiveRecord model Group and a YAML table stored in config/users.yaml just like: - {login: titi, password: 123456, group\_id: 2} - {login: toto, password: 987654, group\_id: 7} And I would like to link th…

---

## [Modifiying existing files in your template script](https://www.ruby-forum.com/t/modifiying-existing-files-in-your-template-script/189495)

<div class="topic-metadata">

**Author:** [@robo](https://www.ruby-forum.com/u/robo)\
**Replies:** 0\
**Last updated:** [June 1, 2010, 7:43pm UTC](https://www.ruby-forum.com/t/modifiying-existing-files-in-your-template-script/189495 "2010-06-01T19:43:51Z")

</div>

Ok, so I just started digging into template files using the command rails mynewprojectname -m templatescript.rb and it’s really, really awesome 8) What I want to do is something like this in my script - generate(:sca…

---

## [Globalize2 enhancements (dynamic writers, blcks, validtions)](https://www.ruby-forum.com/t/globalize2-enhancements-dynamic-writers-blcks-validtions/188368)

<div class="topic-metadata">

**Author:** [@dasil003](https://www.ruby-forum.com/u/dasil003)\
**Replies:** 2\
**Last updated:** [June 1, 2010, 6:51pm UTC](https://www.ruby-forum.com/t/globalize2-enhancements-dynamic-writers-blcks-validtions/188368 "2010-06-01T18:51:59Z")

</div>

Hey everyone, I am replacing some old Rails model localization with Globalize2. I am really impressed with the design of the Globalize2 plugin, but we have a pretty involved i18n setup on my site, so I’m finding a lo…

---

## [Is there a way to obtain the body of the last render?](https://www.ruby-forum.com/t/is-there-a-way-to-obtain-the-body-of-the-last-render/189442)

<div class="topic-metadata">

**Author:** [@daveh](https://www.ruby-forum.com/u/daveh)\
**Replies:** 1\
**Last updated:** [June 1, 2010, 6:40pm UTC](https://www.ruby-forum.com/t/is-there-a-way-to-obtain-the-body-of-the-last-render/189442 "2010-06-01T18:40:03Z")

</div>

Is there a way to obtain the response body of the last render in Rails3 beta3? For example, given: render :action=\>‘aaa’, :layout=\>‘bbb’ I had thought something like @\_current\_render would work but it did not, it is…

---

## [Specify filename using rails Metal](https://www.ruby-forum.com/t/specify-filename-using-rails-metal/189488)

<div class="topic-metadata">

**Author:** [@guillaume](https://www.ruby-forum.com/u/guillaume)\
**Replies:** 1\
**Last updated:** [June 1, 2010, 6:24pm UTC](https://www.ruby-forum.com/t/specify-filename-using-rails-metal/189488 "2010-06-01T18:24:14Z")

</div>

Hi, I’m using Rails Metal to serve certain files, But i don’t know how to change the filename … Here is the code in Metal where i send the file : \[200, { ‘Content-Type’ =\> file.content\_type}, \[file.read\]\] I tried to…

---

## [Leading Zeros in a Method](https://www.ruby-forum.com/t/leading-zeros-in-a-method/189482)

<div class="topic-metadata">

**Author:** [@hazmatt](https://www.ruby-forum.com/u/hazmatt)\
**Replies:** 10\
**Last updated:** [June 1, 2010, 6:04pm UTC](https://www.ruby-forum.com/t/leading-zeros-in-a-method/189482 "2010-06-01T18:04:34Z")

</div>

I found the following topic in the forum: http://www.ruby-forum.com/topic/82137 Ian J Cottee had an easy way of adding leading zeros to a number: “%05d” % an\_int I’m still new to ruby, so I wanted to know. How woul…

---

## [Welcome Board!(0.0.0.0:3000)](https://www.ruby-forum.com/t/welcome-board-0-0-0-0-3000/189481)

<div class="topic-metadata">

**Author:** [@raghu\_muni](https://www.ruby-forum.com/u/raghu_muni)\
**Replies:** 2\
**Last updated:** [June 1, 2010, 5:29pm UTC](https://www.ruby-forum.com/t/welcome-board-0-0-0-0-3000/189481 "2010-06-01T17:29:47Z")

</div>

I got stuck up with this problem. When I run the command ruby script/server,it gets me something like this… ruby script/server =\> Booting Mongrel =\> Rails 2.3.8 application starting on http://0.0.0.0:3000 =\> Call w…

---

## [Ruby with Java](https://www.ruby-forum.com/t/ruby-with-java/189472)

<div class="topic-metadata">

**Author:** [@dancook](https://www.ruby-forum.com/u/dancook)\
**Replies:** 4\
**Last updated:** [June 1, 2010, 5:07pm UTC](https://www.ruby-forum.com/t/ruby-with-java/189472 "2010-06-01T17:07:32Z")

</div>

I’ve been tasked to investigate using Ruby on Rails with Java integration, use of java libraries and being deployed on tomcat/jboss/ oc4j JRuby might seem like the obvious choice, but I still need to know the limitat…

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

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