# Rails

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

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

---

## [How to change a query "objective"](https://www.ruby-forum.com/t/how-to-change-a-query-objective/191043)

<div class="topic-metadata">

**Author:** [@steffoz](https://www.ruby-forum.com/u/steffoz)\
**Replies:** 0\
**Last updated:** [July 3, 2010, 12:13pm UTC](https://www.ruby-forum.com/t/how-to-change-a-query-objective/191043 "2010-07-03T12:13:02Z")

</div>

Quick question: Group.first.resources.joins(:tags).group(“tags.id”).select(“tags.id, count(\*)”) =\> \[#\<Resource id: 1\>, #\<Resource id: 2\>, #\<Resource id: 3\>, #\<Resource id: 4\>, #\<Resource id: 5\>\] This results in t…

---

## [Tangent question regarding Ajax best practice](https://www.ruby-forum.com/t/tangent-question-regarding-ajax-best-practice/191042)

<div class="topic-metadata">

**Author:** [@Doug\_Boude](https://www.ruby-forum.com/u/Doug_Boude)\
**Replies:** 0\
**Last updated:** [July 3, 2010, 12:13pm UTC](https://www.ruby-forum.com/t/tangent-question-regarding-ajax-best-practice/191042 "2010-07-03T12:13:02Z")

</div>

In my current project, I’m finding myself really adding meat to my global ajax responders (the global code that typically is used to indicate that some ajax activity is taking place). This is really the first time it …

---

## [Scaffolding](https://www.ruby-forum.com/t/scaffolding/190999)

<div class="topic-metadata">

**Author:** [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Replies:** 4\
**Last updated:** [July 3, 2010, 12:13pm UTC](https://www.ruby-forum.com/t/scaffolding/190999 "2010-07-03T12:13:02Z")

</div>

Hello All, I am using scaffolding but i can not figure out that how to write my own methods except CRUD. I mean i know how to use CRUD methods but if i write my own method in my controller and call that from views the…

---

## [Help with some important information about Rails](https://www.ruby-forum.com/t/help-with-some-important-information-about-rails/191048)

<div class="topic-metadata">

**Author:** [@Carlos\_Zambrano](https://www.ruby-forum.com/u/Carlos_Zambrano)\
**Replies:** 0\
**Last updated:** [July 3, 2010, 12:13pm UTC](https://www.ruby-forum.com/t/help-with-some-important-information-about-rails/191048 "2010-07-03T12:13:02Z")

</div>

Hello how are all My name is Carlos Zambrano, I’m from Ecuador and I’m doing a graduate thesis about Ruby on Rails vs Php on other frameworks such as Zend, Django and Python on Java or Struts. I would like you to he…

---

## [\*\* Execute environment rake aborted! Could not find table 'pages'](https://www.ruby-forum.com/t/execute-environment-rake-aborted-could-not-find-table-pages/191036)

<div class="topic-metadata">

**Author:** [@Geirsman](https://www.ruby-forum.com/u/Geirsman)\
**Replies:** 0\
**Last updated:** [July 3, 2010, 5:30am UTC](https://www.ruby-forum.com/t/execute-environment-rake-aborted-could-not-find-table-pages/191036 "2010-07-03T05:30:23Z")

</div>

Hey, I’ve googled this pretty thoroughly and saw a couple people with the same issue but none of the solutions worked for me. Background: I am trying to upload my Radiant CMS site to Heroku. Location: http://morning-…

---

## [Using json gem's encode instead of Rails'](https://www.ruby-forum.com/t/using-json-gems-encode-instead-of-rails/179706)

<div class="topic-metadata">

**Author:** [@rasmus](https://www.ruby-forum.com/u/rasmus)\
**Replies:** 2\
**Last updated:** [July 3, 2010, 12:23am UTC](https://www.ruby-forum.com/t/using-json-gems-encode-instead-of-rails/179706 "2010-07-03T00:23:29Z")

</div>

Hello everybody, I have two questions for you regarding the json support in Rails. Looking in “activesupport-2.3.5/lib/active\_support/json/encoding.rb” I find this comment: Hack to load json gem first so we can overw…

---

## [Second App in localhost](https://www.ruby-forum.com/t/second-app-in-localhost/190996)

<div class="topic-metadata">

**Author:** [@railsfan\_radha](https://www.ruby-forum.com/u/railsfan_radha)\
**Replies:** 7\
**Last updated:** [July 2, 2010, 10:55pm UTC](https://www.ruby-forum.com/t/second-app-in-localhost/190996 "2010-07-02T22:55:52Z")

</div>

Env: In VirtualBox / Ubuntu Lucid / current stable version of Ruby on Rails / Apache2 / Passenger I have one app called “firstapp” hosted in my localhost I think i added one entry to apache2.conf file to view this app…

---

## [Capistrano: Errorno::ETIMEDOUT](https://www.ruby-forum.com/t/capistrano-errorno-etimedout/191017)

<div class="topic-metadata">

**Author:** [@noloman](https://www.ruby-forum.com/u/noloman)\
**Replies:** 0\
**Last updated:** [July 2, 2010, 6:57pm UTC](https://www.ruby-forum.com/t/capistrano-errorno-etimedout/191017 "2010-07-02T18:57:50Z")

</div>

Hi everybody, I am trying to set up a small application to my hosting in iPage.com, but I can’t properly configure the deploy.rb file. I get the following error: C:\> cap deploy:setup executing \`deploy:setup’ execut…

---

## [Newbie redirect\_to :back related question](https://www.ruby-forum.com/t/newbie-redirect-to-back-related-question/191010)

<div class="topic-metadata">

**Author:** [@Lille](https://www.ruby-forum.com/u/Lille)\
**Replies:** 6\
**Last updated:** [July 2, 2010, 6:45pm UTC](https://www.ruby-forum.com/t/newbie-redirect-to-back-related-question/191010 "2010-07-02T18:45:17Z")

</div>

Hi, In the course of integrating an authentication module (Authlogic) into my Rails app, I’ve developed the following priority: ‘If the current user makes a url request for which they are ineligible, return the user …

---

## [Retaining file path](https://www.ruby-forum.com/t/retaining-file-path/191008)

<div class="topic-metadata">

**Author:** [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Replies:** 1\
**Last updated:** [July 2, 2010, 4:24pm UTC](https://www.ruby-forum.com/t/retaining-file-path/191008 "2010-07-02T16:24:46Z")

</div>

Hello All, I am submitting a page which consists of a file type input. So if i select file path after browsing and validation error comes out then all other info is chipped to the page but no file path. So can you guy…

---

## [Using Associations vs Child\_Model.find](https://www.ruby-forum.com/t/using-associations-vs-child-model-find/190989)

<div class="topic-metadata">

**Author:** [@khagimoto](https://www.ruby-forum.com/u/khagimoto)\
**Replies:** 4\
**Last updated:** [July 2, 2010, 3:24pm UTC](https://www.ruby-forum.com/t/using-associations-vs-child-model-find/190989 "2010-07-02T15:24:10Z")

</div>

I have a model (Parent) that has a has\_many association with another model (Child). I read that there are performance issues (relating to GC) with too many associations. I was about to add more has\_many associations…

---

## [Date issues](https://www.ruby-forum.com/t/date-issues/190986)

<div class="topic-metadata">

**Author:** [@melomane](https://www.ruby-forum.com/u/melomane)\
**Replies:** 2\
**Last updated:** [July 2, 2010, 3:08pm UTC](https://www.ruby-forum.com/t/date-issues/190986 "2010-07-02T15:08:40Z")

</div>

Hi everyone. I know that the subject I chose is general, but it is a mixture of problems. I searched a lot in the group, in AWD with Rails book and some forums and found a lot of threads but none of them solved my pro…

---

## [Close Modalpopup with RJS](https://www.ruby-forum.com/t/close-modalpopup-with-rjs/190966)

<div class="topic-metadata">

**Author:** [@kampers](https://www.ruby-forum.com/u/kampers)\
**Replies:** 6\
**Last updated:** [July 2, 2010, 12:00pm UTC](https://www.ruby-forum.com/t/close-modalpopup-with-rjs/190966 "2010-07-02T12:00:45Z")

</div>

hi guys: I’m scratching my head on this one: I have a twitter app where I’m trying to open a modalpopup with a twitter sign in, get them to sign in, then close the popup and refresh the main window. My code however r…

---

## [Rails 3 submit\_to\_remote](https://www.ruby-forum.com/t/rails-3-submit-to-remote/190930)

<div class="topic-metadata">

**Author:** [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Replies:** 1\
**Last updated:** [July 2, 2010, 5:19am UTC](https://www.ruby-forum.com/t/rails-3-submit-to-remote/190930 "2010-07-02T05:19:49Z")

</div>

How do you do ajax functions like submit\_to\_remote or link\_to\_remote to ajax update stuff on the page in rails 3?

---

## [Check for new record?](https://www.ruby-forum.com/t/check-for-new-record/190993)

<div class="topic-metadata">

**Author:** [@badnaam](https://www.ruby-forum.com/u/badnaam)\
**Replies:** 7\
**Last updated:** [July 2, 2010, 3:50am UTC](https://www.ruby-forum.com/t/check-for-new-record/190993 "2010-07-02T03:50:51Z")

</div>

Is it possible to check if the record that is about to be saved is a brand new record or an update? I am trying to do this inside a before\_save callback. I am on rails 2.3.8 Thanks

---

## [How to communicate with Rails App from external C++/C# application using REST?](https://www.ruby-forum.com/t/how-to-communicate-with-rails-app-from-external-c-c-application-using-rest/190992)

<div class="topic-metadata">

**Author:** [@Gerwin](https://www.ruby-forum.com/u/Gerwin)\
**Replies:** 1\
**Last updated:** [July 2, 2010, 2:28am UTC](https://www.ruby-forum.com/t/how-to-communicate-with-rails-app-from-external-c-c-application-using-rest/190992 "2010-07-02T02:28:54Z")

</div>

Hi, I was wondering how to communicate with my web app from e.g. a C++/C# application. I know how to use the HTTP Rest methods but was wondering about the following: How to use POST with the authenticity\_token (how …

---

## [Q on P331 in SimpleRails2 book](https://www.ruby-forum.com/t/q-on-p331-in-simplerails2-book/190991)

<div class="topic-metadata">

**Author:** [@railsfan\_radha](https://www.ruby-forum.com/u/railsfan_radha)\
**Replies:** 0\
**Last updated:** [July 2, 2010, 1:00am UTC](https://www.ruby-forum.com/t/q-on-p331-in-simplerails2-book/190991 "2010-07-02T01:00:42Z")

</div>

If anyone has read the book, Sitepoint "Simply Rails 2 " book. then… here is my mind breaking q: Page 331 Join Model Relationship: He has User Model, Story Model and Votes Model in the sample scenario which he is w…

---

## [Deploy: Developing on Windows Deploying on Linux hosting](https://www.ruby-forum.com/t/deploy-developing-on-windows-deploying-on-linux-hosting/190530)

<div class="topic-metadata">

**Author:** [@aliibrahim](https://www.ruby-forum.com/u/aliibrahim)\
**Replies:** 25\
**Last updated:** [July 2, 2010, 12:45am UTC](https://www.ruby-forum.com/t/deploy-developing-on-windows-deploying-on-linux-hosting/190530 "2010-07-02T00:45:13Z")

</div>

I am trying from a week to deploy my application. Please help me how to do this. Thanks

---

## [GIT: How to upload Rails project using GIT](https://www.ruby-forum.com/t/git-how-to-upload-rails-project-using-git/190923)

<div class="topic-metadata">

**Author:** [@aliibrahim](https://www.ruby-forum.com/u/aliibrahim)\
**Replies:** 6\
**Last updated:** [July 1, 2010, 11:44pm UTC](https://www.ruby-forum.com/t/git-how-to-upload-rails-project-using-git/190923 "2010-07-01T23:44:58Z")

</div>

I installed gem install git sudo apt-get install git-core cd to folder where my application “demo” is /home/ruby/ git init git status git add . git commit -m “First V” git config --global user.…

---

## [Can I access session variable in model](https://www.ruby-forum.com/t/can-i-access-session-variable-in-model/144087)

<div class="topic-metadata">

**Author:** [@sijo](https://www.ruby-forum.com/u/sijo)\
**Replies:** 18\
**Last updated:** [July 1, 2010, 10:18pm UTC](https://www.ruby-forum.com/t/can-i-access-session-variable-in-model/144087 "2010-07-01T22:18:55Z")

</div>

Hi can I access session variable in model? I have in the user controller code session\[:site\_id\] = @the\_site.site\_id And how can i access this in one of my active record model SDAttachment?I tried like site\_id=sessi…

---

## [Insert data into a database without user input](https://www.ruby-forum.com/t/insert-data-into-a-database-without-user-input/190978)

<div class="topic-metadata">

**Author:** [@jack](https://www.ruby-forum.com/u/jack)\
**Replies:** 3\
**Last updated:** [July 1, 2010, 9:48pm UTC](https://www.ruby-forum.com/t/insert-data-into-a-database-without-user-input/190978 "2010-07-01T21:48:42Z")

</div>

Hello there, I am new around here and have been looking over the internet for a solution but can’t find one. I am fair new to rails but have a decent understanding of it to get by and a few years experience behind me. …

---

## [List using a sql statement](https://www.ruby-forum.com/t/list-using-a-sql-statement/190841)

<div class="topic-metadata">

**Author:** [@railsfan\_radha](https://www.ruby-forum.com/u/railsfan_radha)\
**Replies:** 8\
**Last updated:** [July 1, 2010, 5:48pm UTC](https://www.ruby-forum.com/t/list-using-a-sql-statement/190841 "2010-07-01T17:48:39Z")

</div>

I have a table called category and i want to show only the records where “status = A” in my list.erb currently, my list.erb shows all records from category table. but, i would like to show only the records where statu…

---

## [Using a database record as a Find condition](https://www.ruby-forum.com/t/using-a-database-record-as-a-find-condition/190960)

<div class="topic-metadata">

**Author:** [@thebarge](https://www.ruby-forum.com/u/thebarge)\
**Replies:** 1\
**Last updated:** [July 1, 2010, 5:39pm UTC](https://www.ruby-forum.com/t/using-a-database-record-as-a-find-condition/190960 "2010-07-01T17:39:20Z")

</div>

I have a photos model which has a field for a gallery title, I have a gallery controller which currently shows all photos that don’t have an empty gallery title field. I want to have on my gallery page a photo from ea…

---

## [Booleans on new records](https://www.ruby-forum.com/t/booleans-on-new-records/190948)

<div class="topic-metadata">

**Author:** [@mercurius](https://www.ruby-forum.com/u/mercurius)\
**Replies:** 4\
**Last updated:** [July 1, 2010, 5:34pm UTC](https://www.ruby-forum.com/t/booleans-on-new-records/190948 "2010-07-01T17:34:47Z")

</div>

I have a array of Projects, which contains all Projects that have their ‘display’ object set to 1 (true). The problem is: when I create a new record, I tried changing the value of ‘display’ to false. This did not chan…

---

## [Rails3 rails console throws error](https://www.ruby-forum.com/t/rails3-rails-console-throws-error/190949)

<div class="topic-metadata">

**Author:** [@zufar](https://www.ruby-forum.com/u/zufar)\
**Replies:** 2\
**Last updated:** [July 1, 2010, 4:18pm UTC](https://www.ruby-forum.com/t/rails3-rails-console-throws-error/190949 "2010-07-01T16:18:52Z")

</div>

Hi, I am trying Rails 3 and I am using RVM to manage the ruby versions. Using RVM I had installed ruby versions 1.8.7, 1.9.1 and 1.9.2 When I do “rails console” I am getting the following error and console isn’t star…

---

## [Which one i choose .net or ror](https://www.ruby-forum.com/t/which-one-i-choose-net-or-ror/190937)

<div class="topic-metadata">

**Author:** [@palani](https://www.ruby-forum.com/u/palani)\
**Replies:** 3\
**Last updated:** [July 1, 2010, 3:12pm UTC](https://www.ruby-forum.com/t/which-one-i-choose-net-or-ror/190937 "2010-07-01T15:12:04Z")

</div>

which one i choose .net or ror i’m kumar from chennai.now i’m working as a ruby on rails programmer (3 months experience). now i want to switch my domain to .net(because more no of people told me that .net has more n…

---

## [Hi. !--s](https://www.ruby-forum.com/t/hi-s/190945)

<div class="topic-metadata">

**Author:** [@sridhar](https://www.ruby-forum.com/u/sridhar)\
**Replies:** 3\
**Last updated:** [July 1, 2010, 2:25pm UTC](https://www.ruby-forum.com/t/hi-s/190945 "2010-07-01T14:25:14Z")

</div>

Hi, I find a good website, I would like to introduce it to youï¼ŒIt will give you big surprise:excellent products,high qualityï¼Œ competitive price. If you are free, please visit it: http://icbcshop12.info . ha…

---

## [Problem with uniq option in has\_many\_polymorphs](https://www.ruby-forum.com/t/problem-with-uniq-option-in-has-many-polymorphs/190951)

<div class="topic-metadata">

**Author:** [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Replies:** 0\
**Last updated:** [July 1, 2010, 2:10pm UTC](https://www.ruby-forum.com/t/problem-with-uniq-option-in-has-many-polymorphs/190951 "2010-07-01T14:10:20Z")

</div>

hi all I have a has\_many\_polymorphs relationship that involves the following classes: class DigilearningModule \< ActiveRecord::Base has\_many\_polymorphs :members, :from =\> \[:digilearning\_titles, :lesson\_categories, …

---

## [Problem finding find current page](https://www.ruby-forum.com/t/problem-finding-find-current-page/190861)

<div class="topic-metadata">

**Author:** [@neilbain](https://www.ruby-forum.com/u/neilbain)\
**Replies:** 16\
**Last updated:** [July 1, 2010, 11:24am UTC](https://www.ruby-forum.com/t/problem-finding-find-current-page/190861 "2010-07-01T11:24:01Z")

</div>

I have this bit of code in my email.controller user = @current\_user story = @current\_story recipient = story.user It doesn’t work because @current\_story isn’t defined. How can I find the current page to make this wo…

---

## [Creating similar but non-identical pages?](https://www.ruby-forum.com/t/creating-similar-but-non-identical-pages/190941)

<div class="topic-metadata">

**Author:** [@Isak](https://www.ruby-forum.com/u/Isak)\
**Replies:** 0\
**Last updated:** [July 1, 2010, 11:01am UTC](https://www.ruby-forum.com/t/creating-similar-but-non-identical-pages/190941 "2010-07-01T11:01:31Z")

</div>

Our app has two user models, User and Admin, each with their own non- overlapping UI. Users have a reasonably simple crud page, let’s call it “foods”, and we want to add “foods template” functionality to the admin ui. …

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

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