# Rails

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

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

---

## [Find with Inheritance](https://www.ruby-forum.com/t/find-with-inheritance/136817)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [May 6, 2008, 5:21pm UTC](https://www.ruby-forum.com/t/find-with-inheritance/136817 "2008-05-06T17:21:46Z")

</div>

Hi, I have the following structure with my models: A member inherits from a company A applicant inherits from a company An application has an applicant An application has a member I am attempting to do a find on th…

---

## [Empty\_model.to\_xml with attr\_accessor attributes?](https://www.ruby-forum.com/t/empty-model-to-xml-with-attr-accessor-attributes/136816)

<div class="topic-metadata">

**Author:** [@joergbattermann](https://www.ruby-forum.com/u/joergbattermann)\
**Replies:** 0\
**Last updated:** [May 6, 2008, 5:11pm UTC](https://www.ruby-forum.com/t/empty-model-to-xml-with-attr-accessor-attributes/136816 "2008-05-06T17:11:44Z")

</div>

Hello there, I have an empty Asset model which only contains 3 attr\_accessor attributes (:uploaded\_data, :title, :description), which I can fill just fine using form\_for etc, but when trying to do it restfully, the / …

---

## [Getaddrinfo: No address associated with nodename, help?!](https://www.ruby-forum.com/t/getaddrinfo-no-address-associated-with-nodename-help/136764)

<div class="topic-metadata">

**Author:** [@that\_guy\_a](https://www.ruby-forum.com/u/that_guy_a)\
**Replies:** 1\
**Last updated:** [May 6, 2008, 5:08pm UTC](https://www.ruby-forum.com/t/getaddrinfo-no-address-associated-with-nodename-help/136764 "2008-05-06T17:08:12Z")

</div>

Can someone explain to me why this error might be returning, and help me understand the code below: ActionMailer::Base.delivery\_method = :smtp #not using sendmail i'd prefer smtp ActionMailer::Base.server\_settings = { …

---

## [ActionController::InvalidAuthenticityToken in ClassifiedCon](https://www.ruby-forum.com/t/actioncontroller-invalidauthenticitytoken-in-classifiedcon/136763)

<div class="topic-metadata">

**Author:** [@mani](https://www.ruby-forum.com/u/mani)\
**Replies:** 2\
**Last updated:** [May 6, 2008, 5:08pm UTC](https://www.ruby-forum.com/t/actioncontroller-invalidauthenticitytoken-in-classifiedcon/136763 "2008-05-06T17:08:12Z")

</div>

I am editing a form it is taking the value but when i submit it it shows the message def edit @classified = Classified.find(params\[:id\]) end def update @classified = Classified.find(params\[:id\]) if @classified.upd…

---

## [Securring a rails app deployed with passenger](https://www.ruby-forum.com/t/securring-a-rails-app-deployed-with-passenger/136697)

<div class="topic-metadata">

**Author:** [@rasmus](https://www.ruby-forum.com/u/rasmus)\
**Replies:** 3\
**Last updated:** [May 6, 2008, 4:58pm UTC](https://www.ruby-forum.com/t/securring-a-rails-app-deployed-with-passenger/136697 "2008-05-06T16:58:40Z")

</div>

Hi guys, I want my rails app to be accessible from certain IPs only. I tried to archieve this the way I was used to it in the PHP-world (in apache vhost-setup): \<VirtualHost \*:80\> ServerName my.domain.com DocumentR…

---

## [INSERT a rercord in another model](https://www.ruby-forum.com/t/insert-a-rercord-in-another-model/136589)

<div class="topic-metadata">

**Author:** [@flaubert](https://www.ruby-forum.com/u/flaubert)\
**Replies:** 7\
**Last updated:** [May 6, 2008, 4:36pm UTC](https://www.ruby-forum.com/t/insert-a-rercord-in-another-model/136589 "2008-05-06T16:36:16Z")

</div>

Hi all, i have the following: In the products controller, i need to insert (if it doesn´t exist) the supplier\_id in the products table. The reason for this is that when a user is entering a new product, and there i…

---

## [Problems with actionwebservice](https://www.ruby-forum.com/t/problems-with-actionwebservice/136812)

<div class="topic-metadata">

**Author:** [@MingMingTian](https://www.ruby-forum.com/u/MingMingTian)\
**Replies:** 0\
**Last updated:** [May 6, 2008, 4:21pm UTC](https://www.ruby-forum.com/t/problems-with-actionwebservice/136812 "2008-05-06T16:21:06Z")

</div>

I am using Instant rails 2.0. I wanna develop some web service use actionwebservice of rails. But I don’t know how I can install it. Before I was in the rails\_app folder, I used the command: gem install actionwebservi…

---

## [500 Internal Server Error - wrong number of arguments](https://www.ruby-forum.com/t/500-internal-server-error-wrong-number-of-arguments/136808)

<div class="topic-metadata">

**Author:** [@saljamil](https://www.ruby-forum.com/u/saljamil)\
**Replies:** 3\
**Last updated:** [May 6, 2008, 3:56pm UTC](https://www.ruby-forum.com/t/500-internal-server-error-wrong-number-of-arguments/136808 "2008-05-06T15:56:06Z")

</div>

I am getting the following error: /!\\ FAILSAFE /!\\ Tue May 06 08:32:25 -0500 2008 Status: 500 Internal Server Error wrong number of arguments (2 for 0) I looked at the controller code and I am not using ruby send co…

---

## [.css.erb files?](https://www.ruby-forum.com/t/css-erb-files/136173)

<div class="topic-metadata">

**Author:** [@softf5ajivanet](https://www.ruby-forum.com/u/softf5ajivanet)\
**Replies:** 7\
**Last updated:** [May 6, 2008, 3:26pm UTC](https://www.ruby-forum.com/t/css-erb-files/136173 "2008-05-06T15:26:48Z")

</div>

hi, with Rails 2.0, we have view templates with the new .html.erb extensions, but can also have .css.erb files. does this mean i can put my css files inside my view templates like screen.css.erb or have i got the wron…

---

## [Detecting browser?](https://www.ruby-forum.com/t/detecting-browser/136786)

<div class="topic-metadata">

**Author:** [@vapor](https://www.ruby-forum.com/u/vapor)\
**Replies:** 1\
**Last updated:** [May 6, 2008, 3:19pm UTC](https://www.ruby-forum.com/t/detecting-browser/136786 "2008-05-06T15:19:09Z")

</div>

How can I detect browser using Ruby in views?

---

## [Download code](https://www.ruby-forum.com/t/download-code/196670)

<div class="topic-metadata">

**Author:** [@sunfish](https://www.ruby-forum.com/u/sunfish)\
**Replies:** 0\
**Last updated:** [May 6, 2008, 3:07pm UTC](https://www.ruby-forum.com/t/download-code/196670 "2008-05-06T15:07:50Z")

</div>

hi i am my application i want a some link in which when a user click a file from my server get downloaded to user site. please reply urgent.

---

## [Calling controller method on selecting drop down box](https://www.ruby-forum.com/t/calling-controller-method-on-selecting-drop-down-box/136770)

<div class="topic-metadata">

**Author:** [@karthikragu](https://www.ruby-forum.com/u/karthikragu)\
**Replies:** 1\
**Last updated:** [May 6, 2008, 3:05pm UTC](https://www.ruby-forum.com/t/calling-controller-method-on-selecting-drop-down-box/136770 "2008-05-06T15:05:21Z")

</div>

hi all, i want to call a method in a controller by selecting a option in drop down box.can i do it without using javascript.is there any onSelect like option which can call a method in controller.now im using se…

---

## [Rule Engine?](https://www.ruby-forum.com/t/rule-engine/197176)

<div class="topic-metadata">

**Author:** [@varunkumargoel](https://www.ruby-forum.com/u/varunkumargoel)\
**Replies:** 1\
**Last updated:** [May 6, 2008, 2:47pm UTC](https://www.ruby-forum.com/t/rule-engine/197176 "2008-05-06T14:47:50Z")

</div>

Hi, I wanna make one dynamic rule engine for that suppose i create one rule designation equals Project Leader. Now my question is that now how i will validate this rule and how i will check condition for this in cont…

---

## [Refactoring to RESTful](https://www.ruby-forum.com/t/refactoring-to-restful/226006)

<div class="topic-metadata">

**Author:** [@Mister\_Blood\_R](https://www.ruby-forum.com/u/Mister_Blood_R)\
**Replies:** 4\
**Last updated:** [May 6, 2008, 2:46pm UTC](https://www.ruby-forum.com/t/refactoring-to-restful/226006 "2008-05-06T14:46:00Z")

</div>

My name is Kyrre and I’m a 17-year-old web design student from Norway. I’ve only been doing Rails for about a month now, and because of my lack of mastery, I could sure use your help achieving my goals. This is my rem…

---

## [Keeping form content after validation fails](https://www.ruby-forum.com/t/keeping-form-content-after-validation-fails/136736)

<div class="topic-metadata">

**Author:** [@histrionics](https://www.ruby-forum.com/u/histrionics)\
**Replies:** 5\
**Last updated:** [May 6, 2008, 2:43pm UTC](https://www.ruby-forum.com/t/keeping-form-content-after-validation-fails/136736 "2008-05-06T14:43:33Z")

</div>

I have a form that has the following fields: Name Post Title Post Body The model does a validates\_presence\_of for each field, so if a user fails to enter one or all fields, it will fail validation and redirect back…

---

## [Sanitinzing text before inserting](https://www.ruby-forum.com/t/sanitinzing-text-before-inserting/136785)

<div class="topic-metadata">

**Author:** [@vinay](https://www.ruby-forum.com/u/vinay)\
**Replies:** 6\
**Last updated:** [May 6, 2008, 2:23pm UTC](https://www.ruby-forum.com/t/sanitinzing-text-before-inserting/136785 "2008-05-06T14:23:07Z")

</div>

Hi All, I am not aware of how many time this question might have propped up and how many would have answered but googling for this did not satisfy me. The issue that I am facing in one of my Rails Application is that …

---

## [Rule engine?](https://www.ruby-forum.com/t/rule-engine/196668)

<div class="topic-metadata">

**Author:** [@varunkumargoel](https://www.ruby-forum.com/u/varunkumargoel)\
**Replies:** 0\
**Last updated:** [May 6, 2008, 2:18pm UTC](https://www.ruby-forum.com/t/rule-engine/196668 "2008-05-06T14:18:14Z")

</div>

Hi, I wanna make one dynamic rule engine for that suppose i create one rule designation equals Project Leader. Now my question is that now how i will validate this rule and how i will check condition for this in cont…

---

## [Observers and notification order for associated records](https://www.ruby-forum.com/t/observers-and-notification-order-for-associated-records/136787)

<div class="topic-metadata">

**Author:** [@christos](https://www.ruby-forum.com/u/christos)\
**Replies:** 0\
**Last updated:** [May 6, 2008, 1:01pm UTC](https://www.ruby-forum.com/t/observers-and-notification-order-for-associated-records/136787 "2008-05-06T13:01:26Z")

</div>

Hi, Is it by design that the following happens, or is it an ActiveRecord bug (Rails 2.0.2)? @post = Post.find(params\[:id\]) @post.comments.build(params\[:comment\]) @post.save Assuming I have a PostObserver which obse…

---

## [Getting ip from proxy](https://www.ruby-forum.com/t/getting-ip-from-proxy/136782)

<div class="topic-metadata">

**Author:** [@splattael](https://www.ruby-forum.com/u/splattael)\
**Replies:** 0\
**Last updated:** [May 6, 2008, 12:01pm UTC](https://www.ruby-forum.com/t/getting-ip-from-proxy/136782 "2008-05-06T12:01:57Z")

</div>

I had a problem to get the ip from a proxy server. I check this in my apps request.env\[“HTTP\_CLIENT\_IP”\] request.env\[“REMOTE\_ADDR”\] request.env\[“HTTP\_X\_FORWARDED\_FOR”\] request.env\[“X\_FORWARDED\_FOR”\] but I get for t…

---

## [Imageupload through REST Webservice](https://www.ruby-forum.com/t/imageupload-through-rest-webservice/136723)

<div class="topic-metadata">

**Author:** [@sigma](https://www.ruby-forum.com/u/sigma)\
**Replies:** 5\
**Last updated:** [May 6, 2008, 9:45am UTC](https://www.ruby-forum.com/t/imageupload-through-rest-webservice/136723 "2008-05-06T09:45:47Z")

</div>

Hi together I need a REST webservices, through which I can upload pictures from a .NET client Desktop-Tool. Here the “upload”-code-snipped from the .NET client tool: … Dim imageBytes() As Byte imageBytes = ImageHel…

---

## [How can I build my own control?](https://www.ruby-forum.com/t/how-can-i-build-my-own-control/136662)

<div class="topic-metadata">

**Author:** [@mrhbq](https://www.ruby-forum.com/u/mrhbq)\
**Replies:** 3\
**Last updated:** [May 6, 2008, 4:04am UTC](https://www.ruby-forum.com/t/how-can-i-build-my-own-control/136662 "2008-05-06T04:04:18Z")

</div>

I’m a newbie. I want to build my own control (like User Control in ASP.NET), but I don’t know how… Thank you for your help!

---

## [ReSTfull depreciation of row entries](https://www.ruby-forum.com/t/restfull-depreciation-of-row-entries/136702)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 2\
**Last updated:** [May 6, 2008, 3:12am UTC](https://www.ruby-forum.com/t/restfull-depreciation-of-row-entries/136702 "2008-05-06T03:12:31Z")

</div>

In the design of a replacement application that I am working on it is required that certain historical data be retained. Similar to the idea embodied in “acts as versionable”, the technique used in the existing appli…

---

## [How can we see mysql query](https://www.ruby-forum.com/t/how-can-we-see-mysql-query/136720)

<div class="topic-metadata">

**Author:** [@manish](https://www.ruby-forum.com/u/manish)\
**Replies:** 2\
**Last updated:** [May 6, 2008, 3:04am UTC](https://www.ruby-forum.com/t/how-can-we-see-mysql-query/136720 "2008-05-06T03:04:55Z")

</div>

HI I m new to ROR… I m a PHP developer…my query is like in php when we have to see mysql query we just echo it to see it. Is there any function - method is in ROR to see what the query is running rite now.

---

## [Performance of Markaby, XmlMarkup, Haml Haiku and Malline?](https://www.ruby-forum.com/t/performance-of-markaby-xmlmarkup-haml-haiku-and-malline/127069)

<div class="topic-metadata">

**Author:** [@josh](https://www.ruby-forum.com/u/josh)\
**Replies:** 31\
**Last updated:** [May 6, 2008, 2:27am UTC](https://www.ruby-forum.com/t/performance-of-markaby-xmlmarkup-haml-haiku-and-malline/127069 "2008-05-06T02:27:42Z")

</div>

Hi all I just stumbled over some template engines that claim to make live writing clean HTML easier. I am a quite experienced HTML programmer, who has no problems creating clean, maintainable, valid XHTML code. So I …

---

## [Updating parent-child objects in a single transaction](https://www.ruby-forum.com/t/updating-parent-child-objects-in-a-single-transaction/132111)

<div class="topic-metadata">

**Author:** [@nbits](https://www.ruby-forum.com/u/nbits)\
**Replies:** 4\
**Last updated:** [May 6, 2008, 1:49am UTC](https://www.ruby-forum.com/t/updating-parent-child-objects-in-a-single-transaction/132111 "2008-05-06T01:49:30Z")

</div>

Is there any way to update a parent and child object in a single transaction without having to explicitly demarcate that transaction? I’ve got the following two objects: class CostItem \< ActiveRecord::Base has\_one :c…

---

## [Unique id in a find](https://www.ruby-forum.com/t/unique-id-in-a-find/136716)

<div class="topic-metadata">

**Author:** [@jgjgjg](https://www.ruby-forum.com/u/jgjgjg)\
**Replies:** 1\
**Last updated:** [May 6, 2008, 1:00am UTC](https://www.ruby-forum.com/t/unique-id-in-a-find/136716 "2008-05-06T01:00:53Z")

</div>

I’m trying to do something that seems easy but I can’t figure it out. I have Post.find(:all, :order =\> “created\_at desc”, :limit =\> 10) but if a user has a bunch of posts, I only want one of them to show up in the res…

---

## [Variables output in views?](https://www.ruby-forum.com/t/variables-output-in-views/136738)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [May 6, 2008, 12:39am UTC](https://www.ruby-forum.com/t/variables-output-in-views/136738 "2008-05-06T00:39:48Z")

</div>

Hi, I usually always dea with arrays this is the first time I have to deal with a regular variable… so I have in my method: def online @online = Status.count\_by\_sql “SELECT COUNT(\*) FROM status WHERE status = ‘online…

---

## [Capistrano and after/before task...what's wrong?](https://www.ruby-forum.com/t/capistrano-and-after-before-task-whats-wrong/136737)

<div class="topic-metadata">

**Author:** [@xdmx](https://www.ruby-forum.com/u/xdmx)\
**Replies:** 1\
**Last updated:** [May 6, 2008, 12:39am UTC](https://www.ruby-forum.com/t/capistrano-and-after-before-task-whats-wrong/136737 "2008-05-06T00:39:12Z")

</div>

Hi, i’m setting up capistrano, but i’ve a “little” problem to run a custom task after the finalize\_update, or after the symlink task. Actually i’ve this in my deploy.rb after :finalize\_update, :symlink\_shared\_stuff d…

---

## [Running a script in InstantRails](https://www.ruby-forum.com/t/running-a-script-in-instantrails/136729)

<div class="topic-metadata">

**Author:** [@sithadmin](https://www.ruby-forum.com/u/sithadmin)\
**Replies:** 2\
**Last updated:** [May 5, 2008, 11:54pm UTC](https://www.ruby-forum.com/t/running-a-script-in-instantrails/136729 "2008-05-05T23:54:35Z")

</div>

Hello, I have a program built in InstantRails 1.6 on Windows Server 2003. I have a script, located in the script folder. I also have a windows version of Cron, which points to that script. However, it doesn’t seem to…

---

## [Changing ActiveRecord serialize format to XML instead of YML](https://www.ruby-forum.com/t/changing-activerecord-serialize-format-to-xml-instead-of-yml/136735)

<div class="topic-metadata">

**Author:** [@glenn](https://www.ruby-forum.com/u/glenn)\
**Replies:** 0\
**Last updated:** [May 5, 2008, 11:54pm UTC](https://www.ruby-forum.com/t/changing-activerecord-serialize-format-to-xml-instead-of-yml/136735 "2008-05-05T23:54:06Z")

</div>

Hello, So far, ActiveRecord serialize is working great for me to save arbitrary data. I would like to know if there is a way to change the format of ActiveRecord serialize to XML instead of YML. I like the readabili…

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

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