# Rails

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

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

---

## [Using layouts from database](https://www.ruby-forum.com/t/using-layouts-from-database/189193)

<div class="topic-metadata">

**Author:** [@swetha](https://www.ruby-forum.com/u/swetha)\
**Replies:** 0\
**Last updated:** [May 26, 2010, 1:54pm UTC](https://www.ruby-forum.com/t/using-layouts-from-database/189193 "2010-05-26T13:54:53Z")

</div>

Hi, We generally use different layouts/themes for our accounts of gmail/ orkut. In the same i want my rails application to use different layouts choosen by a user. All templates are saved in db and user can view all …

---

## [A possibly complex find](https://www.ruby-forum.com/t/a-possibly-complex-find/189144)

<div class="topic-metadata">

**Author:** [@slippy](https://www.ruby-forum.com/u/slippy)\
**Replies:** 4\
**Last updated:** [May 26, 2010, 1:30pm UTC](https://www.ruby-forum.com/t/a-possibly-complex-find/189144 "2010-05-26T13:30:17Z")

</div>

Hi, I am very new ruby on rails and I need to do what is I think is quite a complex find and I wanted to get some opinions on how to do it in a way that doesn’t hog resources. My tables look like this : CREATE TABLE …

---

## [Test not passing at server](https://www.ruby-forum.com/t/test-not-passing-at-server/189185)

<div class="topic-metadata">

**Author:** [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Replies:** 2\
**Last updated:** [May 26, 2010, 12:08pm UTC](https://www.ruby-forum.com/t/test-not-passing-at-server/189185 "2010-05-26T12:08:10Z")

</div>

Hello champs, I have a problem that all of my test cases are passing on my local machine but many of them are not passing on server. Is this usually happens or i am doing anything wrong?

---

## [Site Navigation With Polymorphic Has Many Through](https://www.ruby-forum.com/t/site-navigation-with-polymorphic-has-many-through/189167)

<div class="topic-metadata">

**Author:** [@jcain](https://www.ruby-forum.com/u/jcain)\
**Replies:** 2\
**Last updated:** [May 26, 2010, 11:50am UTC](https://www.ruby-forum.com/t/site-navigation-with-polymorphic-has-many-through/189167 "2010-05-26T11:50:46Z")

</div>

Hi, seem to keep running into a wall here. I can’t find any resources on site navigation that can deal with any model being in the nav, allow nesting, and can dynamically update. So I thought about it for a while, and…

---

## [How to pass array of values from controller to partial](https://www.ruby-forum.com/t/how-to-pass-array-of-values-from-controller-to-partial/189183)

<div class="topic-metadata">

**Author:** [@drk](https://www.ruby-forum.com/u/drk)\
**Replies:** 6\
**Last updated:** [May 26, 2010, 11:32am UTC](https://www.ruby-forum.com/t/how-to-pass-array-of-values-from-controller-to-partial/189183 "2010-05-26T11:32:45Z")

</div>

Hii I need to pass an array of vlaues from by controller to the partial. Please check my action in my controller def dispfriends @myfriend=\[\] @myfriendlogin = \[\] @myusers=\[\] i=0 @currentgroup = Group.find\_by\_id(p…

---

## [Top 10/most popular lists](https://www.ruby-forum.com/t/top-10-most-popular-lists/189107)

<div class="topic-metadata">

**Author:** [@badnaam](https://www.ruby-forum.com/u/badnaam)\
**Replies:** 5\
**Last updated:** [May 26, 2010, 10:23am UTC](https://www.ruby-forum.com/t/top-10-most-popular-lists/189107 "2010-05-26T10:23:32Z")

</div>

What’s the best way to handle views that show the top 10/most popular/ Recently updated/most commented type listing? Should I have a separate model that is populated with records from other models by a background job …

---

## [\[JOB\] Rails/Java Engineer, San Francisco, CA | 120-180k](https://www.ruby-forum.com/t/job-rails-java-engineer-san-francisco-ca-120-180k/189180)

<div class="topic-metadata">

**Author:** [@OSS](https://www.ruby-forum.com/u/OSS)\
**Replies:** 0\
**Last updated:** [May 26, 2010, 7:32am UTC](https://www.ruby-forum.com/t/job-rails-java-engineer-san-francisco-ca-120-180k/189180 "2010-05-26T07:32:38Z")

</div>

This is a full time, on-site, salaried position located in San Francisco, CA paying $120,000-180,000 + benefits. No telecommuting allowed. US Citizens or Green Card holders only please. Local candidates preferred; …

---

## [Factory Girl Alternative](https://www.ruby-forum.com/t/factory-girl-alternative/189178)

<div class="topic-metadata">

**Author:** [@ginty](https://www.ruby-forum.com/u/ginty)\
**Replies:** 13\
**Last updated:** [May 26, 2010, 6:48am UTC](https://www.ruby-forum.com/t/factory-girl-alternative/189178 "2010-05-26T06:48:45Z")

</div>

Hi All, Shameless plug here, but just released my first gem which is a simple factory plugin a la Factory Girl, but which IMHO gives you much more control of your factory logic, check it out if interested: Github: Gi…

---

## [STI and controllers](https://www.ruby-forum.com/t/sti-and-controllers/189179)

<div class="topic-metadata">

**Author:** [@tom-mac](https://www.ruby-forum.com/u/tom-mac)\
**Replies:** 0\
**Last updated:** [May 26, 2010, 6:42am UTC](https://www.ruby-forum.com/t/sti-and-controllers/189179 "2010-05-26T06:42:14Z")

</div>

Hi This is an implementation question. I have the STI models like Class FileCabinet \< ActiveRecord::Base end Class TenantFileCabinet \< FileCabinet end Class CompanyFileCabinet \< FileCabinet end And file\_cabinets …

---

## [SQLServer on Rails](https://www.ruby-forum.com/t/sqlserver-on-rails/181010)

<div class="topic-metadata">

**Author:** [@steve](https://www.ruby-forum.com/u/steve)\
**Replies:** 24\
**Last updated:** [May 26, 2010, 5:08am UTC](https://www.ruby-forum.com/t/sqlserver-on-rails/181010 "2010-05-26T05:08:03Z")

</div>

Does any one know how to setup SQLserver with ruby1.9. It was working on an earlier version and now nothing works! I have installed the gems dbi ,dbd-odbc and activerecord-odbc-adapter and can connect in straight Ru…

---

## [Does changing to\_param() have any side effect?](https://www.ruby-forum.com/t/does-changing-to-param-have-any-side-effect/189083)

<div class="topic-metadata">

**Author:** [@winterheat](https://www.ruby-forum.com/u/winterheat)\
**Replies:** 4\
**Last updated:** [May 25, 2010, 8:42pm UTC](https://www.ruby-forum.com/t/does-changing-to-param-have-any-side-effect/189083 "2010-05-25T20:42:20Z")

</div>

In some book, it is recommended that to\_param is changed to class Story \< ActiveRecord::Base def to\_param "#{id}-#{name.gsub(/\\W/, '-').downcase}" end end so that the URL is http://www.mysite.com/stories/1-c…

---

## [Params merge on for every action](https://www.ruby-forum.com/t/params-merge-on-for-every-action/189153)

<div class="topic-metadata">

**Author:** [@vladimirprieto](https://www.ruby-forum.com/u/vladimirprieto)\
**Replies:** 8\
**Last updated:** [May 25, 2010, 7:54pm UTC](https://www.ruby-forum.com/t/params-merge-on-for-every-action/189153 "2010-05-25T19:54:44Z")

</div>

hi i got to merge a hash of parameters for every action for every controller. the only thing i could image is modifying a super class method. so, how could i modify the method that take care of setting up the param…

---

## [How to handle remote\_form\_tag post either by i) ajax or ii) redirection](https://www.ruby-forum.com/t/how-to-handle-remote-form-tag-post-either-by-i-ajax-or-ii-redirection/189157)

<div class="topic-metadata">

**Author:** [@Lille](https://www.ruby-forum.com/u/Lille)\
**Replies:** 3\
**Last updated:** [May 25, 2010, 7:48pm UTC](https://www.ruby-forum.com/t/how-to-handle-remote-form-tag-post-either-by-i-ajax-or-ii-redirection/189157 "2010-05-25T19:48:28Z")

</div>

Hi, I have non-model custom validation for a data input to a certain remote\_form\_tag view. I’d like to have differential responses in the controller in the following cases: when remote\_form\_tag post results fail va…

---

## [Use of \<!\[CDATA\[............\]\]\> on rxml](https://www.ruby-forum.com/t/use-of-cdata-on-rxml/189085)

<div class="topic-metadata">

**Author:** [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Replies:** 2\
**Last updated:** [May 25, 2010, 7:41pm UTC](https://www.ruby-forum.com/t/use-of-cdata-on-rxml/189085 "2010-05-25T19:41:08Z")

</div>

How can I put something like this on a rxml, in one line of code and generating only one line on the xml ?

---

## [Rails 2.3.8 Upgrade Mods](https://www.ruby-forum.com/t/rails-2-3-8-upgrade-mods/189155)

<div class="topic-metadata">

**Author:** [@dbkbali](https://www.ruby-forum.com/u/dbkbali)\
**Replies:** 0\
**Last updated:** [May 25, 2010, 5:46pm UTC](https://www.ruby-forum.com/t/rails-2-3-8-upgrade-mods/189155 "2010-05-25T17:46:07Z")

</div>

Same problem here but solved! hopefully this is helpful. Solution was to watch Ryan B. Railscast on Rails 3 XSS, and then to ensure any strings being sent out by my form and custom helpers was HTML Safe =\> Just look f…

---

## [Not work has\_many :through association](https://www.ruby-forum.com/t/not-work-has-many-through-association/189135)

<div class="topic-metadata">

**Author:** [@alexander](https://www.ruby-forum.com/u/alexander)\
**Replies:** 6\
**Last updated:** [May 25, 2010, 5:08pm UTC](https://www.ruby-forum.com/t/not-work-has-many-through-association/189135 "2010-05-25T17:08:03Z")

</div>

Not work has\_many :through association in rails 2.3.5 Models: class Role \< ActiveRecord::Base attr\_accessible :name has\_many :assignments has\_many :users, :through =\> :assignments end class User \< ActiveRecord::Ba…

---

## [How to pass javascript variable to controller](https://www.ruby-forum.com/t/how-to-pass-javascript-variable-to-controller/189115)

<div class="topic-metadata">

**Author:** [@nirosh](https://www.ruby-forum.com/u/nirosh)\
**Replies:** 5\
**Last updated:** [May 25, 2010, 5:07pm UTC](https://www.ruby-forum.com/t/how-to-pass-javascript-variable-to-controller/189115 "2010-05-25T17:07:28Z")

</div>

i have a JavaScript variable and i need to pass that to controller with the remote\_function method. how do i pass this?

---

## [Two RJS visual effects will happen at the same time?](https://www.ruby-forum.com/t/two-rjs-visual-effects-will-happen-at-the-same-time/189097)

<div class="topic-metadata">

**Author:** [@winterheat](https://www.ruby-forum.com/u/winterheat)\
**Replies:** 2\
**Last updated:** [May 25, 2010, 4:38pm UTC](https://www.ruby-forum.com/t/two-rjs-visual-effects-will-happen-at-the-same-time/189097 "2010-05-25T16:38:46Z")

</div>

I was going to change the background of a div from white to red and then from red back to white, so this is used in an RJS file: page\[:vote\_score\].visual\_effect :highlight, :startcolor =\> ‘#ffffff’, :endcolor =\> ‘#ffc…

---

## [Rake rails:freeze:gems bug in rails 2.3.5?](https://www.ruby-forum.com/t/rake-railsgems-bug-in-rails-2-3-5/189130)

<div class="topic-metadata">

**Author:** [@dale](https://www.ruby-forum.com/u/dale)\
**Replies:** 1\
**Last updated:** [May 25, 2010, 3:10pm UTC](https://www.ruby-forum.com/t/rake-railsgems-bug-in-rails-2-3-5/189130 "2010-05-25T15:10:20Z")

</div>

Hi All, Not sure if this is a bug or expected behavior. I’ve pasted my log below, but basically the first time that I run rake rails:freeze:gems, I get action\* all unpacked into app/vendor/ rails…the 2nd time I run i…

---

## [Rake 'no such file to load' but gem exists and loads](https://www.ruby-forum.com/t/rake-no-such-file-to-load-but-gem-exists-and-loads/189146)

<div class="topic-metadata">

**Author:** [@russellf](https://www.ruby-forum.com/u/russellf)\
**Replies:** 0\
**Last updated:** [May 25, 2010, 3:00pm UTC](https://www.ruby-forum.com/t/rake-no-such-file-to-load-but-gem-exists-and-loads/189146 "2010-05-25T15:00:35Z")

</div>

I’ve been working on a production app for about 3 years, and after a recent upgrade began receiving the error 'no such file to load – ’ when running rake. The files are always gems that it is trying to load during ini…

---

## [Rails 2.3.6 and Authlogic 2.1.4 or 2.1.3](https://www.ruby-forum.com/t/rails-2-3-6-and-authlogic-2-1-4-or-2-1-3/189124)

<div class="topic-metadata">

**Author:** [@Jeffrey\_LSTaylor](https://www.ruby-forum.com/u/Jeffrey_LSTaylor)\
**Replies:** 2\
**Last updated:** [May 25, 2010, 1:56pm UTC](https://www.ruby-forum.com/t/rails-2-3-6-and-authlogic-2-1-4-or-2-1-3/189124 "2010-05-25T13:56:00Z")

</div>

In the test environment, logging out and back in is not working for me. The log for the first login looks like this: Processing UserSessionsController#create (for 127.0.0.1 at 2010-05-24 19:53:57) \[POST\] Parameters:…

---

## [Rails 2.3.8 still escaping html in strings](https://www.ruby-forum.com/t/rails-2-3-8-still-escaping-html-in-strings/189141)

<div class="topic-metadata">

**Author:** [@jebw](https://www.ruby-forum.com/u/jebw)\
**Replies:** 1\
**Last updated:** [May 25, 2010, 1:04pm UTC](https://www.ruby-forum.com/t/rails-2-3-8-still-escaping-html-in-strings/189141 "2010-05-25T13:04:30Z")

</div>

Hi All, After a failed attempt to update to 2.3.7 yesterday I’ve tried again today to upgrade to 2.3.8 and whilst most of the site is working I’m still getting some content escaped. I’ve got a helper method that take…

---

## [Find\_by\_sql timestamp parameter](https://www.ruby-forum.com/t/find-by-sql-timestamp-parameter/189142)

<div class="topic-metadata">

**Author:** [@stanislavua](https://www.ruby-forum.com/u/stanislavua)\
**Replies:** 1\
**Last updated:** [May 25, 2010, 12:35pm UTC](https://www.ruby-forum.com/t/find-by-sql-timestamp-parameter/189142 "2010-05-25T12:35:13Z")

</div>

Hi In controller I have this query: @price\_stat = Price.find\_by\_sql(“select id, cost, tour\_id, unix\_timestamp(created\_at) from prices”) when I try to display result’s created\_at column I don’t have any results: \<% @…

---

## [XSS and partials in Rails 2.3.7](https://www.ruby-forum.com/t/xss-and-partials-in-rails-2-3-7/189122)

<div class="topic-metadata">

**Author:** [@dee](https://www.ruby-forum.com/u/dee)\
**Replies:** 3\
**Last updated:** [May 25, 2010, 12:33pm UTC](https://www.ruby-forum.com/t/xss-and-partials-in-rails-2-3-7/189122 "2010-05-25T12:33:28Z")

</div>

Hey all, Just wondering if there is any reason that the new XSS safety code in 2.3.7 is escaping my partials. That don’t seem right! I’ve overcome it temporarily by throwing in a “raw” like this: \<%= render raw :part…

---

## [Newbie Q - JSON](https://www.ruby-forum.com/t/newbie-q-json/189128)

<div class="topic-metadata">

**Author:** [@osshcs](https://www.ruby-forum.com/u/osshcs)\
**Replies:** 2\
**Last updated:** [May 25, 2010, 10:31am UTC](https://www.ruby-forum.com/t/newbie-q-json/189128 "2010-05-25T10:31:35Z")

</div>

The recently released Google maps API v3 returns geocoding info in json format as shown below. I am sure there is an elegant way to extract the lat/lng but I have failed to find it after many attempts - can anyone he…

---

## [Manipulating/Accessing objects that are :polymorphic =\> true](https://www.ruby-forum.com/t/manipulating-accessing-objects-that-are-polymorphic-true/151807)

<div class="topic-metadata">

**Author:** [@mrkohrea](https://www.ruby-forum.com/u/mrkohrea)\
**Replies:** 1\
**Last updated:** [May 25, 2010, 10:19am UTC](https://www.ruby-forum.com/t/manipulating-accessing-objects-that-are-polymorphic-true/151807 "2010-05-25T10:19:09Z")

</div>

I am working on an application to track warranty registrations for my employers product line. The product line includes the following products: spreaders snow\_plows skid\_steers Each of these products have differen…

---

## [ActionController::DoubleRenderError](https://www.ruby-forum.com/t/actioncontroller-doublerendererror/189091)

<div class="topic-metadata">

**Author:** [@drk](https://www.ruby-forum.com/u/drk)\
**Replies:** 3\
**Last updated:** [May 25, 2010, 8:35am UTC](https://www.ruby-forum.com/t/actioncontroller-doublerendererror/189091 "2010-05-25T08:35:13Z")

</div>

def dispfriends @myfriend=\[\] @myfriendlogin = \[\] i=0 @currentgroup = Group.find\_by\_id(params\[:groupid\]) puts @currentgroup.id @currentfriends= GroupFriend.find\_all\_by\_user\_id\_and\_group\_id(current\_user.id, @curren…

---

## [Problems with parsing params for Active Record](https://www.ruby-forum.com/t/problems-with-parsing-params-for-active-record/189109)

<div class="topic-metadata">

**Author:** [@tonymocha](https://www.ruby-forum.com/u/tonymocha)\
**Replies:** 6\
**Last updated:** [May 25, 2010, 8:33am UTC](https://www.ruby-forum.com/t/problems-with-parsing-params-for-active-record/189109 "2010-05-25T08:33:28Z")

</div>

Hi, I have come into an odd problem that I couldn’t figure out why. Basically, what I did is to save a record from the form, but there’s some field that parsed to the active record returns as nil. Example: article =…

---

## [Where to start debugging](https://www.ruby-forum.com/t/where-to-start-debugging/189123)

<div class="topic-metadata">

**Author:** [@sso](https://www.ruby-forum.com/u/sso)\
**Replies:** 1\
**Last updated:** [May 25, 2010, 5:22am UTC](https://www.ruby-forum.com/t/where-to-start-debugging/189123 "2010-05-25T05:22:46Z")

</div>

Hi, I’ve adopted a project that uses some rails features I’m not quite used to yet. (ie merb, haml) There is a snippet below. I’m not even sure what other part of the code to include to help with this. I’m open to…

---

## [Installing gem from source](https://www.ruby-forum.com/t/installing-gem-from-source/189113)

<div class="topic-metadata">

**Author:** [@pepe](https://www.ruby-forum.com/u/pepe)\
**Replies:** 7\
**Last updated:** [May 25, 2010, 4:44am UTC](https://www.ruby-forum.com/t/installing-gem-from-source/189113 "2010-05-25T04:44:34Z")

</div>

I need to install the latest actionwebservice from source. I have spent quite a bit of time looking for info on the net and reading books but couldn’t find a clear and cut set of instructions about how to do this. Th…

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

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