# Rails

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

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

---

## [Writing a custom DB adapter](https://www.ruby-forum.com/t/writing-a-custom-db-adapter/168981)

<div class="topic-metadata">

**Author:** [@kretch](https://www.ruby-forum.com/u/kretch)\
**Replies:** 1\
**Last updated:** [May 28, 2009, 3:16am UTC](https://www.ruby-forum.com/t/writing-a-custom-db-adapter/168981 "2009-05-28T03:16:31Z")

</div>

Hi There. Does anybody know of a resource explaining how to write a rails adapter for a custom (say, a funky flavour of SQL, or even non-SQL) database? Thanks Kretch

---

## [Scaffolding Results Format](https://www.ruby-forum.com/t/scaffolding-results-format/168927)

<div class="topic-metadata">

**Author:** [@jayco](https://www.ruby-forum.com/u/jayco)\
**Replies:** 4\
**Last updated:** [May 27, 2009, 11:20pm UTC](https://www.ruby-forum.com/t/scaffolding-results-format/168927 "2009-05-27T23:20:18Z")

</div>

Hi Everyone, I built a scaffold and I’m having trouble getting results properly formatted. (I need to get the data into multiple columns instead of just one big column) I can’t get all of my CSS to work properly in s…

---

## [Acts\_as\_list problem](https://www.ruby-forum.com/t/acts-as-list-problem/168974)

<div class="topic-metadata">

**Author:** [@ben](https://www.ruby-forum.com/u/ben)\
**Replies:** 0\
**Last updated:** [May 27, 2009, 11:14pm UTC](https://www.ruby-forum.com/t/acts-as-list-problem/168974 "2009-05-27T23:14:54Z")

</div>

Using the acts\_as\_list pluging and I’ve hit a wall. I’m using the lock\_version column as the :version\_column. If I revert the current version to a previous one, then edit it and save it, I don’t get the next logical v…

---

## [One url with multiple controllers](https://www.ruby-forum.com/t/one-url-with-multiple-controllers/168970)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [May 27, 2009, 10:32pm UTC](https://www.ruby-forum.com/t/one-url-with-multiple-controllers/168970 "2009-05-27T22:32:37Z")

</div>

Lets say that I want to have one url that can map to two different controllers. For example /posts could map to controller ‘public/ posts’ or to the controller ‘admin/posts’ based on whether or not the user has logge…

---

## [\[ANN\] mass\_assignment plugin for ActiveRecord](https://www.ruby-forum.com/t/ann-mass-assignment-plugin-for-activerecord/168969)

<div class="topic-metadata">

**Author:** [@lance](https://www.ruby-forum.com/u/lance)\
**Replies:** 0\
**Last updated:** [May 27, 2009, 9:59pm UTC](https://www.ruby-forum.com/t/ann-mass-assignment-plugin-for-activerecord/168969 "2009-05-27T21:59:12Z")

</div>

== The Problem == The attr\_protected and attr\_accessible declarations are too static. They’re no different when a model is created vs when it’s updated, and they have no concept of user permissions. They’re also very…

---

## [Security Problem](https://www.ruby-forum.com/t/security-problem/168966)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [May 27, 2009, 9:38pm UTC](https://www.ruby-forum.com/t/security-problem/168966 "2009-05-27T21:38:07Z")

</div>

If anyone has advice that’d be great. In my app i have a show action in my video controller. I do not have any kind of caching setup at the moment that i know of. I have 2 other controllers that pretty much do the sam…

---

## [Escaping \[ \]](https://www.ruby-forum.com/t/escaping/168959)

<div class="topic-metadata">

**Author:** [@spokra](https://www.ruby-forum.com/u/spokra)\
**Replies:** 1\
**Last updated:** [May 27, 2009, 8:28pm UTC](https://www.ruby-forum.com/t/escaping/168959 "2009-05-27T20:28:51Z")

</div>

I need a label tag that is like this… Password how do i escape it in the label\_tag? \<%= label\_tag ‘user\_session\[password\]’, ‘Password’, :class =\> ‘menulogin’ %\> I keep getting \_ for \[ and \]

---

## [Searching/Sorting an Array of Hashes](https://www.ruby-forum.com/t/searching-sorting-an-array-of-hashes/168674)

<div class="topic-metadata">

**Author:** [@rjsquire](https://www.ruby-forum.com/u/rjsquire)\
**Replies:** 9\
**Last updated:** [May 27, 2009, 7:43pm UTC](https://www.ruby-forum.com/t/searching-sorting-an-array-of-hashes/168674 "2009-05-27T19:43:00Z")

</div>

I have an array of hashes that contains several fields, including first\_name and last\_name. Unfortunately, since its the result of an API call, I have no other ways to work with it. Regardless, I’m trying to build a b…

---

## [Twitter gem question - Rails application](https://www.ruby-forum.com/t/twitter-gem-question-rails-application/168931)

<div class="topic-metadata">

**Author:** [@Hemali\_C](https://www.ruby-forum.com/u/Hemali_C)\
**Replies:** 2\
**Last updated:** [May 27, 2009, 7:03pm UTC](https://www.ruby-forum.com/t/twitter-gem-question-rails-application/168931 "2009-05-27T19:03:04Z")

</div>

Hi I am using Twitter authentication in my rails application.Update on twitter timeline is working fine but I am not able to delete particular twit using status\_id I have tried with \*Client.status(@message.statusid)…

---

## [Problem rendering file when error using autocomplete field](https://www.ruby-forum.com/t/problem-rendering-file-when-error-using-autocomplete-field/168952)

<div class="topic-metadata">

**Author:** [@tni](https://www.ruby-forum.com/u/tni)\
**Replies:** 0\
**Last updated:** [May 27, 2009, 5:23pm UTC](https://www.ruby-forum.com/t/problem-rendering-file-when-error-using-autocomplete-field/168952 "2009-05-27T17:23:22Z")

</div>

Is there a way to render a file from within Rails app so it is displayed in a new browser tab/window?? I have an auto\_complete field where users can enter letters to search for last name. If some sort of database er…

---

## [How to create a GeoLocator](https://www.ruby-forum.com/t/how-to-create-a-geolocator/168950)

<div class="topic-metadata">

**Author:** [@salil](https://www.ruby-forum.com/u/salil)\
**Replies:** 0\
**Last updated:** [May 27, 2009, 5:03pm UTC](https://www.ruby-forum.com/t/how-to-create-a-geolocator/168950 "2009-05-27T17:03:47Z")

</div>

How to create a GeoLocator like this in Rails. http://www.etsy.com/geolocator.php Regards, Salil

---

## [Forcing onChange in a partial](https://www.ruby-forum.com/t/forcing-onchange-in-a-partial/168949)

<div class="topic-metadata">

**Author:** [@JannaB](https://www.ruby-forum.com/u/JannaB)\
**Replies:** 0\
**Last updated:** [May 27, 2009, 5:01pm UTC](https://www.ruby-forum.com/t/forcing-onchange-in-a-partial/168949 "2009-05-27T17:01:38Z")

</div>

I have a partial view which incorporates on onChange option in a form. It works great when I actually change the select box which it is an option to. However, when the div which contains this partial first shows, the …

---

## [Request.raw\_post into Tempfile](https://www.ruby-forum.com/t/request-raw-post-into-tempfile/168940)

<div class="topic-metadata">

**Author:** [@mokkai](https://www.ruby-forum.com/u/mokkai)\
**Replies:** 0\
**Last updated:** [May 27, 2009, 4:22pm UTC](https://www.ruby-forum.com/t/request-raw-post-into-tempfile/168940 "2009-05-27T16:22:07Z")

</div>

i have flash application ,which will give a jpg file as raw\_post from that raw\_post i am trying to store into a tempfile tempfile=Tempfile.new(“myfile.jpg”) tempfile.write(request.raw\_post) but always “tempfile.read”…

---

## [String Manipulation](https://www.ruby-forum.com/t/string-manipulation/168872)

<div class="topic-metadata">

**Author:** [@dharshannew](https://www.ruby-forum.com/u/dharshannew)\
**Replies:** 11\
**Last updated:** [May 27, 2009, 4:20pm UTC](https://www.ruby-forum.com/t/string-manipulation/168872 "2009-05-27T16:20:03Z")

</div>

Hi all, Help needed urgently Example: this could be the string. Kid games need to be both fun and educational. Aimed at ages pre-K through middle school, safe environment to discover their abilities and learn new sk…

---

## [Sunspot: Search for Ruby and Rails](https://www.ruby-forum.com/t/sunspot-search-for-ruby-and-rails/168939)

<div class="topic-metadata">

**Author:** [@msojka](https://www.ruby-forum.com/u/msojka)\
**Replies:** 0\
**Last updated:** [May 27, 2009, 4:01pm UTC](https://www.ruby-forum.com/t/sunspot-search-for-ruby-and-rails/168939 "2009-05-27T16:01:02Z")

</div>

I’ve written an article on how to use Mat B.'s Sunspot gem with Ruby and with Rails. Sunspot is an easy way to add Solr (and thus Lucene) to any application. http://www.linux-mag.com/id/7341 Martin

---

## [Replace string](https://www.ruby-forum.com/t/replace-string/168933)

<div class="topic-metadata">

**Author:** [@dharshannew](https://www.ruby-forum.com/u/dharshannew)\
**Replies:** 2\
**Last updated:** [May 27, 2009, 3:38pm UTC](https://www.ruby-forum.com/t/replace-string/168933 "2009-05-27T15:38:38Z")

</div>

hi all, i have a string need to replace every 10th blank space of the string with some special character.is it possible, the string does not have any “\\n”, one single line. suppose this is the string “i have a string…

---

## [Uncut words (string)](https://www.ruby-forum.com/t/uncut-words-string/168900)

<div class="topic-metadata">

**Author:** [@dharshannew](https://www.ruby-forum.com/u/dharshannew)\
**Replies:** 8\
**Last updated:** [May 27, 2009, 3:32pm UTC](https://www.ruby-forum.com/t/uncut-words-string/168900 "2009-05-27T15:32:10Z")

</div>

I have this paragraph as one srting , apllied below code as suggested by one of the member. words = “Kid games need to be both fun and educational. Aimed at ages pre-K through middle school, safe environment to discov…

---

## [Contingent Select Boxes - 2 Q's](https://www.ruby-forum.com/t/contingent-select-boxes-2-qs/168930)

<div class="topic-metadata">

**Author:** [@JannaB](https://www.ruby-forum.com/u/JannaB)\
**Replies:** 9\
**Last updated:** [May 27, 2009, 3:25pm UTC](https://www.ruby-forum.com/t/contingent-select-boxes-2-qs/168930 "2009-05-27T15:25:07Z")

</div>

I have a form with contingent select boxes (the state is contingent on the country selected, so when the country selected changes, the state changes – I am using the Carmen plugin for getting my state names and countr…

---

## [Problem with select\_tag and observe\_field](https://www.ruby-forum.com/t/problem-with-select-tag-and-observe-field/168905)

<div class="topic-metadata">

**Author:** [@vikas](https://www.ruby-forum.com/u/vikas)\
**Replies:** 7\
**Last updated:** [May 27, 2009, 3:05pm UTC](https://www.ruby-forum.com/t/problem-with-select-tag-and-observe-field/168905 "2009-05-27T15:05:25Z")

</div>

Hello All, I have problem with select\_tag and observe\_field. I get following error " NoMethodError in Businesses#plan\_pricing Showing app/views/businesses/\_refresh\_subscription\_types.html.haml where line #1 raised: Y…

---

## [User Interface Design Patterns](https://www.ruby-forum.com/t/user-interface-design-patterns/168924)

<div class="topic-metadata">

**Author:** [@deadinplastic](https://www.ruby-forum.com/u/deadinplastic)\
**Replies:** 0\
**Last updated:** [May 27, 2009, 1:01pm UTC](https://www.ruby-forum.com/t/user-interface-design-patterns/168924 "2009-05-27T13:01:28Z")

</div>

Hi, I don’t have a specific ROR question but since clear design is on of ROR’s main principles i’m hoping that some design folks can answer my question :). I’m working on a webbased application which uses a lot of cl…

---

## [Urgent help please!](https://www.ruby-forum.com/t/urgent-help-please/168923)

<div class="topic-metadata">

**Author:** [@dharshannew](https://www.ruby-forum.com/u/dharshannew)\
**Replies:** 8\
**Last updated:** [May 27, 2009, 12:51pm UTC](https://www.ruby-forum.com/t/urgent-help-please/168923 "2009-05-27T12:51:36Z")

</div>

have this function with whe work cuts the word inbetween which i don’t want want please help. words = “Kid games need to be both fun and educational. Aimed at ages pre-K through middle school, safe environment to disc…

---

## [Web Application Spec & Costing](https://www.ruby-forum.com/t/web-application-spec-costing/168903)

<div class="topic-metadata">

**Author:** [@Courtney](https://www.ruby-forum.com/u/Courtney)\
**Replies:** 1\
**Last updated:** [May 27, 2009, 12:22pm UTC](https://www.ruby-forum.com/t/web-application-spec-costing/168903 "2009-05-27T12:22:15Z")

</div>

Non-developer here with a new start-up, looking for a Good Samaritan. I’m working on the spec for a web application that may or may not be a complex site. I believe it is on the complex end of the spectrum, but I may …

---

## [Attachment\_fu and rails 2.3.2 no image on disk](https://www.ruby-forum.com/t/attachment-fu-and-rails-2-3-2-no-image-on-disk/168908)

<div class="topic-metadata">

**Author:** [@benol](https://www.ruby-forum.com/u/benol)\
**Replies:** 6\
**Last updated:** [May 27, 2009, 12:09pm UTC](https://www.ruby-forum.com/t/attachment-fu-and-rails-2-3-2-no-image-on-disk/168908 "2009-05-27T12:09:58Z")

</div>

Hi, After upgrade to Rails 2.3.2 I have a problem with attachments. After uploading the attachment in the images table there is a new record. But the file does not exist on the file system. has\_attachment :content\_ty…

---

## [Require\_role on a per action basis](https://www.ruby-forum.com/t/require-role-on-a-per-action-basis/168880)

<div class="topic-metadata">

**Author:** [@asplake](https://www.ruby-forum.com/u/asplake)\
**Replies:** 3\
**Last updated:** [May 27, 2009, 10:42am UTC](https://www.ruby-forum.com/t/require-role-on-a-per-action-basis/168880 "2009-05-27T10:42:08Z")

</div>

I am working on an app that has three roles (user, admin, business). I have the situation where all three roles interact with the same controller, but have access to different actions. Some actions are authorized for …

---

## [Rails 2.3 Localized Views issues with IE](https://www.ruby-forum.com/t/rails-2-3-localized-views-issues-with-ie/168708)

<div class="topic-metadata">

**Author:** [@chris](https://www.ruby-forum.com/u/chris)\
**Replies:** 1\
**Last updated:** [May 27, 2009, 9:30am UTC](https://www.ruby-forum.com/t/rails-2-3-localized-views-issues-with-ie/168708 "2009-05-27T09:30:16Z")

</div>

Hey all, Having issues under IE with localized views… whenever it tries to get a xxx.fr.html.erb IE spits out a File Download Security Warning dialog ?!? Firefox works fine… and I cant seem to find any info on the we…

---

## [Need experienced RubyOnRails developer for non-profit project](https://www.ruby-forum.com/t/need-experienced-rubyonrails-developer-for-non-profit-project/168902)

<div class="topic-metadata">

**Author:** [@Ritvvij](https://www.ruby-forum.com/u/Ritvvij)\
**Replies:** 0\
**Last updated:** [May 27, 2009, 9:30am UTC](https://www.ruby-forum.com/t/need-experienced-rubyonrails-developer-for-non-profit-project/168902 "2009-05-27T09:30:16Z")

</div>

Hi, We are looking for an experienced RubyOnRails developer whose ready to work freelance on a non-profit project. We have a “modest” budget for the project. The project is an NGO management system - which allows an …

---

## [Do you think we should make \<%= # comment %\> not cause error](https://www.ruby-forum.com/t/do-you-think-we-should-make-comment-not-cause-error/168715)

<div class="topic-metadata">

**Author:** [@winterheat](https://www.ruby-forum.com/u/winterheat)\
**Replies:** 5\
**Last updated:** [May 27, 2009, 7:30am UTC](https://www.ruby-forum.com/t/do-you-think-we-should-make-comment-not-cause-error/168715 "2009-05-27T07:30:38Z")

</div>

the code \<% # some code %\> will not cause any error, but the code \<%= # some code %\> will cause an error. the argument is that the second statement is like output \<\< and so it is an error. But I think since puts…

---

## [Nested Forms with has\_many associations with validations](https://www.ruby-forum.com/t/nested-forms-with-has-many-associations-with-validations/168894)

<div class="topic-metadata">

**Author:** [@asoto](https://www.ruby-forum.com/u/asoto)\
**Replies:** 0\
**Last updated:** [May 27, 2009, 6:27am UTC](https://www.ruby-forum.com/t/nested-forms-with-has-many-associations-with-validations/168894 "2009-05-27T06:27:08Z")

</div>

I want to have a parent model that I can add child objects (via a has\_many association) using the rails 2.3 nested form syntax. However, it seems like rails throws an error during validation of the parent model if I h…

---

## [Multi\_db](https://www.ruby-forum.com/t/multi-db/168893)

<div class="topic-metadata">

**Author:** [@erik](https://www.ruby-forum.com/u/erik)\
**Replies:** 0\
**Last updated:** [May 27, 2009, 6:07am UTC](https://www.ruby-forum.com/t/multi-db/168893 "2009-05-27T06:07:29Z")

</div>

I would like to use the multi\_db gem to connect to multiple slave databases. It looks pretty easy as long as your app has a single application database. For example: production: adapter: mysql database: a\_produc…

---

## [Two link Questions](https://www.ruby-forum.com/t/two-link-questions/168820)

<div class="topic-metadata">

**Author:** [@df-sean](https://www.ruby-forum.com/u/df-sean)\
**Replies:** 3\
**Last updated:** [May 27, 2009, 4:40am UTC](https://www.ruby-forum.com/t/two-link-questions/168820 "2009-05-27T04:40:43Z")

</div>

I want a user to be able to submit a link to an outside website. If it is an article titled say “Lakers lose to Denver.” from the New York Times, I want to create a link to the article, but have the title of the butt…

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

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