# Rails

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

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

---

## [Rails API best practices](https://www.ruby-forum.com/t/rails-api-best-practices/150571)

<div class="topic-metadata">

**Author:** [@arvias](https://www.ruby-forum.com/u/arvias)\
**Replies:** 4\
**Last updated:** [October 10, 2008, 8:43pm UTC](https://www.ruby-forum.com/t/rails-api-best-practices/150571 "2008-10-10T20:43:36Z")

</div>

Hi, Is there a book or screencast or documentation that provides best practices for creating an API for a RoR application? I have to build an API from scratch and I have no idea where to start. – M.

---

## [Problem using non-standard port when deploying with git](https://www.ruby-forum.com/t/problem-using-non-standard-port-when-deploying-with-git/150534)

<div class="topic-metadata">

**Author:** [@justus](https://www.ruby-forum.com/u/justus)\
**Replies:** 3\
**Last updated:** [October 10, 2008, 7:41pm UTC](https://www.ruby-forum.com/t/problem-using-non-standard-port-when-deploying-with-git/150534 "2008-10-10T19:41:21Z")

</div>

Hello, What do I need to change in the deploy.rb or elsewhere in order to use a non-default port number? Everything is working fine when I use the standard port 22 on my server. I’m able to deploy my code with capist…

---

## [Using an ActiveRecord class method within an ActionMailer object](https://www.ruby-forum.com/t/using-an-activerecord-class-method-within-an-actionmailer-object/150444)

<div class="topic-metadata">

**Author:** [@gaveeno](https://www.ruby-forum.com/u/gaveeno)\
**Replies:** 8\
**Last updated:** [October 10, 2008, 7:19pm UTC](https://www.ruby-forum.com/t/using-an-activerecord-class-method-within-an-actionmailer-object/150444 "2008-10-10T19:19:38Z")

</div>

This is a little convoluted and I’m new to Rails, so please bear with me… My application needs to receive both SMS and emails. I have a controller that has a sms\_in method, which receives SMS messages via a HTTP POS…

---

## [Last piece of the pie! javascript no longer works after page.replace\_html](https://www.ruby-forum.com/t/last-piece-of-the-pie-javascript-no-longer-works-after-page-replace-html/150630)

<div class="topic-metadata">

**Author:** [@ressister](https://www.ruby-forum.com/u/ressister)\
**Replies:** 5\
**Last updated:** [October 10, 2008, 7:06pm UTC](https://www.ruby-forum.com/t/last-piece-of-the-pie-javascript-no-longer-works-after-page-replace-html/150630 "2008-10-10T19:06:45Z")

</div>

Hi there, I have one last remaining problem to solve before I’m code complete on an application I’ve been working on for a few months, and I need your help. I have a page that contains a list of entries and a form at…

---

## [Allow a "$" in a price field](https://www.ruby-forum.com/t/allow-a-in-a-price-field/150620)

<div class="topic-metadata">

**Author:** [@nick](https://www.ruby-forum.com/u/nick)\
**Replies:** 3\
**Last updated:** [October 10, 2008, 6:51pm UTC](https://www.ruby-forum.com/t/allow-a-in-a-price-field/150620 "2008-10-10T18:51:32Z")

</div>

Hi guys. My Property model has a “price” attribute, which is an integer. When creating a property, I’d like users to be able to submit “$1234” as the price, and have my app remove the “$”. I thought this could be acco…

---

## [Reply quoting in comments](https://www.ruby-forum.com/t/reply-quoting-in-comments/150616)

<div class="topic-metadata">

**Author:** [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Replies:** 1\
**Last updated:** [October 10, 2008, 6:50pm UTC](https://www.ruby-forum.com/t/reply-quoting-in-comments/150616 "2008-10-10T18:50:56Z")

</div>

Hi all, I’ve got a page that lets users leave comments about the page content. Adding comments is working fine and I will add edit/delete functionality later. I want people to have the choice whether to add a fresh c…

---

## [Deploy RoR app on CPanled Hoster](https://www.ruby-forum.com/t/deploy-ror-app-on-cpanled-hoster/150609)

<div class="topic-metadata">

**Author:** [@HSSSSlio\_Rocha](https://www.ruby-forum.com/u/HSSSSlio_Rocha)\
**Replies:** 2\
**Last updated:** [October 10, 2008, 6:46pm UTC](https://www.ruby-forum.com/t/deploy-ror-app-on-cpanled-hoster/150609 "2008-10-10T18:46:49Z")

</div>

Hi there, I’m trying to deploy a RoR app on a hoster with cpanel but the app doesn’t boot. There’s no log either. Have anybody tried to make something similar? Thanks in Advance! HJR

---

## [Script to obtain dom](https://www.ruby-forum.com/t/script-to-obtain-dom/150562)

<div class="topic-metadata">

**Author:** [@pipex](https://www.ruby-forum.com/u/pipex)\
**Replies:** 2\
**Last updated:** [October 10, 2008, 5:37pm UTC](https://www.ruby-forum.com/t/script-to-obtain-dom/150562 "2008-10-10T17:37:29Z")

</div>

I need some help, i want to make a script that extracts the DOM objects from a web page, to get some content. For example i have a url www.example.com This evening three persons went to visit.... I need…

---

## [MYSQL group by and order by query](https://www.ruby-forum.com/t/mysql-group-by-and-order-by-query/150626)

<div class="topic-metadata">

**Author:** [@Abhishek\_shukla](https://www.ruby-forum.com/u/Abhishek_shukla)\
**Replies:** 1\
**Last updated:** [October 10, 2008, 4:43pm UTC](https://www.ruby-forum.com/t/mysql-group-by-and-order-by-query/150626 "2008-10-10T16:43:33Z")

</div>

Hello friends, i need to get the latest record of same field for e.g there is a table called xyz and it contains the following field item\_id, created\_at so i want a single record for every similar item\_id whose cre…

---

## [How to put exit like in php in Rails View](https://www.ruby-forum.com/t/how-to-put-exit-like-in-php-in-rails-view/150614)

<div class="topic-metadata">

**Author:** [@cyrus](https://www.ruby-forum.com/u/cyrus)\
**Replies:** 1\
**Last updated:** [October 10, 2008, 3:20pm UTC](https://www.ruby-forum.com/t/how-to-put-exit-like-in-php-in-rails-view/150614 "2008-10-10T15:20:02Z")

</div>

Hello All Is it possible in rails view to put exit like in php …so that we can debug view in rails … ? like in php you can print array and put exit …for debugging view

---

## [How to get value from partial](https://www.ruby-forum.com/t/how-to-get-value-from-partial/150586)

<div class="topic-metadata">

**Author:** [@jicksta](https://www.ruby-forum.com/u/jicksta)\
**Replies:** 6\
**Last updated:** [October 10, 2008, 3:16pm UTC](https://www.ruby-forum.com/t/how-to-get-value-from-partial/150586 "2008-10-10T15:16:29Z")

</div>

Hi, I’m really confused on how I should do it as I have a form as: ================================================================================ \<%form\_for :cart do |form|%\> Campgrounds …

---

## [Cached pages and content negotiation](https://www.ruby-forum.com/t/cached-pages-and-content-negotiation/150618)

<div class="topic-metadata">

**Author:** [@sebastian](https://www.ruby-forum.com/u/sebastian)\
**Replies:** 0\
**Last updated:** [October 10, 2008, 2:45pm UTC](https://www.ruby-forum.com/t/cached-pages-and-content-negotiation/150618 "2008-10-10T14:45:23Z")

</div>

Hi I seem to be unable to get the server (Apache 2.0.61 with Phusion Passenger 2.0.3) to return cached non-html pages. My application caches RDF-XML files in the file system with an .rdf extension. The URLs to retrie…

---

## [Emails from rake not being sent as html](https://www.ruby-forum.com/t/emails-from-rake-not-being-sent-as-html/150608)

<div class="topic-metadata">

**Author:** [@phil](https://www.ruby-forum.com/u/phil)\
**Replies:** 1\
**Last updated:** [October 10, 2008, 2:16pm UTC](https://www.ruby-forum.com/t/emails-from-rake-not-being-sent-as-html/150608 "2008-10-10T14:16:07Z")

</div>

I have an email that is sent from either a rake task or from a user action. When it is sent from the user action it gets delivered as nicely formatted html. When sent from the rake task it is text, with all the html c…

---

## [Paperclip - deleting a photo from a form](https://www.ruby-forum.com/t/paperclip-deleting-a-photo-from-a-form/150529)

<div class="topic-metadata">

**Author:** [@bingobob](https://www.ruby-forum.com/u/bingobob)\
**Replies:** 3\
**Last updated:** [October 10, 2008, 2:01pm UTC](https://www.ruby-forum.com/t/paperclip-deleting-a-photo-from-a-form/150529 "2008-10-10T14:01:40Z")

</div>

Any tips as to how paperclip can be used to delete photos. I mean that in my update view I show six browse buttons, all capable of updating the photo that corresponds to that browse button (e.g. photo1 or photo2). Tha…

---

## [Pagination](https://www.ruby-forum.com/t/pagination/150516)

<div class="topic-metadata">

**Author:** [@sreejith](https://www.ruby-forum.com/u/sreejith)\
**Replies:** 14\
**Last updated:** [October 10, 2008, 1:11pm UTC](https://www.ruby-forum.com/t/pagination/150516 "2008-10-10T13:11:45Z")

</div>

dear all, i am not able to use pagination plugin and i dont know much about ruby on rails. the pagination code is as below:- @searchvalue=params\[:searchtextfield\] string1=“Select count(\*) from nejms where keywords l…

---

## [Ar\_sendmail in daemon mode - on ubuntu](https://www.ruby-forum.com/t/ar-sendmail-in-daemon-mode-on-ubuntu/150611)

<div class="topic-metadata">

**Author:** [@sgudibanda](https://www.ruby-forum.com/u/sgudibanda)\
**Replies:** 0\
**Last updated:** [October 10, 2008, 12:55pm UTC](https://www.ruby-forum.com/t/ar-sendmail-in-daemon-mode-on-ubuntu/150611 "2008-10-10T12:55:43Z")

</div>

Hi, I am thinking of using ar\_mailer as emailing solution for my app. But unfortunately, i am not able to run it in daemon mode. if i start the ar\_sendmail as: $ar\_sendmail -d It simply bails out without any error af…

---

## [Would you help about const\_missing error](https://www.ruby-forum.com/t/would-you-help-about-const-missing-error/150610)

<div class="topic-metadata">

**Author:** [@dev.mykey](https://www.ruby-forum.com/u/dev.mykey)\
**Replies:** 1\
**Last updated:** [October 10, 2008, 12:28pm UTC](https://www.ruby-forum.com/t/would-you-help-about-const-missing-error/150610 "2008-10-10T12:28:34Z")

</div>

Hello. I have made a model name is User, so have created “users” table. and I made Customer class inhrtied by User Class. When I call the Customer class in some controller, the controller passed error msg to me. It …

---

## [Ho to convert submit button html code to RoR](https://www.ruby-forum.com/t/ho-to-convert-submit-button-html-code-to-ror/150607)

<div class="topic-metadata">

**Author:** [@jsn1](https://www.ruby-forum.com/u/jsn1)\
**Replies:** 1\
**Last updated:** [October 10, 2008, 12:22pm UTC](https://www.ruby-forum.com/t/ho-to-convert-submit-button-html-code-to-ror/150607 "2008-10-10T12:22:41Z")

</div>

Hi all this is my html code: I want to convert it to RoR \<%= submit\_tag ‘Submit’ %\> Where do I add the class=“submit” in RoR? thanks

---

## [Select another value in a combo box with a button click](https://www.ruby-forum.com/t/select-another-value-in-a-combo-box-with-a-button-click/150572)

<div class="topic-metadata">

**Author:** [@jicksta](https://www.ruby-forum.com/u/jicksta)\
**Replies:** 10\
**Last updated:** [October 10, 2008, 12:20pm UTC](https://www.ruby-forum.com/t/select-another-value-in-a-combo-box-with-a-button-click/150572 "2008-10-10T12:20:20Z")

</div>

Hi, I was wondering if anyone can help me with this as I just don’t seem to figure out how I can refer to a combo box and change its selected value to another with a button click. Suppose a cambo box has values ‘1’, ‘…

---

## [Automatic loading of parent association weirdness?](https://www.ruby-forum.com/t/automatic-loading-of-parent-association-weirdness/150544)

<div class="topic-metadata">

**Author:** [@xavier](https://www.ruby-forum.com/u/xavier)\
**Replies:** 2\
**Last updated:** [October 10, 2008, 11:39am UTC](https://www.ruby-forum.com/t/automatic-loading-of-parent-association-weirdness/150544 "2008-10-10T11:39:10Z")

</div>

Hi there, I’m experiencing some weird behavior with automatic loading of parent associations in ActiveRecord using Rails 2.1. Let’s take this simple model: class Contact \< ActiveRecord::Base has\_many :assets end c…

---

## [Form works with POST but not PUT](https://www.ruby-forum.com/t/form-works-with-post-but-not-put/150606)

<div class="topic-metadata">

**Author:** [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Replies:** 1\
**Last updated:** [October 10, 2008, 11:33am UTC](https://www.ruby-forum.com/t/form-works-with-post-but-not-put/150606 "2008-10-10T11:33:38Z")

</div>

I have a form that’s stopped working. It calls a PUT action - the route is defined thus (other routes omitted for clarity): map.namespace :admin do |admin| admin.resources :resources, :member =\> { :update\_bundle =\> :…

---

## [Problem using "rake gems:\*" with mongrel\_cluster, ruby-oci8, and sqlite3-ruby](https://www.ruby-forum.com/t/problem-using-rake-gems-with-mongrel-cluster-ruby-oci8-and-sqlite3-ruby/148406)

<div class="topic-metadata">

**Author:** [@Mike\_DeLaurentis](https://www.ruby-forum.com/u/Mike_DeLaurentis)\
**Replies:** 2\
**Last updated:** [October 10, 2008, 11:28am UTC](https://www.ruby-forum.com/t/problem-using-rake-gems-with-mongrel-cluster-ruby-oci8-and-sqlite3-ruby/148406 "2008-10-10T11:28:35Z")

</div>

I’m having trouble using the environment.rb file to manage my gem dependencies for certain gems. For example, I added “config.gem mongrel\_cluster” to my environment.rb file, and then installed it through “rake gems in…

---

## [Datetime select](https://www.ruby-forum.com/t/datetime-select/150240)

<div class="topic-metadata">

**Author:** [@katsuo](https://www.ruby-forum.com/u/katsuo)\
**Replies:** 9\
**Last updated:** [October 10, 2008, 9:55am UTC](https://www.ruby-forum.com/t/datetime-select/150240 "2008-10-10T09:55:10Z")

</div>

I am having difficulty passing datetime values to a method in the controller. I get sql syntax error from the following. Can someone advise me what I am doing wrong? my view: \<table\> \<tr\> \<%= start\_form\_tag :ac…

---

## [Add hash to serialized column](https://www.ruby-forum.com/t/add-hash-to-serialized-column/150590)

<div class="topic-metadata">

**Author:** [@alex](https://www.ruby-forum.com/u/alex)\
**Replies:** 2\
**Last updated:** [October 10, 2008, 9:05am UTC](https://www.ruby-forum.com/t/add-hash-to-serialized-column/150590 "2008-10-10T09:05:11Z")

</div>

Hey guys, I’m trying to merge a hash with another using the .merge! function. class User \< ActiveRecord::Base serialize :preferences end This is what I end up with in the console: u = User.find(1) u.preferences.…

---

## [Question about .send()](https://www.ruby-forum.com/t/question-about-send/150587)

<div class="topic-metadata">

**Author:** [@Garrett\_B](https://www.ruby-forum.com/u/Garrett_B)\
**Replies:** 2\
**Last updated:** [October 10, 2008, 8:55am UTC](https://www.ruby-forum.com/t/question-about-send/150587 "2008-10-10T08:55:49Z")

</div>

I love that I can use .send() to dynamically build the name of the method I want to call, but how do I build a variable length list of parameters to go along with it? I am trying to write a helper for dealing with rou…

---

## [Craken cronjob management](https://www.ruby-forum.com/t/craken-cronjob-management/150583)

<div class="topic-metadata">

**Author:** [@chovy](https://www.ruby-forum.com/u/chovy)\
**Replies:** 0\
**Last updated:** [October 10, 2008, 6:37am UTC](https://www.ruby-forum.com/t/craken-cronjob-management/150583 "2008-10-10T06:37:43Z")

</div>

Has anyone used craken? http://github.com/latimes/craken/tree/master I can’t get a good crontab installed, it seems to have duplication in the entry. Description of the problem I’m having: – Anthony E. 408-656-24…

---

## [Schema.dump chokes on RAW type](https://www.ruby-forum.com/t/schema-dump-chokes-on-raw-type/150459)

<div class="topic-metadata">

**Author:** [@rsanheim](https://www.ruby-forum.com/u/rsanheim)\
**Replies:** 5\
**Last updated:** [October 10, 2008, 1:30am UTC](https://www.ruby-forum.com/t/schema-dump-chokes-on-raw-type/150459 "2008-10-10T01:30:25Z")

</div>

I haven’t seen anyone mention this yet. The tail end of the migration process is a call to schema.dump. Our primary keys are uuids and these choke schema.dump on both oracle and postgres. The latter fails silently (…

---

## [Passenger dedicated server](https://www.ruby-forum.com/t/passenger-dedicated-server/150491)

<div class="topic-metadata">

**Author:** [@fRAnKEnSTEin](https://www.ruby-forum.com/u/fRAnKEnSTEin)\
**Replies:** 14\
**Last updated:** [October 10, 2008, 12:28am UTC](https://www.ruby-forum.com/t/passenger-dedicated-server/150491 "2008-10-10T00:28:29Z")

</div>

Hi, I am trying to install/configure Passenger on a dedicated centos server. I have installed passenger successfully, but i am having to much troubles trying to configure it with my dedicated server, I have read/saw …

---

## [:has\_many through with owner-dependent conditions](https://www.ruby-forum.com/t/has-many-through-with-owner-dependent-conditions/150566)

<div class="topic-metadata">

**Author:** [@thegoatboy](https://www.ruby-forum.com/u/thegoatboy)\
**Replies:** 0\
**Last updated:** [October 10, 2008, 12:22am UTC](https://www.ruby-forum.com/t/has-many-through-with-owner-dependent-conditions/150566 "2008-10-10T00:22:38Z")

</div>

I have a situation where I abstractly have a has\_many through relationship between three tables. Without the through, I’d have no trouble passing the necessary value to the third table, but with it, I have no access t…

---

## [Changing \<head\> in a view](https://www.ruby-forum.com/t/changing-head-in-a-view/150563)

<div class="topic-metadata">

**Author:** [@HansCz](https://www.ruby-forum.com/u/HansCz)\
**Replies:** 1\
**Last updated:** [October 9, 2008, 11:07pm UTC](https://www.ruby-forum.com/t/changing-head-in-a-view/150563 "2008-10-09T23:07:41Z")

</div>

Given an application layout like Test \<%= stylesheet\_link\_tag 'test.css' %\> \<%= javascript\_include\_tag 'some\_js', :cache =\> true, :charset =\> ‘utf8’ %\> \<%= yield %\> and a controller, sa…

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

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