# Rails

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

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

---

## [Run Ruby Code Stored in DB](https://www.ruby-forum.com/t/run-ruby-code-stored-in-db/170697)

<div class="topic-metadata">

**Author:** [@Ritvvij](https://www.ruby-forum.com/u/Ritvvij)\
**Replies:** 4\
**Last updated:** [June 21, 2009, 6:27pm UTC](https://www.ruby-forum.com/t/run-ruby-code-stored-in-db/170697 "2009-06-21T18:27:22Z")

</div>

Hi, I have a module which needs configurable rule. This piece of code, something as small as, “current\_user.chapter\_id”, etc has been stored in the DB. I fetch this code into the helper class and then need to run it …

---

## [More than one criteria in business logic](https://www.ruby-forum.com/t/more-than-one-criteria-in-business-logic/170688)

<div class="topic-metadata">

**Author:** [@talex83](https://www.ruby-forum.com/u/talex83)\
**Replies:** 3\
**Last updated:** [June 21, 2009, 4:06pm UTC](https://www.ruby-forum.com/t/more-than-one-criteria-in-business-logic/170688 "2009-06-21T16:06:42Z")

</div>

Hello all! I’m looking to get some help answering a design problem I’m facing. I’m definitely familiar with how models house all the business logic, but when it RoR, I’m somewhat confused :slight\_smile: If I have Us…

---

## [Routing issue](https://www.ruby-forum.com/t/routing-issue/196974)

<div class="topic-metadata">

**Author:** [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Replies:** 0\
**Last updated:** [June 21, 2009, 2:41pm UTC](https://www.ruby-forum.com/t/routing-issue/196974 "2009-06-21T14:41:08Z")

</div>

I have presently this in my routes.rb map.resources :media\_containers , :has\_many=\> \[:media\_items\] as the media\_items can have ‘libraries’ and ‘medias’ inheritances (STI) rather than writing a route for a new med…

---

## [Routing issue](https://www.ruby-forum.com/t/routing-issue/170698)

<div class="topic-metadata">

**Author:** [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Replies:** 0\
**Last updated:** [June 21, 2009, 2:35pm UTC](https://www.ruby-forum.com/t/routing-issue/170698 "2009-06-21T14:35:17Z")

</div>

I have presently this in my routes.rb map.resources :media\_containers , :has\_many=\> \[:media\_items\] as the media\_items can have ‘libraries’ and ‘medias’ inheritances (STI) rather than writing a route for a new med…

---

## [Block pop-up for rails apps](https://www.ruby-forum.com/t/block-pop-up-for-rails-apps/169037)

<div class="topic-metadata">

**Author:** [@shuaib85](https://www.ruby-forum.com/u/shuaib85)\
**Replies:** 8\
**Last updated:** [June 21, 2009, 8:22am UTC](https://www.ruby-forum.com/t/block-pop-up-for-rails-apps/169037 "2009-06-21T08:22:25Z")

</div>

Hi all Sometimes on some ISP, my application pop ups some ads for that company. However, some other websites do not get the pop up when I open the website using the same ISP. Is there a way that I can block those pop…

---

## [Best practices to pass in Conditions to Rake task?](https://www.ruby-forum.com/t/best-practices-to-pass-in-conditions-to-rake-task/170687)

<div class="topic-metadata">

**Author:** [@mgiorno](https://www.ruby-forum.com/u/mgiorno)\
**Replies:** 0\
**Last updated:** [June 21, 2009, 7:10am UTC](https://www.ruby-forum.com/t/best-practices-to-pass-in-conditions-to-rake-task/170687 "2009-06-21T07:10:30Z")

</div>

I’m trying to pass in conditions to a find command in a rake task. I’m still a little new to this, but what is the best practices for this? Should I be passing in a hash or… Any suggestions welcome! command line: …

---

## [RuntimeError when "ruby script/server"](https://www.ruby-forum.com/t/runtimeerror-when-ruby-script-server/170621)

<div class="topic-metadata">

**Author:** [@sebas](https://www.ruby-forum.com/u/sebas)\
**Replies:** 5\
**Last updated:** [June 21, 2009, 3:21am UTC](https://www.ruby-forum.com/t/runtimeerror-when-ruby-script-server/170621 "2009-06-21T03:21:42Z")

</div>

Hello everybody! Although I’ve programming for a long time, I am new with Ruby, as well as with RoR. I find both really interesting, therefore I want to start playing with them. I managed to get everything working p…

---

## [Template problem](https://www.ruby-forum.com/t/template-problem/170679)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [June 21, 2009, 2:23am UTC](https://www.ruby-forum.com/t/template-problem/170679 "2009-06-21T02:23:50Z")

</div>

So this works from the command line: script/plugin install git://github.com/rails/acts\_as\_tree.git BUT this doesn’t work inside a template: plugin “acts\_as\_tree”, :git=\>“git://github.com/rails/ acts\_as\_tree.git”, :su…

---

## [State Management Rails](https://www.ruby-forum.com/t/state-management-rails/170671)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [June 21, 2009, 1:00am UTC](https://www.ruby-forum.com/t/state-management-rails/170671 "2009-06-21T01:00:13Z")

</div>

Hi, I’m new to rails and I have a question about how to manage state in rails application in general. How would I solve the following szenario: I have an application in which a user has to fill out a html form. This…

---

## [Error trying to install rubygems on Ubuntu](https://www.ruby-forum.com/t/error-trying-to-install-rubygems-on-ubuntu/170677)

<div class="topic-metadata">

**Author:** [@rickm](https://www.ruby-forum.com/u/rickm)\
**Replies:** 0\
**Last updated:** [June 20, 2009, 11:50pm UTC](https://www.ruby-forum.com/t/error-trying-to-install-rubygems-on-ubuntu/170677 "2009-06-20T23:50:02Z")

</div>

I downloaded and unpacked rubygems-1.3.4 and when I try to execute setup I get the following message. sudo ruby setup.rb ./lib/rubygems.rb:11:in require': no such file to load -- etc (LoadError) from ./lib/rubygems.rb…

---

## [\[Rails 2.3\] nested\_attributes and validation of nested model](https://www.ruby-forum.com/t/rails-2-3-nested-attributes-and-validation-of-nested-model/170678)

<div class="topic-metadata">

**Author:** [@lis2](https://www.ruby-forum.com/u/lis2)\
**Replies:** 0\
**Last updated:** [June 20, 2009, 11:33pm UTC](https://www.ruby-forum.com/t/rails-2-3-nested-attributes-and-validation-of-nested-model/170678 "2009-06-20T23:33:03Z")

</div>

Hi, I’m using nested models to create form in my view. It looks like this: \<% form\_for :user, :url =\> {:action =\> “add\_owner” }, :html =\> { :method =\> :post } do |u| %\> Name: \<%= u.text\_field :name %\> Surname: \<%= …

---

## [Can't modify frozen hash when upgrade to rails 2.3.2](https://www.ruby-forum.com/t/cant-modify-frozen-hash-when-upgrade-to-rails-2-3-2/170673)

<div class="topic-metadata">

**Author:** [@skumar](https://www.ruby-forum.com/u/skumar)\
**Replies:** 0\
**Last updated:** [June 20, 2009, 9:43pm UTC](https://www.ruby-forum.com/t/cant-modify-frozen-hash-when-upgrade-to-rails-2-3-2/170673 "2009-06-20T21:43:31Z")

</div>

Hi, When I upgraded my rails application to rails 2.3.2 I am getting error ‘can’t modify frozen hash’ on using @something.update\_attribute(params\[:something\]). Can anyone help me who is familiarize with this bug? Th…

---

## [STI or MTI design?](https://www.ruby-forum.com/t/sti-or-mti-design/170669)

<div class="topic-metadata">

**Author:** [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Replies:** 0\
**Last updated:** [June 20, 2009, 8:05pm UTC](https://www.ruby-forum.com/t/sti-or-mti-design/170669 "2009-06-20T20:05:11Z")

</div>

I am trying to implement a directory structure (Libraries can contain other Libraries or Documents) using the plugin ‘awesome\_nested\_set’ if lfe was simple (only Libraries) it would be over already, but I don’t see …

---

## [Problem with simlpe captcha](https://www.ruby-forum.com/t/problem-with-simlpe-captcha/170668)

<div class="topic-metadata">

**Author:** [@skumar](https://www.ruby-forum.com/u/skumar)\
**Replies:** 0\
**Last updated:** [June 20, 2009, 6:32pm UTC](https://www.ruby-forum.com/t/problem-with-simlpe-captcha/170668 "2009-06-20T18:32:04Z")

</div>

Hi simple captcha works fine on my app. recently I changed my hosting provider and moved the app to new server. Here its not working and throwing error ActionView::TemplateError (undefined method \`find\_by\_key’ for Si…

---

## [Can't modify frozen hash when upgrade to rails 2.3.2](https://www.ruby-forum.com/t/cant-modify-frozen-hash-when-upgrade-to-rails-2-3-2/170656)

<div class="topic-metadata">

**Author:** [@sadeesh](https://www.ruby-forum.com/u/sadeesh)\
**Replies:** 2\
**Last updated:** [June 20, 2009, 6:27pm UTC](https://www.ruby-forum.com/t/cant-modify-frozen-hash-when-upgrade-to-rails-2-3-2/170656 "2009-06-20T18:27:58Z")

</div>

Hi, When I upgraded my rails application to rails 2.3.2 I am getting error ‘can’t modify frozen hash’ on using @something.update\_attribute(params\[:something\]). Can anyone help me who is familiarize with this bug?

---

## [Privacy issues with attachment\_fu and amazon s3](https://www.ruby-forum.com/t/privacy-issues-with-attachment-fu-and-amazon-s3/170666)

<div class="topic-metadata">

**Author:** [@amin1426](https://www.ruby-forum.com/u/amin1426)\
**Replies:** 1\
**Last updated:** [June 20, 2009, 6:25pm UTC](https://www.ruby-forum.com/t/privacy-issues-with-attachment-fu-and-amazon-s3/170666 "2009-06-20T18:25:36Z")

</div>

I’ve set up attachment\_fu to save photos for my rails application to amazon s3. All works great but now I’d like to add some privacy to this. So, if one of my users downloads a photo it is only viewable by that user…

---

## [Folder path - regex](https://www.ruby-forum.com/t/folder-path-regex/170659)

<div class="topic-metadata">

**Author:** [@newb](https://www.ruby-forum.com/u/newb)\
**Replies:** 3\
**Last updated:** [June 20, 2009, 4:22pm UTC](https://www.ruby-forum.com/t/folder-path-regex/170659 "2009-06-20T16:22:16Z")

</div>

Hellow everyone… i have to validate a my folderpath field… could you people suggest any reqular expression to validate a valid path… that field should not accept input like â€œMy Documentsâ€ but should accept â€œc:…

---

## [Regular expression](https://www.ruby-forum.com/t/regular-expression/170648)

<div class="topic-metadata">

**Author:** [@newb](https://www.ruby-forum.com/u/newb)\
**Replies:** 5\
**Last updated:** [June 20, 2009, 8:18am UTC](https://www.ruby-forum.com/t/regular-expression/170648 "2009-06-20T08:18:23Z")

</div>

hi friends… in my application i have number of days field. it Should not allow user to input special characters in the field.and it Should not allow blank space in the Number of Days field. what regular expression ca…

---

## [How to configure xml.builder to call Nokogiri?](https://www.ruby-forum.com/t/how-to-configure-xml-builder-to-call-nokogiri/170647)

<div class="topic-metadata">

**Author:** [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Replies:** 0\
**Last updated:** [June 20, 2009, 3:44am UTC](https://www.ruby-forum.com/t/how-to-configure-xml-builder-to-call-nokogiri/170647 "2009-06-20T03:44:43Z")

</div>

Railsters: I’m still on the learning curve with exotic partials. I seem to understand that a file with the extension \*.xml.builder will call Builder::XmlMarkup. If so, how to configure it to call Nokogiri::Builder i…

---

## [AssociationTypeMismatch](https://www.ruby-forum.com/t/associationtypemismatch/170646)

<div class="topic-metadata">

**Author:** [@tispratik](https://www.ruby-forum.com/u/tispratik)\
**Replies:** 0\
**Last updated:** [June 20, 2009, 2:57am UTC](https://www.ruby-forum.com/t/associationtypemismatch/170646 "2009-06-20T02:57:21Z")

</div>

Am getting the following error: Modul(#36555780) expected, got String(#21132310) After doing a lot of research on the net, i found that i need to pass on the id field somehow, but i dont really know how to do it. Fol…

---

## [In\_place\_select with hash?](https://www.ruby-forum.com/t/in-place-select-with-hash/133219)

<div class="topic-metadata">

**Author:** [@editkid](https://www.ruby-forum.com/u/editkid)\
**Replies:** 4\
**Last updated:** [June 20, 2009, 12:27am UTC](https://www.ruby-forum.com/t/in-place-select-with-hash/133219 "2009-06-20T00:27:33Z")

</div>

Hi Folks, I have recently starting working with Flvorful’s Super In Place Controls (http://os.flvorful.com/super\_in\_place\_controls) and have a question with which I hope someone can help. I would like to use either t…

---

## [In a view, call a helper method from another controller](https://www.ruby-forum.com/t/in-a-view-call-a-helper-method-from-another-controller/170216)

<div class="topic-metadata">

**Author:** [@costi](https://www.ruby-forum.com/u/costi)\
**Replies:** 3\
**Last updated:** [June 19, 2009, 11:58pm UTC](https://www.ruby-forum.com/t/in-a-view-call-a-helper-method-from-another-controller/170216 "2009-06-19T23:58:28Z")

</div>

I need to call a helper method from another controller. The catch is that I have the same method name defined in my current controllers helper. Here the partial will use the the default column\_list defined in my hel…

---

## [sqlite3....Ugghhh\`](https://www.ruby-forum.com/t/sqlite3-ugghhh/170565)

<div class="topic-metadata">

**Author:** [@bloodniece](https://www.ruby-forum.com/u/bloodniece)\
**Replies:** 4\
**Last updated:** [June 19, 2009, 11:28pm UTC](https://www.ruby-forum.com/t/sqlite3-ugghhh/170565 "2009-06-19T23:28:30Z")

</div>

Hi all, I have been reading and trying all the google links/forums for 2 nights now on how to fix my issue with getting sqlite3 installed so I can use rails. Im running SLED 11. plese help! thank you! $ uname -a …

---

## [Routing woes](https://www.ruby-forum.com/t/routing-woes/170637)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 1\
**Last updated:** [June 19, 2009, 11:22pm UTC](https://www.ruby-forum.com/t/routing-woes/170637 "2009-06-19T23:22:59Z")

</div>

I am getting this error following an update: currency\_url failed to generate from { :action=\>“show”, :id=\>#\<Currency id: 138, currency\_code: “”, currency\_name: “”,…, changed\_by: “not available”\> :controller=\>“curren…

---

## [Why can't an HTML ActionMailer view share a partial with a web view?](https://www.ruby-forum.com/t/why-cant-an-html-actionmailer-view-share-a-partial-with-a-web-view/170563)

<div class="topic-metadata">

**Author:** [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Replies:** 4\
**Last updated:** [June 19, 2009, 11:17pm UTC](https://www.ruby-forum.com/t/why-cant-an-html-actionmailer-view-share-a-partial-with-a-web-view/170563 "2009-06-19T23:17:55Z")

</div>

Railsters: I’m on the second project in a row where I would like to snip out one div from a view and mail it around. I want to put the div in a partial and share the partial into the mail. Am I misunderstanding thi…

---

## [Select form helper and css attributes](https://www.ruby-forum.com/t/select-form-helper-and-css-attributes/170632)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 3\
**Last updated:** [June 19, 2009, 11:09pm UTC](https://www.ruby-forum.com/t/select-form-helper-and-css-attributes/170632 "2009-06-19T23:09:03Z")

</div>

I am writing a test suite which depends upon begin able to use the html id attribute so that the tests are display language independent. The tag supports this attribute. In fact it supports, among others, the CLASS,…

---

## [One layout - many templates](https://www.ruby-forum.com/t/one-layout-many-templates/170628)

<div class="topic-metadata">

**Author:** [@lecielbleu](https://www.ruby-forum.com/u/lecielbleu)\
**Replies:** 5\
**Last updated:** [June 19, 2009, 10:14pm UTC](https://www.ruby-forum.com/t/one-layout-many-templates/170628 "2009-06-19T22:14:28Z")

</div>

Hi , imagine that you have one layout and every point of that is made with another templates. how can i handle this situation. For example in the left column ,displaying list of subcategories depending on category whi…

---

## [Creating an all-in-one Windows installer for application deployment...?](https://www.ruby-forum.com/t/creating-an-all-in-one-windows-installer-for-application-deployment/170600)

<div class="topic-metadata">

**Author:** [@dezrtdude](https://www.ruby-forum.com/u/dezrtdude)\
**Replies:** 2\
**Last updated:** [June 19, 2009, 10:11pm UTC](https://www.ruby-forum.com/t/creating-an-all-in-one-windows-installer-for-application-deployment/170600 "2009-06-19T22:11:18Z")

</div>

Hi All, I’m in the process of deploying a rails application to Windows machines. In order to keep my sanity, I do all of my development with OS X and Linux, but the final app will actually run on Windows machines. T…

---

## [Rails environment in scripts dir](https://www.ruby-forum.com/t/rails-environment-in-scripts-dir/170629)

<div class="topic-metadata">

**Author:** [@Jedrin](https://www.ruby-forum.com/u/Jedrin)\
**Replies:** 4\
**Last updated:** [June 19, 2009, 10:09pm UTC](https://www.ruby-forum.com/t/rails-environment-in-scripts-dir/170629 "2009-06-19T22:09:45Z")

</div>

Is there an easy way I can write an independent script that gets the rails environment the way console does etc ? I’ve never seen this except through like backgroundrb etc

---

## [SQL in rails without active record?](https://www.ruby-forum.com/t/sql-in-rails-without-active-record/170611)

<div class="topic-metadata">

**Author:** [@Jedrin](https://www.ruby-forum.com/u/Jedrin)\
**Replies:** 3\
**Last updated:** [June 19, 2009, 9:19pm UTC](https://www.ruby-forum.com/t/sql-in-rails-without-active-record/170611 "2009-06-19T21:19:25Z")

</div>

How can I do sql inside of rails where active record is not involved ? I have done find\_by\_sql type things before, but they always return an active record. There may be a need on this project to do a more typical sql …

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

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