# Rails

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

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

---

## [Remove trailing zeros](https://www.ruby-forum.com/t/remove-trailing-zeros/161540)

<div class="topic-metadata">

**Author:** [@northband](https://www.ruby-forum.com/u/northband)\
**Replies:** 5\
**Last updated:** [February 27, 2009, 9:34pm UTC](https://www.ruby-forum.com/t/remove-trailing-zeros/161540 "2009-02-27T21:34:48Z")

</div>

Hi - I am working with floats and am wondering how I can trim the decimal and trailing zeros on my whole numbers. For instance, whole numbers are being displayed as 1.0, 2.0, 3.0, etc… I would like to remove the de…

---

## [Applying default conditions to a model's find, find\_by\_\*](https://www.ruby-forum.com/t/applying-default-conditions-to-a-models-find-find-by/161528)

<div class="topic-metadata">

**Author:** [@snowbird122](https://www.ruby-forum.com/u/snowbird122)\
**Replies:** 4\
**Last updated:** [February 27, 2009, 9:15pm UTC](https://www.ruby-forum.com/t/applying-default-conditions-to-a-models-find-find-by/161528 "2009-02-27T21:15:22Z")

</div>

What is the best solution for applying a default condition to a model, for example only records where active is boolean true? My initial implementation overrode the find method using with\_scope to apply the condition…

---

## [How do I access a variable defined in application.rb from within application.rhtml?](https://www.ruby-forum.com/t/how-do-i-access-a-variable-defined-in-application-rb-from-within-application-rhtml/160989)

<div class="topic-metadata">

**Author:** [@snowbird122](https://www.ruby-forum.com/u/snowbird122)\
**Replies:** 7\
**Last updated:** [February 27, 2009, 9:08pm UTC](https://www.ruby-forum.com/t/how-do-i-access-a-variable-defined-in-application-rb-from-within-application-rhtml/160989 "2009-02-27T21:08:55Z")

</div>

Title pretty much explains it. I’d like to set a variable the stores a single Model object inside of application.rb since it will be used on every single page. I’ve tried both class and instance variables, but to no…

---

## [Modify beginning\_of\_week?](https://www.ruby-forum.com/t/modify-beginning-of-week/161511)

<div class="topic-metadata">

**Author:** [@loader](https://www.ruby-forum.com/u/loader)\
**Replies:** 2\
**Last updated:** [February 27, 2009, 8:53pm UTC](https://www.ruby-forum.com/t/modify-beginning-of-week/161511 "2009-02-27T20:53:37Z")

</div>

Hello everyone! Is it possible to modify this function: beginning\_of\_week? What I want is something like this : beginning\_of\_week(0) returns Sunday beginning\_of\_week(1) returns Monday Thank you!

---

## [Stupid Question - Need to get a field from table](https://www.ruby-forum.com/t/stupid-question-need-to-get-a-field-from-table/161604)

<div class="topic-metadata">

**Author:** [@bagadoughnuts](https://www.ruby-forum.com/u/bagadoughnuts)\
**Replies:** 6\
**Last updated:** [February 27, 2009, 8:47pm UTC](https://www.ruby-forum.com/t/stupid-question-need-to-get-a-field-from-table/161604 "2009-02-27T20:47:08Z")

</div>

Hi all, I’m ashamed to ask this but I can’t figure it out. Lately my brain gets more burned out by the minute. Basically I’m trying to have a shirt have up to 2 colors. I currently have this working. When I edit a shi…

---

## [Random DBI::DatabaseError while querying SqlServer](https://www.ruby-forum.com/t/random-dbi-databaseerror-while-querying-sqlserver/161611)

<div class="topic-metadata">

**Author:** [@Seyit\_Caglar\_Abbaso](https://www.ruby-forum.com/u/Seyit_Caglar_Abbaso)\
**Replies:** 0\
**Last updated:** [February 27, 2009, 8:30pm UTC](https://www.ruby-forum.com/t/random-dbi-databaseerror-while-querying-sqlserver/161611 "2009-02-27T20:30:04Z")

</div>

First some background: Application is running on a windows XP I’m currently using Ruby version 1.8.6-26 with easy installer (I couldn’t manage to manually install 1.8.7) Rails version is 2.2.2 activerecord version …

---

## [Streamlined - inset\_table or membership in edit\_view](https://www.ruby-forum.com/t/streamlined-inset-table-or-membership-in-edit-view/161608)

<div class="topic-metadata">

**Author:** [@spacechurro](https://www.ruby-forum.com/u/spacechurro)\
**Replies:** 0\
**Last updated:** [February 27, 2009, 7:53pm UTC](https://www.ruby-forum.com/t/streamlined-inset-table-or-membership-in-edit-view/161608 "2009-02-27T19:53:42Z")

</div>

for some reason, i cannot get this to work… this is the very last piece of this entire project that is needed for completion, and it’s totally stumping me… what i have is a relationship in edit view that is showing up…

---

## [Rails array.each returning array?](https://www.ruby-forum.com/t/rails-array-each-returning-array/161605)

<div class="topic-metadata">

**Author:** [@spacechurro](https://www.ruby-forum.com/u/spacechurro)\
**Replies:** 3\
**Last updated:** [February 27, 2009, 7:52pm UTC](https://www.ruby-forum.com/t/rails-array-each-returning-array/161605 "2009-02-27T19:52:27Z")

</div>

i am having a problem with a current piece of code, and it seems like the result for each on an array might be the culprit. according to everything i have seen before, this should work: a = \[ “a”, “b”, “c” \] a.each {…

---

## [Regarding IDE](https://www.ruby-forum.com/t/regarding-ide/161429)

<div class="topic-metadata">

**Author:** [@cyrus](https://www.ruby-forum.com/u/cyrus)\
**Replies:** 10\
**Last updated:** [February 27, 2009, 7:06pm UTC](https://www.ruby-forum.com/t/regarding-ide/161429 "2009-02-27T19:06:16Z")

</div>

Hello Every one, I am using SciTE Editor which is good for ruby and rails, but I want editor with file browser in that , is any plugin available for it ? thanks

---

## [Table relation problems](https://www.ruby-forum.com/t/table-relation-problems/161596)

<div class="topic-metadata">

**Author:** [@Israel\_G](https://www.ruby-forum.com/u/Israel_G)\
**Replies:** 0\
**Last updated:** [February 27, 2009, 6:24pm UTC](https://www.ruby-forum.com/t/table-relation-problems/161596 "2009-02-27T18:24:21Z")

</div>

Hi. I need to know if it’s possible to do something like this: http://pastie.org/402205 The table game\_guesses has 2 keys for team: home\_key and guest\_key. The problem is that a normal relation would be team has\_many…

---

## [List out](https://www.ruby-forum.com/t/list-out/161566)

<div class="topic-metadata">

**Author:** [@madhavi.k](https://www.ruby-forum.com/u/madhavi.k)\
**Replies:** 2\
**Last updated:** [February 27, 2009, 6:21pm UTC](https://www.ruby-forum.com/t/list-out/161566 "2009-02-27T18:21:52Z")

</div>

In my application i have a column like description of type text area. I Installed Blacklist gem and Redcloth plugin(dependency) . when I entered blacklist words in text area what should it do?(in my application it doe…

---

## [Getting unique entries from models?](https://www.ruby-forum.com/t/getting-unique-entries-from-models/161547)

<div class="topic-metadata">

**Author:** [@mikec](https://www.ruby-forum.com/u/mikec)\
**Replies:** 2\
**Last updated:** [February 27, 2009, 6:12pm UTC](https://www.ruby-forum.com/t/getting-unique-entries-from-models/161547 "2009-02-27T18:12:21Z")

</div>

I’m using acts\_as\_taggable\_on and I want to get a list of unique taggings. How can I do this? In a more general sense, say that I have a Product model with attributes name and price. I have these: id: 1 Name: Juice …

---

## [Maintaining session data across multiple domains](https://www.ruby-forum.com/t/maintaining-session-data-across-multiple-domains/161574)

<div class="topic-metadata">

**Author:** [@adam](https://www.ruby-forum.com/u/adam)\
**Replies:** 1\
**Last updated:** [February 27, 2009, 6:11pm UTC](https://www.ruby-forum.com/t/maintaining-session-data-across-multiple-domains/161574 "2009-02-27T18:11:09Z")

</div>

I’m working on an application that can be accessed from multiple domains. I want to maintain session data across these domains, such that if a user logs in at www.domain1.com, then moves to www.domain2.com, they will…

---

## [Wierd to\_a issue](https://www.ruby-forum.com/t/wierd-to-a-issue/161589)

<div class="topic-metadata">

**Author:** [@ari](https://www.ruby-forum.com/u/ari)\
**Replies:** 0\
**Last updated:** [February 27, 2009, 5:24pm UTC](https://www.ruby-forum.com/t/wierd-to-a-issue/161589 "2009-02-27T17:24:32Z")

</div>

When I go to save a model, I get tons of these: /usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active\_record/ associations/association\_proxy.rb:214: warning: default \`to\_a’ will be obsolete It looks like the warn…

---

## [Polymorphic associations has\_many :through](https://www.ruby-forum.com/t/polymorphic-associations-has-many-through/196903)

<div class="topic-metadata">

**Author:** [@preethi](https://www.ruby-forum.com/u/preethi)\
**Replies:** 0\
**Last updated:** [February 27, 2009, 3:55pm UTC](https://www.ruby-forum.com/t/polymorphic-associations-has-many-through/196903 "2009-02-27T15:55:19Z")

</div>

Hi, I’m facing an issue in polymorphic associations when i try to to :through relationship. I’ve three models:profile,gbluser,community profile.rb belongs\_to :node ,:polymorphic =\> true belongs\_to :community,:class\_…

---

## [Simple select](https://www.ruby-forum.com/t/simple-select/161561)

<div class="topic-metadata">

**Author:** [@petan](https://www.ruby-forum.com/u/petan)\
**Replies:** 7\
**Last updated:** [February 27, 2009, 3:05pm UTC](https://www.ruby-forum.com/t/simple-select/161561 "2009-02-27T15:05:41Z")

</div>

Hi all, I have two models gallery and photo (has\_many -\> belongs\_to). Can I use this to find the primary photo for the given gallery? @gallery = @user.galleries @primary\_photo = @gallery.photos.find\_by\_primary(true).…

---

## [Replace\_html and render action?](https://www.ruby-forum.com/t/replace-html-and-render-action/161476)

<div class="topic-metadata">

**Author:** [@cojones](https://www.ruby-forum.com/u/cojones)\
**Replies:** 2\
**Last updated:** [February 27, 2009, 2:52pm UTC](https://www.ruby-forum.com/t/replace-html-and-render-action/161476 "2009-02-27T14:52:47Z")

</div>

Hey, is it possible to use replace\_html together with a render :action? This is my code: render :update do |page| page.replace\_html ‘contentBody’, render(:action =\> ‘new’) end and this is the confusing result in my…

---

## [Strict XHTML compliant ajax library](https://www.ruby-forum.com/t/strict-xhtml-compliant-ajax-library/161544)

<div class="topic-metadata">

**Author:** [@wanyixue](https://www.ruby-forum.com/u/wanyixue)\
**Replies:** 1\
**Last updated:** [February 27, 2009, 2:19pm UTC](https://www.ruby-forum.com/t/strict-xhtml-compliant-ajax-library/161544 "2009-02-27T14:19:05Z")

</div>

problem : i have to develope a app using ajax features and it has to run in an environment(web tv related) which is very strict about XHTML compliance. and ajax codes generated by rails doesnt seem to be compliant. (…

---

## [Problem with select\_tag](https://www.ruby-forum.com/t/problem-with-select-tag/161552)

<div class="topic-metadata">

**Author:** [@ple\_mazako](https://www.ruby-forum.com/u/ple_mazako)\
**Replies:** 6\
**Last updated:** [February 27, 2009, 2:07pm UTC](https://www.ruby-forum.com/t/problem-with-select-tag/161552 "2009-02-27T14:07:17Z")

</div>

i create drop-down memu for organelle by using select\_tag but problem is can’t get value for form select\_tag to database seqfeature but form.text\_field ,it’s work , i don’t understand why? pls help me #############…

---

## [Q: find :include](https://www.ruby-forum.com/t/q-find-include/161560)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 3\
**Last updated:** [February 27, 2009, 1:55pm UTC](https://www.ruby-forum.com/t/q-find-include/161560 "2009-02-27T13:55:13Z")

</div>

So I have… class Post \< ActiveRecord::Base belongs\_to :user end @posts = Post.find :all, :include=\>:user … but when I look at my logs I see this: Post Load (2.4ms) SELECT \* FROM posts User Load (0.2ms) SELECT …

---

## [Blacklist](https://www.ruby-forum.com/t/blacklist/161558)

<div class="topic-metadata">

**Author:** [@madhavi.k](https://www.ruby-forum.com/u/madhavi.k)\
**Replies:** 6\
**Last updated:** [February 27, 2009, 1:47pm UTC](https://www.ruby-forum.com/t/blacklist/161558 "2009-02-27T13:47:34Z")

</div>

hello all, I installed blacklist plugin from the link------------ http://github.com/watsonian/blacklist/tree/master. when start the server I am getting as below : C:\\Documents and Settings\\Madhavi\\Desktop\\madhavi\_mo…

---

## [Has\_many :through relationship in polymorphic associations](https://www.ruby-forum.com/t/has-many-through-relationship-in-polymorphic-associations/161565)

<div class="topic-metadata">

**Author:** [@preethi](https://www.ruby-forum.com/u/preethi)\
**Replies:** 0\
**Last updated:** [February 27, 2009, 1:44pm UTC](https://www.ruby-forum.com/t/has-many-through-relationship-in-polymorphic-associations/161565 "2009-02-27T13:44:10Z")

</div>

Hi, I’m facing an issue in polymorphic associations when i try to to :through relationship. I’ve three models:profile,gbluser,community profile.rb belongs\_to :node ,:polymorphic =\> true belongs\_to :community,:class\_…

---

## [Delete all with has\_many](https://www.ruby-forum.com/t/delete-all-with-has-many/161542)

<div class="topic-metadata">

**Author:** [@david](https://www.ruby-forum.com/u/david)\
**Replies:** 1\
**Last updated:** [February 27, 2009, 12:12pm UTC](https://www.ruby-forum.com/t/delete-all-with-has-many/161542 "2009-02-27T12:12:30Z")

</div>

Im not sure using :dependent =\> delete\_all is correct here but I want to delete all the ApptEdits when an Appointment is updated in a certain situation. so i have: @appt\_to\_edit.update\_attributes(appointment\_info) a…

---

## [Authentication and user management questions](https://www.ruby-forum.com/t/authentication-and-user-management-questions/161306)

<div class="topic-metadata">

**Author:** [@sa125](https://www.ruby-forum.com/u/sa125)\
**Replies:** 7\
**Last updated:** [February 27, 2009, 10:38am UTC](https://www.ruby-forum.com/t/authentication-and-user-management-questions/161306 "2009-02-27T10:38:54Z")

</div>

Hi - I am using a fairly standard authentication in my app (user model, before\_filter in application\_controller). This authentication is taken almost entirely from the 3rd ed. of the agile web dev w/ rails. A few que…

---

## [Rake bombs on openssl (on Ubuntu)](https://www.ruby-forum.com/t/rake-bombs-on-openssl-on-ubuntu/161516)

<div class="topic-metadata">

**Author:** [@phor\_gruber](https://www.ruby-forum.com/u/phor_gruber)\
**Replies:** 1\
**Last updated:** [February 27, 2009, 10:27am UTC](https://www.ruby-forum.com/t/rake-bombs-on-openssl-on-ubuntu/161516 "2009-02-27T10:27:45Z")

</div>

RoR-ers, I’ve bumped into an issue with ruby and ssl. I’m trying to run a rake command which aborts because it cannot find openssl.rb. I followed these steps: mkdir /rho; chown phor /rho wget ftp://ftp.ruby-lan…

---

## [Actionwebservice for rails2.2.2 / ruby 1.8.7](https://www.ruby-forum.com/t/actionwebservice-for-rails2-2-2-ruby-1-8-7/161548)

<div class="topic-metadata">

**Author:** [@wanyixue](https://www.ruby-forum.com/u/wanyixue)\
**Replies:** 1\
**Last updated:** [February 27, 2009, 10:21am UTC](https://www.ruby-forum.com/t/actionwebservice-for-rails2-2-2-ruby-1-8-7/161548 "2009-02-27T10:21:51Z")

</div>

has anyone gotten action actionwebservice to work for this config ? tried instructions from and got a “activate’: can’t activate actionpack” on server startup

---

## [Using form\_for and has\_many associations with a controller in its own subdirectory](https://www.ruby-forum.com/t/using-form-for-and-has-many-associations-with-a-controller-in-its-own-subdirectory/161553)

<div class="topic-metadata">

**Author:** [@mwalsh](https://www.ruby-forum.com/u/mwalsh)\
**Replies:** 0\
**Last updated:** [February 27, 2009, 10:18am UTC](https://www.ruby-forum.com/t/using-form-for-and-has-many-associations-with-a-controller-in-its-own-subdirectory/161553 "2009-02-27T10:18:55Z")

</div>

Hi, I’m trying to create a Blog in it’s own subdirectory for an E-commerce site. Everything is hooked up just fine for the basic posting, but when I try to add Comments, I’m getting all sorts of headaches! I’m referr…

---

## [Rails 2.2 + Apache 2.2 + RewriteBase /app = broken](https://www.ruby-forum.com/t/rails-2-2-apache-2-2-rewritebase-app-broken/161550)

<div class="topic-metadata">

**Author:** [@ari](https://www.ruby-forum.com/u/ari)\
**Replies:** 0\
**Last updated:** [February 27, 2009, 10:18am UTC](https://www.ruby-forum.com/t/rails-2-2-apache-2-2-rewritebase-app-broken/161550 "2009-02-27T10:18:19Z")

</div>

I’m trying to run a rails app under an alias like this: Alias /app /var/www/railsapp/public RewriteBase /app … I am using the same configuration that has worked for the app under Rails 1, but since I upgraded it to …

---

## [I18n with Rails 2.1](https://www.ruby-forum.com/t/i18n-with-rails-2-1/160166)

<div class="topic-metadata">

**Author:** [@zeba-momin](https://www.ruby-forum.com/u/zeba-momin)\
**Replies:** 8\
**Last updated:** [February 27, 2009, 10:13am UTC](https://www.ruby-forum.com/t/i18n-with-rails-2-1/160166 "2009-02-27T10:13:31Z")

</div>

Hi. I’m currently using Rails 2.1. But i want to use i18n to internationalize my rails application. I’m trying to install rails 2.2 using: gem update rails but it gives me an error… Can anyone please suggest…how do…

---

## [Content](https://www.ruby-forum.com/t/content/161549)

<div class="topic-metadata">

**Author:** [@madhavi.k](https://www.ruby-forum.com/u/madhavi.k)\
**Replies:** 0\
**Last updated:** [February 27, 2009, 10:13am UTC](https://www.ruby-forum.com/t/content/161549 "2009-02-27T10:13:00Z")

</div>

hello all, how to do content moderation,content authentication and content approval for rails application ? Thanks

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

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