# Rails

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

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

---

## [Formatting data before ActiveRecord insertion](https://www.ruby-forum.com/t/formatting-data-before-activerecord-insertion/194480)

<div class="topic-metadata">

**Author:** [@tomfakes](https://www.ruby-forum.com/u/tomfakes)\
**Replies:** 2\
**Last updated:** [September 6, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/formatting-data-before-activerecord-insertion/194480 "2010-09-06T16:39:42Z")

</div>

Hello, Sorry if this is a noob question. I’m trying to store a hash of values (a user’s music collection) into a single database record without having to have a separate row in the db for each music track the user h…

---

## [Gem customization](https://www.ruby-forum.com/t/gem-customization/194478)

<div class="topic-metadata">

**Author:** [@badnaam](https://www.ruby-forum.com/u/badnaam)\
**Replies:** 0\
**Last updated:** [September 6, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/gem-customization/194478 "2010-09-06T16:39:40Z")

</div>

I added some caching functionality to the geokit gem and used gemcutter to create a copy ‘badnaam-geokit’. The only changed are in Geocoders.rb which works fine if I just modify it locally. However, after I published …

---

## [Dynamic Filters with AJAX (like Redmine/Trac)](https://www.ruby-forum.com/t/dynamic-filters-with-ajax-like-redmine-trac/194477)

<div class="topic-metadata">

**Author:** [@ferblape](https://www.ruby-forum.com/u/ferblape)\
**Replies:** 0\
**Last updated:** [September 6, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/dynamic-filters-with-ajax-like-redmine-trac/194477 "2010-09-06T16:39:39Z")

</div>

Hello G.s, I have a model “Person” with lots of columns (date, int, string, so on) and right now I need to make a filter for my costumer. My goal is something like this: Issues - Redmine. Or, even better: http://tr…

---

## [Using ActiveRecord Find with associations](https://www.ruby-forum.com/t/using-activerecord-find-with-associations/194408)

<div class="topic-metadata">

**Author:** [@pitosalas](https://www.ruby-forum.com/u/pitosalas)\
**Replies:** 5\
**Last updated:** [September 6, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/using-activerecord-find-with-associations/194408 "2010-09-06T16:39:39Z")

</div>

Here’s an example: class LineItem \< ActiveRecord::Base belongs\_to :order end class Order \< ActiveRecord::Base has\_many :line\_items end my\_line\_item = LineItem.find(:zipcode =\> “12345”) Order.find\_by\_line\_item(my\_…

---

## [Trying to create a collection to use for a report](https://www.ruby-forum.com/t/trying-to-create-a-collection-to-use-for-a-report/194457)

<div class="topic-metadata">

**Author:** [@adistarmid](https://www.ruby-forum.com/u/adistarmid)\
**Replies:** 1\
**Last updated:** [September 6, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/trying-to-create-a-collection-to-use-for-a-report/194457 "2010-09-06T16:39:39Z")

</div>

I have a database of people that have used a local foodbank. The problem I’m having now is that i need a way to put 2 collections into one variable, like rails does it for partials. I want a variable @oxford that does…

---

## [What does \<\> mean in a sql query?](https://www.ruby-forum.com/t/what-does-mean-in-a-sql-query/194417)

<div class="topic-metadata">

**Author:** [@pitosalas](https://www.ruby-forum.com/u/pitosalas)\
**Replies:** 4\
**Last updated:** [September 6, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/what-does-mean-in-a-sql-query/194417 "2010-09-06T16:39:39Z")

</div>

This is from the rails log: SELECT “district\_sets”.id FROM “district\_sets” WHERE (“district\_sets”.“ident” = ‘juris-60c8bcea56c0dfa02d121691e0e72152’ AND “district\_sets”.id \<\> 12) LIMIT 1 I am confused by the \<\> opera…

---

## [Suggestions on Ruby code for API](https://www.ruby-forum.com/t/suggestions-on-ruby-code-for-api/194438)

<div class="topic-metadata">

**Author:** [@arunachandu](https://www.ruby-forum.com/u/arunachandu)\
**Replies:** 1\
**Last updated:** [September 6, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/suggestions-on-ruby-code-for-api/194438 "2010-09-06T16:39:38Z")

</div>

hi , i am new to ROR i was acually trying to write Ruby code for the api blogs i have written the ruby code as Loading development environment (Rails 2.3.8) \>\> class Blogpost \< ActiveRecord::Base \>\> has\_many :ta…

---

## [Rails 2 or ralis 3, which is better for a new project in real life?](https://www.ruby-forum.com/t/rails-2-or-ralis-3-which-is-better-for-a-new-project-in-real-life/194391)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 3\
**Last updated:** [September 6, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/rails-2-or-ralis-3-which-is-better-for-a-new-project-in-real-life/194391 "2010-09-06T16:39:37Z")

</div>

Hi, Our team decided to use rails to develop our new web application project. Some of our team members think we should ues rails 3 for our new application, beacuse they have many great new features. But the others d…

---

## [Record Remote IP Address](https://www.ruby-forum.com/t/record-remote-ip-address/194376)

<div class="topic-metadata">

**Author:** [@tlangas](https://www.ruby-forum.com/u/tlangas)\
**Replies:** 1\
**Last updated:** [September 6, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/record-remote-ip-address/194376 "2010-09-06T16:39:37Z")

</div>

I’ve seen several examples online about people wanting to record the visitors remote IP Address for their own reasons. In my case I want to record the IP address from a remote computer that uses a dynamic IP address. …

---

## [CSRF protection not working with jquery ajax post request](https://www.ruby-forum.com/t/csrf-protection-not-working-with-jquery-ajax-post-request/194463)

<div class="topic-metadata">

**Author:** [@Manos](https://www.ruby-forum.com/u/Manos)\
**Replies:** 0\
**Last updated:** [September 6, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/csrf-protection-not-working-with-jquery-ajax-post-request/194463 "2010-09-06T16:39:33Z")

</div>

Hallo, I want to test the csrf protection of my application but forgery protection is not working with jquery ajax request. I have used Unobtrusive Javascript with jquery I have removed the \<%= csrf\_meta\_tag %\> so…

---

## [Store a single variable / row in database](https://www.ruby-forum.com/t/store-a-single-variable-row-in-database/194414)

<div class="topic-metadata">

**Author:** [@voxom](https://www.ruby-forum.com/u/voxom)\
**Replies:** 4\
**Last updated:** [September 6, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/store-a-single-variable-row-in-database/194414 "2010-09-06T16:39:32Z")

</div>

What would be the best way in rails to store a single variable and have it persist. Like a have a variable that says “total\_visits” that counts the total number of page loads. The only solution I can think of is havin…

---

## [Pass selected value in combo as a parameter](https://www.ruby-forum.com/t/pass-selected-value-in-combo-as-a-parameter/194382)

<div class="topic-metadata">

**Author:** [@alfa-rero](https://www.ruby-forum.com/u/alfa-rero)\
**Replies:** 3\
**Last updated:** [September 6, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/pass-selected-value-in-combo-as-a-parameter/194382 "2010-09-06T16:39:30Z")

</div>

Hi, I have a select in my form: \<%= select @issue\_type, “name”, @issue\_types.collect {|p| \[p.name, p.id\]} %\> What I need to do is execute a method passing the value selected in the combo. I’ve tried lot of things, b…

---

## [Help with routes](https://www.ruby-forum.com/t/help-with-routes/194450)

<div class="topic-metadata">

**Author:** [@zurich\_by\_night](https://www.ruby-forum.com/u/zurich_by_night)\
**Replies:** 0\
**Last updated:** [September 6, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/help-with-routes/194450 "2010-09-06T16:39:27Z")

</div>

In my view, I’ve got the following condition: \<% if current\_page? :controller =\> ‘deals’, :action =\> ‘foobar’ %\> woot \<% end %\> My route looks like: map.fobar ‘/:city.:format’, :controller =\> ‘deals’, :action =\> ‘f…

---

## [Nested form with a N-N relation and a predefined list of elements to choose](https://www.ruby-forum.com/t/nested-form-with-a-n-n-relation-and-a-predefined-list-of-elements-to-choose/194442)

<div class="topic-metadata">

**Author:** [@benoitdinocourt](https://www.ruby-forum.com/u/benoitdinocourt)\
**Replies:** 0\
**Last updated:** [September 6, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/nested-form-with-a-n-n-relation-and-a-predefined-list-of-elements-to-choose/194442 "2010-09-06T16:39:25Z")

</div>

Hi, I recently had to deal with nested form, and I found quite complex to handle it with my situation. I have a list of choices and want to allow the user to use some from a predefined list, by using checkboxes. I p…

---

## [Issues with Relationships](https://www.ruby-forum.com/t/issues-with-relationships/194361)

<div class="topic-metadata">

**Author:** [@fiveeightfive](https://www.ruby-forum.com/u/fiveeightfive)\
**Replies:** 1\
**Last updated:** [September 6, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/issues-with-relationships/194361 "2010-09-06T16:39:25Z")

</div>

You can take a look at the app I’m referring to at: http://github.com/585connor/QA So, I’ve built this question & answer app… kind of. I can get the answers to be listed on their respective questions but I cannot figu…

---

## [Ruby api code for Create blogs](https://www.ruby-forum.com/t/ruby-api-code-for-create-blogs/194439)

<div class="topic-metadata">

**Author:** [@arunachandu](https://www.ruby-forum.com/u/arunachandu)\
**Replies:** 1\
**Last updated:** [September 6, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/ruby-api-code-for-create-blogs/194439 "2010-09-06T16:39:24Z")

</div>

Hi , I am new to ROR… I am trying to write a ruby code for the already existing API for blogs . For the create action in my blogpost.rb model file validates\_presence\_of :title, :category\_id, :user\_id validates\_leng…

---

## [Memcache in prod vs dev](https://www.ruby-forum.com/t/memcache-in-prod-vs-dev/194259)

<div class="topic-metadata">

**Author:** [@badnaam](https://www.ruby-forum.com/u/badnaam)\
**Replies:** 3\
**Last updated:** [September 6, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/memcache-in-prod-vs-dev/194259 "2010-09-06T16:39:23Z")

</div>

I am using memcache for caching in my rails app and currently I have a dev and a production environment. I would like to run the dev environment without caching so that I can debug more easily but I wanna enable the c…

---

## [How to use Rspec to test Comments?](https://www.ruby-forum.com/t/how-to-use-rspec-to-test-comments/194435)

<div class="topic-metadata">

**Author:** [@kelp](https://www.ruby-forum.com/u/kelp)\
**Replies:** 0\
**Last updated:** [September 6, 2010, 1:31am UTC](https://www.ruby-forum.com/t/how-to-use-rspec-to-test-comments/194435 "2010-09-06T01:31:59Z")

</div>

Hello, My comments are currently routed inside of my articles, so my routes file looks like the following: resources :articles do resources :comments end I am trying to write an Rspec test that tests whether or not…

---

## [Installing a fork of a gem from github?](https://www.ruby-forum.com/t/installing-a-fork-of-a-gem-from-github/146400)

<div class="topic-metadata">

**Author:** [@phil](https://www.ruby-forum.com/u/phil)\
**Replies:** 3\
**Last updated:** [September 5, 2010, 9:04pm UTC](https://www.ruby-forum.com/t/installing-a-fork-of-a-gem-from-github/146400 "2010-09-05T21:04:12Z")

</div>

I haven’t quite figured out how to do this - maybe I am overthinking the problem. I want to install the ec2onrails gem. But not the one that I get when I type sudo gem install ec2onrails I want a specific one that s…

---

## [Ubuntu 10.04 on EC2](https://www.ruby-forum.com/t/ubuntu-10-04-on-ec2/194061)

<div class="topic-metadata">

**Author:** [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Replies:** 1\
**Last updated:** [September 5, 2010, 3:44pm UTC](https://www.ruby-forum.com/t/ubuntu-10-04-on-ec2/194061 "2010-09-05T15:44:04Z")

</div>

Having setup a standard phusion-passenger stack on an earlier version of Ubuntu on EC2 I’m having mysterious problems setting things up on the Canononical 10.04 release. It seems that it wants to install everything vi…

---

## [Restful\_authentication sending email on each login](https://www.ruby-forum.com/t/restful-authentication-sending-email-on-each-login/194429)

<div class="topic-metadata">

**Author:** [@dhaval\_parikh33](https://www.ruby-forum.com/u/dhaval_parikh33)\
**Replies:** 0\
**Last updated:** [September 5, 2010, 3:09pm UTC](https://www.ruby-forum.com/t/restful-authentication-sending-email-on-each-login/194429 "2010-09-05T15:09:38Z")

</div>

Hi All, I’m facing a strange problem. I’ve configured RA with default account activation email setting. All works fine but whenever user logs in, an email is sent saying your account is activated. This happens on each …

---

## [Developing a web chat using Rails 3](https://www.ruby-forum.com/t/developing-a-web-chat-using-rails-3/194425)

<div class="topic-metadata">

**Author:** [@olistik](https://www.ruby-forum.com/u/olistik)\
**Replies:** 0\
**Last updated:** [September 5, 2010, 2:26am UTC](https://www.ruby-forum.com/t/developing-a-web-chat-using-rails-3/194425 "2010-09-05T02:26:18Z")

</div>

Hi! I’m trying to develop a web chat (like the facebook one, but much simpler) that works inside Rails 3, and so I’m inquiring about the methods used for this scope. I had some success applying this guide , so now I…

---

## [Authlogic user login and register new user side-by-side](https://www.ruby-forum.com/t/authlogic-user-login-and-register-new-user-side-by-side/194359)

<div class="topic-metadata">

**Author:** [@krat](https://www.ruby-forum.com/u/krat)\
**Replies:** 1\
**Last updated:** [September 5, 2010, 12:18am UTC](https://www.ruby-forum.com/t/authlogic-user-login-and-register-new-user-side-by-side/194359 "2010-09-05T00:18:30Z")

</div>

Hello all, This is my first post in this forum. I’m mostly a Actionscript/Flash guy but am learning RoR for work and to actually work with a flash game I’m making. I was hoping someone could help me with Authlogic. …

---

## [Decimal numbers pain](https://www.ruby-forum.com/t/decimal-numbers-pain/194422)

<div class="topic-metadata">

**Author:** [@fipa](https://www.ruby-forum.com/u/fipa)\
**Replies:** 2\
**Last updated:** [September 5, 2010, 12:16am UTC](https://www.ruby-forum.com/t/decimal-numbers-pain/194422 "2010-09-05T00:16:22Z")

</div>

Hi, What do you guys use to definitely handle decimal numbers? This is getting me crazy! I use BigDecimal, but it craps out of the input number is something like “14,53”, Rails transforms it as 14.0 Any solution?

---

## [Has\_and\_belongs\_to\_many form with check\_box](https://www.ruby-forum.com/t/has-and-belongs-to-many-form-with-check-box/194402)

<div class="topic-metadata">

**Author:** [@gregm](https://www.ruby-forum.com/u/gregm)\
**Replies:** 1\
**Last updated:** [September 4, 2010, 12:37am UTC](https://www.ruby-forum.com/t/has-and-belongs-to-many-form-with-check-box/194402 "2010-09-04T00:37:14Z")

</div>

Hi, I have 2 models, user and project. When I edit my profile I wan’t to check the projects I wan’t to follow. So here is my code: \<% form\_for @user do |f| %\> … \<% for project in @projects %\> \<% fields\_for “user\[p…

---

## [Rake task rails:upgrade:check is not working on windows. Rai](https://www.ruby-forum.com/t/rake-task-railscheck-is-not-working-on-windows-rai/194406)

<div class="topic-metadata">

**Author:** [@krunal\_shah](https://www.ruby-forum.com/u/krunal_shah)\
**Replies:** 1\
**Last updated:** [September 4, 2010, 12:28am UTC](https://www.ruby-forum.com/t/rake-task-railscheck-is-not-working-on-windows-rai/194406 "2010-09-04T00:28:45Z")

</div>

Is there any solution to solve the problem of rake task rails:upgrade:check on windows ? I am getting this error … Rake task fetching failed with (working directory: C:\\projects\\testproject) rake aborted! no such fi…

---

## [Modify objectclass - Object class violation/Operations error](https://www.ruby-forum.com/t/modify-objectclass-object-class-violation-operations-error/194403)

<div class="topic-metadata">

**Author:** [@cuzic4n](https://www.ruby-forum.com/u/cuzic4n)\
**Replies:** 0\
**Last updated:** [September 3, 2010, 9:16pm UTC](https://www.ruby-forum.com/t/modify-objectclass-object-class-violation-operations-error/194403 "2010-09-03T21:16:50Z")

</div>

Summary: Is there anyway that someone has figured out how to adding/removing objectclasses to already existing entries using net-ldap 0.1.1? Detail: I am adding and deleting all sorts of ldap entries just fine. I can…

---

## [Net-ldap-0.1.1 gives invalid filter syntax cuz of parenthesi](https://www.ruby-forum.com/t/net-ldap-0-1-1-gives-invalid-filter-syntax-cuz-of-parenthesi/194401)

<div class="topic-metadata">

**Author:** [@cuzic4n](https://www.ruby-forum.com/u/cuzic4n)\
**Replies:** 0\
**Last updated:** [September 3, 2010, 8:55pm UTC](https://www.ruby-forum.com/t/net-ldap-0-1-1-gives-invalid-filter-syntax-cuz-of-parenthesi/194401 "2010-09-03T20:55:27Z")

</div>

Things like this won’t work… they fail with Invalid filter syntax filter = Net::LDAP::Filter.construct(“nisnetgrouptriple=(,user,)”) If I remove the parenthesis and it works fine. or if you use filter = Net::LDAP::Fi…

---

## [Google maps -\> sending coÃ¶rdinates](https://www.ruby-forum.com/t/google-maps-sending-coa-rdinates/194398)

<div class="topic-metadata">

**Author:** [@railsstarter](https://www.ruby-forum.com/u/railsstarter)\
**Replies:** 1\
**Last updated:** [September 3, 2010, 6:20pm UTC](https://www.ruby-forum.com/t/google-maps-sending-coa-rdinates/194398 "2010-09-03T18:20:31Z")

</div>

I need to send geo coÃ¶rdinates from a mysql database to a google maps javascript. ThereÂ´s no problem to get them into rails…But how can i send them to javascript ? I know javascript is client side so i think itÂ´s …

---

## [I have an issue that I can't solve at all](https://www.ruby-forum.com/t/i-have-an-issue-that-i-cant-solve-at-all/194392)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [September 3, 2010, 4:01pm UTC](https://www.ruby-forum.com/t/i-have-an-issue-that-i-cant-solve-at-all/194392 "2010-09-03T16:01:13Z")

</div>

Hello I have a problem, I want to switch my merb project to Rails3. Can you help to deal with it?

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

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