# Rails

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

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

---

## [Trouble creating a link or button to delete (more than basic delete from index)](https://www.ruby-forum.com/t/trouble-creating-a-link-or-button-to-delete-more-than-basic-delete-from-index/160936)

<div class="topic-metadata">

**Author:** [@supasta](https://www.ruby-forum.com/u/supasta)\
**Replies:** 1\
**Last updated:** [February 21, 2009, 4:03am UTC](https://www.ruby-forum.com/t/trouble-creating-a-link-or-button-to-delete-more-than-basic-delete-from-index/160936 "2009-02-21T04:03:29Z")

</div>

Hi all, I’m using Rails 2.2.2. I’m trying to create a hyperlink that will delete an image when it’s clicked. However I need to pass along a bit more info (init\_entity\_id) call this from a different part of the app …

---

## [Searching on a complex attribute in my model](https://www.ruby-forum.com/t/searching-on-a-complex-attribute-in-my-model/160920)

<div class="topic-metadata">

**Author:** [@naijaguy](https://www.ruby-forum.com/u/naijaguy)\
**Replies:** 2\
**Last updated:** [February 21, 2009, 1:31am UTC](https://www.ruby-forum.com/t/searching-on-a-complex-attribute-in-my-model/160920 "2009-02-21T01:31:35Z")

</div>

Here is part of my User class: has\_many :permissions has\_many :roles, :through =\> :permissions This works very well, and I have a handy convenience method: def has\_role?(name) self.roles.find\_by\_name(name) ? true : …

---

## [Hi team! installation of ruby on rails on ubuntu 8.10](https://www.ruby-forum.com/t/hi-team-installation-of-ruby-on-rails-on-ubuntu-8-10/160870)

<div class="topic-metadata">

**Author:** [@NARAYANAN\_CJ](https://www.ruby-forum.com/u/NARAYANAN_CJ)\
**Replies:** 3\
**Last updated:** [February 21, 2009, 12:35am UTC](https://www.ruby-forum.com/t/hi-team-installation-of-ruby-on-rails-on-ubuntu-8-10/160870 "2009-02-21T00:35:34Z")

</div>

hello there can any one help me out to get the installation of ruby on rails on ubuntu 8.10 i tried installing but it could not help me out either stilll showing up you have currently the programs not installed ple…

---

## [How to access text helper and url helper methods in model](https://www.ruby-forum.com/t/how-to-access-text-helper-and-url-helper-methods-in-model/157000)

<div class="topic-metadata">

**Author:** [@sunfish](https://www.ruby-forum.com/u/sunfish)\
**Replies:** 1\
**Last updated:** [February 20, 2009, 10:08pm UTC](https://www.ruby-forum.com/t/how-to-access-text-helper-and-url-helper-methods-in-model/157000 "2009-02-20T22:08:47Z")

</div>

Hi, I want to access TextHelper and UrlHelper methods in my model so how i am able to access it ? I was included following helper in my model but still it is not working? also for accessing these helper method w need…

---

## [ActiveRecord question](https://www.ruby-forum.com/t/activerecord-question/160907)

<div class="topic-metadata">

**Author:** [@hangingclowns](https://www.ruby-forum.com/u/hangingclowns)\
**Replies:** 2\
**Last updated:** [February 20, 2009, 9:09pm UTC](https://www.ruby-forum.com/t/activerecord-question/160907 "2009-02-20T21:09:16Z")

</div>

This is strange: I’m doing the following in script/console: Contract.find(:all) do |c| ?\> if c.use\_initial\_published\_date c.initial\_published\_date = Date.today c.save! end end For some reason it is not savin…

---

## [Human readable controller\_name](https://www.ruby-forum.com/t/human-readable-controller-name/160904)

<div class="topic-metadata">

**Author:** [@spacechurro](https://www.ruby-forum.com/u/spacechurro)\
**Replies:** 3\
**Last updated:** [February 20, 2009, 9:07pm UTC](https://www.ruby-forum.com/t/human-readable-controller-name/160904 "2009-02-20T21:07:24Z")

</div>

was wondering if it’s possible to have a human readable controller name in my page title… ie: if my controller name is: show\_names i can have my view do: The controller is: \<%= controller\_name %\> and i can get: Th…

---

## [Validate for street](https://www.ruby-forum.com/t/validate-for-street/160772)

<div class="topic-metadata">

**Author:** [@jobber](https://www.ruby-forum.com/u/jobber)\
**Replies:** 8\
**Last updated:** [February 20, 2009, 8:46pm UTC](https://www.ruby-forum.com/t/validate-for-street/160772 "2009-02-20T20:46:01Z")

</div>

Hallo all, can someone tell me what can be the regulare expression for this: “The Road”, “The Road 12”, “Road”, “On the Road 89”.

---

## [How to change a variable while editing a table? (scaffold)](https://www.ruby-forum.com/t/how-to-change-a-variable-while-editing-a-table-scaffold/160902)

<div class="topic-metadata">

**Author:** [@loader](https://www.ruby-forum.com/u/loader)\
**Replies:** 5\
**Last updated:** [February 20, 2009, 8:44pm UTC](https://www.ruby-forum.com/t/how-to-change-a-variable-while-editing-a-table-scaffold/160902 "2009-02-20T20:44:19Z")

</div>

Hello everyone! I’m trying to modify an example from a book. The example show how to create a scaffold for a table. But I want to change the way things are modified. Here is the method in my controller : def update …

---

## [Relationships in models](https://www.ruby-forum.com/t/relationships-in-models/160786)

<div class="topic-metadata">

**Author:** [@norricorp](https://www.ruby-forum.com/u/norricorp)\
**Replies:** 3\
**Last updated:** [February 20, 2009, 7:52pm UTC](https://www.ruby-forum.com/t/relationships-in-models/160786 "2009-02-20T19:52:30Z")

</div>

I am new to rails and have got very confused with the above. It was working and then I made changes and it has gone downhill from there. And I was not taking regular backups… I have moved slightly outside of the conve…

---

## [Has many :through a named scope](https://www.ruby-forum.com/t/has-many-through-a-named-scope/160863)

<div class="topic-metadata">

**Author:** [@pankaj](https://www.ruby-forum.com/u/pankaj)\
**Replies:** 3\
**Last updated:** [February 20, 2009, 6:49pm UTC](https://www.ruby-forum.com/t/has-many-through-a-named-scope/160863 "2009-02-20T18:49:28Z")

</div>

class User has\_many :friendships has\_many :friends, :through =\> :friendship end class Friendship belongs\_to :user belongs\_to :friend, :class\_name =\> ‘User’ named\_scope :accepted, :conditons =\> “is\_accepted = true…

---

## [One model active at a time](https://www.ruby-forum.com/t/one-model-active-at-a-time/160598)

<div class="topic-metadata">

**Author:** [@yaphi](https://www.ruby-forum.com/u/yaphi)\
**Replies:** 10\
**Last updated:** [February 20, 2009, 5:56pm UTC](https://www.ruby-forum.com/t/one-model-active-at-a-time/160598 "2009-02-20T17:56:25Z")

</div>

I’m not sure if there is a term for this (which is why I can’t find anything on google) but I want to be able to set one of my models active, where the rest will be set to inactive. I would guess to write a method tha…

---

## [Rails 2.2.2 does not work with ruby 1.9.1](https://www.ruby-forum.com/t/rails-2-2-2-does-not-work-with-ruby-1-9-1/160876)

<div class="topic-metadata">

**Author:** [@mennanov](https://www.ruby-forum.com/u/mennanov)\
**Replies:** 6\
**Last updated:** [February 20, 2009, 5:23pm UTC](https://www.ruby-forum.com/t/rails-2-2-2-does-not-work-with-ruby-1-9-1/160876 "2009-02-20T17:23:17Z")

</div>

Hi everyone! I’ve installed new Ruby 1.9.1 from sources (Ruby Programming Language), then “gem install rails”, everything was ok during installation, all tests (“make test”) were ok too. After all, i wanted to create …

---

## [Removing string's accents](https://www.ruby-forum.com/t/removing-strings-accents/155125)

<div class="topic-metadata">

**Author:** [@bobm](https://www.ruby-forum.com/u/bobm)\
**Replies:** 4\
**Last updated:** [February 20, 2009, 4:40pm UTC](https://www.ruby-forum.com/t/removing-strings-accents/155125 "2009-02-20T16:40:29Z")

</div>

Hi, I’m pretty sure to have seen a new method ‘remove\_accents’ in Rails 2.2 but I can’t find it again. Is it me or does this method exists for good ? Thanks

---

## [How to use benchmark helper](https://www.ruby-forum.com/t/how-to-use-benchmark-helper/160884)

<div class="topic-metadata">

**Author:** [@nike](https://www.ruby-forum.com/u/nike)\
**Replies:** 0\
**Last updated:** [February 20, 2009, 4:22pm UTC](https://www.ruby-forum.com/t/how-to-use-benchmark-helper/160884 "2009-02-20T16:22:57Z")

</div>

How to use bench mark helper in app.I have seen that in http://api.rubyonrails.org/classes/ActionView/Helpers/BenchmarkHelper.html#M001582 but i didnt get how to do.Please help

---

## [Sending messages between users](https://www.ruby-forum.com/t/sending-messages-between-users/160826)

<div class="topic-metadata">

**Author:** [@christoph\_j](https://www.ruby-forum.com/u/christoph_j)\
**Replies:** 2\
**Last updated:** [February 20, 2009, 4:20pm UTC](https://www.ruby-forum.com/t/sending-messages-between-users/160826 "2009-02-20T16:20:37Z")

</div>

Hi, I’m trying to create an web app where users can write messages to each other. I use the restful\_authentication plugin for the users. So they have an user\_id. How ever the messages should have a: sender receiver …

---

## [Flickr Api integration problem](https://www.ruby-forum.com/t/flickr-api-integration-problem/160882)

<div class="topic-metadata">

**Author:** [@srinu](https://www.ruby-forum.com/u/srinu)\
**Replies:** 0\
**Last updated:** [February 20, 2009, 4:20pm UTC](https://www.ruby-forum.com/t/flickr-api-integration-problem/160882 "2009-02-20T16:20:37Z")

</div>

I have gone through the rflickr README, and it says to get the token. I have struck-up here with getting auth.token. My script looks: require ‘flickr’ FLICKR\_KEY = ‘f8ecb4b6ef8c94934034e04c79d645db’ FLICKR\_SECRET = ‘…

---

## [Nested set - problems when creating child item](https://www.ruby-forum.com/t/nested-set-problems-when-creating-child-item/160881)

<div class="topic-metadata">

**Author:** [@cassiozen](https://www.ruby-forum.com/u/cassiozen)\
**Replies:** 0\
**Last updated:** [February 20, 2009, 4:18pm UTC](https://www.ruby-forum.com/t/nested-set-problems-when-creating-child-item/160881 "2009-02-20T16:18:51Z")

</div>

Hi, I’ve created a Model with Better Nested Set, but i’m having problems to create child items My workflow is: In the (new) form, i pass the desired parent\_id in a hidden field. In the create action, i create the re…

---

## [Dumb question ;-)) about dynamic naming](https://www.ruby-forum.com/t/dumb-question-about-dynamic-naming/160880)

<div class="topic-metadata">

**Author:** [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Replies:** 0\
**Last updated:** [February 20, 2009, 4:17pm UTC](https://www.ruby-forum.com/t/dumb-question-about-dynamic-naming/160880 "2009-02-20T16:17:40Z")

</div>

in one of my partial I have : ..... but if I need to specify multi carousels, I need to dynamically modify the name .. so I would like to have : but I don’t know how to get it ? any suggestion ? thanks erwin …

---

## [Reading http request as IO in rails](https://www.ruby-forum.com/t/reading-http-request-as-io-in-rails/129287)

<div class="topic-metadata">

**Author:** [@mbg](https://www.ruby-forum.com/u/mbg)\
**Replies:** 3\
**Last updated:** [February 20, 2009, 3:48pm UTC](https://www.ruby-forum.com/t/reading-http-request-as-io-in-rails/129287 "2009-02-20T15:48:49Z")

</div>

Hi, Here’s what i’m trying to do my mobile phone app ( j2me) tries to connect to the my rails application. the j2me app opens a java.io.OutputStream here’s the snippet hc = (HttpConnection) Connector.open(UPDATE\_URL, …

---

## [Years gone by (deprecation of years method)](https://www.ruby-forum.com/t/years-gone-by-deprecation-of-years-method/160859)

<div class="topic-metadata">

**Author:** [@reggieb](https://www.ruby-forum.com/u/reggieb)\
**Replies:** 3\
**Last updated:** [February 20, 2009, 2:52pm UTC](https://www.ruby-forum.com/t/years-gone-by-deprecation-of-years-method/160859 "2009-02-20T14:52:20Z")

</div>

Can anyone give me some insight as to why the ActiveSupport::CoreExtensions::Float::Time method ‘years’ is being deprecated? I have an application managing contracts and being able to manipulate and report on them bas…

---

## [Better nested set and parent\_id](https://www.ruby-forum.com/t/better-nested-set-and-parent-id/160825)

<div class="topic-metadata">

**Author:** [@cassiozen](https://www.ruby-forum.com/u/cassiozen)\
**Replies:** 1\
**Last updated:** [February 20, 2009, 1:43pm UTC](https://www.ruby-forum.com/t/better-nested-set-and-parent-id/160825 "2009-02-20T13:43:24Z")

</div>

Hello everybody I have a model with better\_nested\_set. In my “new” form, i pass the desired parent\_id as a hidden field, and in the create action at the controller i save the new register and use move\_to\_child\_of Mode…

---

## [Disabling logging when using script/runner](https://www.ruby-forum.com/t/disabling-logging-when-using-script-runner/160862)

<div class="topic-metadata">

**Author:** [@roallen](https://www.ruby-forum.com/u/roallen)\
**Replies:** 0\
**Last updated:** [February 20, 2009, 12:56pm UTC](https://www.ruby-forum.com/t/disabling-logging-when-using-script-runner/160862 "2009-02-20T12:56:00Z")

</div>

Is it possible to disable rails logging when you invoke a script/runner command? I run a lot of batch commands via script/runner and it makes it hard to see the logging for web-based queries vs script/runner.

---

## [How can I disable the SQL logging which occurs in developmen](https://www.ruby-forum.com/t/how-can-i-disable-the-sql-logging-which-occurs-in-developmen/105144)

<div class="topic-metadata">

**Author:** [@greg](https://www.ruby-forum.com/u/greg)\
**Replies:** 9\
**Last updated:** [February 20, 2009, 12:50pm UTC](https://www.ruby-forum.com/t/how-can-i-disable-the-sql-logging-which-occurs-in-developmen/105144 "2009-02-20T12:50:24Z")

</div>

Hi - how can I disable the SQL logging which occurs in development mode? Tks

---

## [Select\_tag question](https://www.ruby-forum.com/t/select-tag-question/160858)

<div class="topic-metadata">

**Author:** [@on9west](https://www.ruby-forum.com/u/on9west)\
**Replies:** 0\
**Last updated:** [February 20, 2009, 11:59am UTC](https://www.ruby-forum.com/t/select-tag-question/160858 "2009-02-20T11:59:21Z")

</div>

Dear all I want to create two select\_tag in view, the second select\_tag will depend on the first select\_tag values. i.e. If the first select\_tag selected AHN, then the second have value \[CPS,HMS,MBS,BBS\] for selectio…

---

## [Remote\_form\_for not passing form values](https://www.ruby-forum.com/t/remote-form-for-not-passing-form-values/157262)

<div class="topic-metadata">

**Author:** [@hangingclowns](https://www.ruby-forum.com/u/hangingclowns)\
**Replies:** 6\
**Last updated:** [February 20, 2009, 11:53am UTC](https://www.ruby-forum.com/t/remote-form-for-not-passing-form-values/157262 "2009-02-20T11:53:18Z")

</div>

I have the following: \<% form\_remote\_for :role, :method =\> :put, :url =\> {:controller =\> “roles”, :action =\> “update”, :id =\> @role.id } do |f| %\> \<%= select("role", "default\_view", Account::ROLES) %\> \<%=…

---

## [Rating](https://www.ruby-forum.com/t/rating/160850)

<div class="topic-metadata">

**Author:** [@chaitanya](https://www.ruby-forum.com/u/chaitanya)\
**Replies:** 3\
**Last updated:** [February 20, 2009, 11:19am UTC](https://www.ruby-forum.com/t/rating/160850 "2009-02-20T11:19:15Z")

</div>

I would like to use acts\_as\_rateable for rating a model instance. I need sample code for implement this feature.

---

## [RESTful Routes not working - Switches ID and Action](https://www.ruby-forum.com/t/restful-routes-not-working-switches-id-and-action/160855)

<div class="topic-metadata">

**Author:** [@steffen\_w](https://www.ruby-forum.com/u/steffen_w)\
**Replies:** 1\
**Last updated:** [February 20, 2009, 11:18am UTC](https://www.ruby-forum.com/t/restful-routes-not-working-switches-id-and-action/160855 "2009-02-20T11:18:03Z")

</div>

Hi, I would like to ask for some suggestions on my problem with Routes. It’s probably pretty simpel. This link: \<%= link\_to image\_tag(“…”, :alt =\> “…”, :title =\> “…”), edit\_brand\_path(brand) %\> Results in this URL: …

---

## [Problem - getting a nil object in view?](https://www.ruby-forum.com/t/problem-getting-a-nil-object-in-view/160830)

<div class="topic-metadata">

**Author:** [@vikas](https://www.ruby-forum.com/u/vikas)\
**Replies:** 1\
**Last updated:** [February 20, 2009, 10:48am UTC](https://www.ruby-forum.com/t/problem-getting-a-nil-object-in-view/160830 "2009-02-20T10:48:04Z")

</div>

Hello All, I am new to ruby programming, Problem is - In my controller - I defined a private method like :private def \_list(searchBy, moreResults = false) another code goes here… @items\_by\_language = {} @items.ea…

---

## [Config.cache\_classes breaks reflect\_on\_assocation?](https://www.ruby-forum.com/t/config-cache-classes-breaks-reflect-on-assocation/160805)

<div class="topic-metadata">

**Author:** [@dino\_d](https://www.ruby-forum.com/u/dino_d)\
**Replies:** 4\
**Last updated:** [February 20, 2009, 10:39am UTC](https://www.ruby-forum.com/t/config-cache-classes-breaks-reflect-on-assocation/160805 "2009-02-20T10:39:52Z")

</div>

Hi - I have a model with a user-specific has\_one relationship, meaning, my model, Story, has one Vote, but only on a per-user basis. So, I addressed this issue by adding a has\_one relationship: has\_one :current\_user\_v…

---

## [Sequence of page.visual\_effect and page.replace\_html](https://www.ruby-forum.com/t/sequence-of-page-visual-effect-and-page-replace-html/160843)

<div class="topic-metadata">

**Author:** [@e\_deleflie](https://www.ruby-forum.com/u/e_deleflie)\
**Replies:** 2\
**Last updated:** [February 20, 2009, 9:46am UTC](https://www.ruby-forum.com/t/sequence-of-page-visual-effect-and-page-replace-html/160843 "2009-02-20T09:46:15Z")

</div>

All, I’ve got will\_paginate working with AJAX (using un-obstructive javascript, i.e. good for SEO). All good. When the user clicks “Next \>\>”, I want the next page of results to fade in. But the problem seems to be (i…

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

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