# Rails

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

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

---

## [Getting the datetime when using Calendar Date Select plugin in an Ajax update operation](https://www.ruby-forum.com/t/getting-the-datetime-when-using-calendar-date-select-plugin-in-an-ajax-update-operation/138399)

<div class="topic-metadata">

**Author:** [@andy](https://www.ruby-forum.com/u/andy)\
**Replies:** 0\
**Last updated:** [May 22, 2008, 4:50pm UTC](https://www.ruby-forum.com/t/getting-the-datetime-when-using-calendar-date-select-plugin-in-an-ajax-update-operation/138399 "2008-05-22T16:50:45Z")

</div>

Hey,everyone, I encountered a problem when getting a date through calendar date select plugin. It’s convenient to put the very tag(calendar\_date\_select\_tag) in a form, then get the date when the form is submitted, ho…

---

## [Detect overlap of IP subnets](https://www.ruby-forum.com/t/detect-overlap-of-ip-subnets/138388)

<div class="topic-metadata">

**Author:** [@ahead](https://www.ruby-forum.com/u/ahead)\
**Replies:** 2\
**Last updated:** [May 22, 2008, 4:21pm UTC](https://www.ruby-forum.com/t/detect-overlap-of-ip-subnets/138388 "2008-05-22T16:21:16Z")

</div>

I have a IpSubnet model which contains network address and subnet mask (strings). When a new IP subnet is submitted I need to validate it to check if it overlaps any of the existing (\> 10.000) IP subnets in the databa…

---

## [Rails 2.0: Scaffolding](https://www.ruby-forum.com/t/rails-2-0-scaffolding/138214)

<div class="topic-metadata">

**Author:** [@steveluscher](https://www.ruby-forum.com/u/steveluscher)\
**Replies:** 4\
**Last updated:** [May 22, 2008, 3:54pm UTC](https://www.ruby-forum.com/t/rails-2-0-scaffolding/138214 "2008-05-22T15:54:56Z")

</div>

So in the middle of delivering a website to somebody I naively upgraded to rails 2.0, and WTF? Why did the scaffolding change so dramatically without leaving the old commands around? (insert Zed S. rant here) So I f…

---

## [Sortable groups and elements between groups](https://www.ruby-forum.com/t/sortable-groups-and-elements-between-groups/138391)

<div class="topic-metadata">

**Author:** [@ollka](https://www.ruby-forum.com/u/ollka)\
**Replies:** 0\
**Last updated:** [May 22, 2008, 3:51pm UTC](https://www.ruby-forum.com/t/sortable-groups-and-elements-between-groups/138391 "2008-05-22T15:51:06Z")

</div>

Hello. I need to implement something like this: http://www.gregphoto.net/sortable/advanced/ but i can’t understand, how to do it. I don’t need adding new group actually, but I need sorting items into the group, movi…

---

## [Access denied for user 'root'@'localhost'](https://www.ruby-forum.com/t/access-denied-for-user-root-localhost/136445)

<div class="topic-metadata">

**Author:** [@mani](https://www.ruby-forum.com/u/mani)\
**Replies:** 2\
**Last updated:** [May 22, 2008, 3:05pm UTC](https://www.ruby-forum.com/t/access-denied-for-user-root-localhost/136445 "2008-05-22T15:05:39Z")

</div>

I am getting error Access denied for user ‘root’@‘localhost’ (using password: NO) i saw in database.yaml Install MySQL and put its /bin directory on your path. how to set it

---

## [Restful routes question](https://www.ruby-forum.com/t/restful-routes-question/138380)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 3\
**Last updated:** [May 22, 2008, 2:48pm UTC](https://www.ruby-forum.com/t/restful-routes-question/138380 "2008-05-22T14:48:44Z")

</div>

Hi, a small question about restful routing. Imagine i have an application with channels and videos A channel contains videos. So i have in my routes.rb: map.resources :channels, :has\_many =\> :videos But i have one …

---

## [Names scopes and boolean methods](https://www.ruby-forum.com/t/names-scopes-and-boolean-methods/138384)

<div class="topic-metadata">

**Author:** [@Gareth\_A](https://www.ruby-forum.com/u/Gareth_A)\
**Replies:** 0\
**Last updated:** [May 22, 2008, 2:26pm UTC](https://www.ruby-forum.com/t/names-scopes-and-boolean-methods/138384 "2008-05-22T14:26:59Z")

</div>

Hi, We’re exploring the new world of named scopes (hooray) and wondered about some functionality. If I have for example named\_scope :foo, :conditions =\> {:bar =\> true, :quux =\> 2} which obviously creates a Model.foo…

---

## [Optional Rails app functionality](https://www.ruby-forum.com/t/optional-rails-app-functionality/138140)

<div class="topic-metadata">

**Author:** [@djmook](https://www.ruby-forum.com/u/djmook)\
**Replies:** 3\
**Last updated:** [May 22, 2008, 2:26pm UTC](https://www.ruby-forum.com/t/optional-rails-app-functionality/138140 "2008-05-22T14:26:32Z")

</div>

Hi, I’ve got this idea and/or requirement-with-no-known-solution-so-I-made-one-up. Here’s my problem: Say I’ve got a rails app that does a bunch of stuff. Great. Now I want to create an admin section to maintain use…

---

## [Observer not working for select field](https://www.ruby-forum.com/t/observer-not-working-for-select-field/138302)

<div class="topic-metadata">

**Author:** [@neha-rohan](https://www.ruby-forum.com/u/neha-rohan)\
**Replies:** 5\
**Last updated:** [May 22, 2008, 2:13pm UTC](https://www.ruby-forum.com/t/observer-not-working-for-select-field/138302 "2008-05-22T14:13:42Z")

</div>

Hi, My code is as follows: select one \<%Report.get\_criteria\_array(report.model\_list, session\[:app\_user\_id\], term\_type).each{|arr|%\> \<%=arr\[1\]%\> \<%}%\> \<%= observe\_field(“criteria\[#{count}\]\[type\_id\]”, :func…

---

## [Deploying rails application on the Internet](https://www.ruby-forum.com/t/deploying-rails-application-on-the-internet/137699)

<div class="topic-metadata">

**Author:** [@nico10gbb](https://www.ruby-forum.com/u/nico10gbb)\
**Replies:** 1\
**Last updated:** [May 22, 2008, 1:29pm UTC](https://www.ruby-forum.com/t/deploying-rails-application-on-the-internet/137699 "2008-05-22T13:29:22Z")

</div>

I use Apache, Mongrel and Capistrano. When I execute cap deploy it works fine. I have 2 Mongrel server running on the port 8000 et 8001. Well, I have an important question now. I want get my rails application up on …

---

## [OpenID trhows action not found "show". Routes seems right](https://www.ruby-forum.com/t/openid-trhows-action-not-found-show-routes-seems-right/138348)

<div class="topic-metadata">

**Author:** [@carminem](https://www.ruby-forum.com/u/carminem)\
**Replies:** 3\
**Last updated:** [May 22, 2008, 12:31pm UTC](https://www.ruby-forum.com/t/openid-trhows-action-not-found-show-routes-seems-right/138348 "2008-05-22T12:31:25Z")

</div>

Hi to everyone, I’m trying to implement OpenID + restful authentication on my personal website. So far I’ve got to the point where I get redirected to the openid provider (myopenid.com) to authorize my domain. Then w…

---

## [Eager loading multi-level belongs\_to](https://www.ruby-forum.com/t/eager-loading-multi-level-belongs-to/137934)

<div class="topic-metadata">

**Author:** [@nanosk](https://www.ruby-forum.com/u/nanosk)\
**Replies:** 3\
**Last updated:** [May 22, 2008, 11:40am UTC](https://www.ruby-forum.com/t/eager-loading-multi-level-belongs-to/137934 "2008-05-22T11:40:15Z")

</div>

Hi, I am working on a new project (Rails 2.0.2) and this is driving me nuts. I would appreciate any help! I have the following classes: class Nation \< ActiveRecord::Base has\_many :states end class State \< ActiveRe…

---

## [Why can't I define vars in caller's binding using eval?](https://www.ruby-forum.com/t/why-cant-i-define-vars-in-callers-binding-using-eval/196689)

<div class="topic-metadata">

**Author:** [@Christopher\_JSBott](https://www.ruby-forum.com/u/Christopher_JSBott)\
**Replies:** 1\
**Last updated:** [May 22, 2008, 11:21am UTC](https://www.ruby-forum.com/t/why-cant-i-define-vars-in-callers-binding-using-eval/196689 "2008-05-22T11:21:48Z")

</div>

In other words, why can’t I do this? def f(b) eval(“x = 10”, b) end f(binding) puts “x = #{x}” Is there any way to make that code work (besides obviously setting x to something before calling f). Thanks.

---

## [Setting up a simple Webservice - Why so hard?](https://www.ruby-forum.com/t/setting-up-a-simple-webservice-why-so-hard/138360)

<div class="topic-metadata">

**Author:** [@Rey9999](https://www.ruby-forum.com/u/Rey9999)\
**Replies:** 3\
**Last updated:** [May 22, 2008, 11:05am UTC](https://www.ruby-forum.com/t/setting-up-a-simple-webservice-why-so-hard/138360 "2008-05-22T11:05:19Z")

</div>

Hello everyone. I want to write a simple webservice in rails, which will accept requests by a javascript client using XML-RPC. Knowing very little about webservices in general, I decided first to set up a couple of s…

---

## [A problem with the standard XML Representations](https://www.ruby-forum.com/t/a-problem-with-the-standard-xml-representations/138361)

<div class="topic-metadata">

**Author:** [@AdamV](https://www.ruby-forum.com/u/AdamV)\
**Replies:** 1\
**Last updated:** [May 22, 2008, 10:48am UTC](https://www.ruby-forum.com/t/a-problem-with-the-standard-xml-representations/138361 "2008-05-22T10:48:12Z")

</div>

Hey all, There is one thing that has been bothering me about how Rails implements REST, particularly in the XML form. I’ll be the first to admit that I haven’t read all of Roy’s dissertation but I think I have the gi…

---

## [EncodeURIComponent in form\_remote\_tag](https://www.ruby-forum.com/t/encodeuricomponent-in-form-remote-tag/138321)

<div class="topic-metadata">

**Author:** [@joel](https://www.ruby-forum.com/u/joel)\
**Replies:** 1\
**Last updated:** [May 22, 2008, 10:38am UTC](https://www.ruby-forum.com/t/encodeuricomponent-in-form-remote-tag/138321 "2008-05-22T10:38:47Z")

</div>

Hi All, for one particular reason ( particular div layouts to enable opaque text on on transparent div), my end form tag is appearing before my single text box, as shown below : \<% form\_remote\_tag(:update=\>'your…

---

## [Unicode in route regular expression](https://www.ruby-forum.com/t/unicode-in-route-regular-expression/138362)

<div class="topic-metadata">

**Author:** [@evensoul](https://www.ruby-forum.com/u/evensoul)\
**Replies:** 0\
**Last updated:** [May 22, 2008, 10:38am UTC](https://www.ruby-forum.com/t/unicode-in-route-regular-expression/138362 "2008-05-22T10:38:12Z")

</div>

Hi, I’d like to have a route requirement which is something like :city =\> / \[A-Za-z\]+/, but it should accept UTF-8 word characters as well? Does anyone know how I could accomplish this? Marko

---

## [Rjs not updating my page](https://www.ruby-forum.com/t/rjs-not-updating-my-page/138277)

<div class="topic-metadata">

**Author:** [@remcoh](https://www.ruby-forum.com/u/remcoh)\
**Replies:** 4\
**Last updated:** [May 22, 2008, 9:39am UTC](https://www.ruby-forum.com/t/rjs-not-updating-my-page/138277 "2008-05-22T09:39:43Z")

</div>

hi, I have this: page.hide “transactionpopup” page.replace\_html @shift.shifttype.name+"“removed\_email\_address@domain.invalid(’%d-%m-%Y’) ,calendarday(:shift=\>@shift) @exchangeproposals.each do |ep| domid=ep.shift.…

---

## [Pagination is not working after refresh the page](https://www.ruby-forum.com/t/pagination-is-not-working-after-refresh-the-page/138357)

<div class="topic-metadata">

**Author:** [@vamsii](https://www.ruby-forum.com/u/vamsii)\
**Replies:** 0\
**Last updated:** [May 22, 2008, 8:59am UTC](https://www.ruby-forum.com/t/pagination-is-not-working-after-refresh-the-page/138357 "2008-05-22T08:59:44Z")

</div>

Hii Everybody, I have a problem with pagination. I have a list of things in my list,like 5,10,20,30 …pages. If i select the number of items to be displayed,it’s showing like 5 or 10… But after refreshing the page wh…

---

## [How to set a data value before saving or destroying](https://www.ruby-forum.com/t/how-to-set-a-data-value-before-saving-or-destroying/138325)

<div class="topic-metadata">

**Author:** [@skirkpatrick](https://www.ruby-forum.com/u/skirkpatrick)\
**Replies:** 9\
**Last updated:** [May 22, 2008, 8:31am UTC](https://www.ruby-forum.com/t/how-to-set-a-data-value-before-saving-or-destroying/138325 "2008-05-22T08:31:55Z")

</div>

here is my code class Manufacture \< ActiveRecord::Base belongs\_to :item before\_save :set\_has\_manufacture\_yes before\_destroy :set\_has\_manufacture\_no def set\_has\_manufacture\_yes self.item.has\_manufacture = "Yes" end…

---

## [Params Not Built Correctly](https://www.ruby-forum.com/t/params-not-built-correctly/138346)

<div class="topic-metadata">

**Author:** [@Alan\_Cook](https://www.ruby-forum.com/u/Alan_Cook)\
**Replies:** 0\
**Last updated:** [May 22, 2008, 6:55am UTC](https://www.ruby-forum.com/t/params-not-built-correctly/138346 "2008-05-22T06:55:57Z")

</div>

I’m building an application for requesting equipment. I have a form which includes three models. Following the Railscast on Multi-Model forms, I got this working for the most part, except I don’t get data back for t…

---

## [Fragment caches not being expired](https://www.ruby-forum.com/t/fragment-caches-not-being-expired/138328)

<div class="topic-metadata">

**Author:** [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Replies:** 1\
**Last updated:** [May 22, 2008, 6:38am UTC](https://www.ruby-forum.com/t/fragment-caches-not-being-expired/138328 "2008-05-22T06:38:07Z")

</div>

I am having some serious issues with caching :frowning: The latest problem that I have is the fragments are not being deleted. Here is the haml code within the application.html.haml file that caches the text just fine …

---

## [Prompt for date\_select()?](https://www.ruby-forum.com/t/prompt-for-date-select/138332)

<div class="topic-metadata">

**Author:** [@athem](https://www.ruby-forum.com/u/athem)\
**Replies:** 2\
**Last updated:** [May 22, 2008, 6:13am UTC](https://www.ruby-forum.com/t/prompt-for-date-select/138332 "2008-05-22T06:13:50Z")

</div>

Is there a way to add a prompt(s) for the dropdowns generated by date\_select? Shooting in the dark, I tried using :prompt =\> true with no result. Thanks.

---

## [How to do a join with Rails](https://www.ruby-forum.com/t/how-to-do-a-join-with-rails/138338)

<div class="topic-metadata">

**Author:** [@frew](https://www.ruby-forum.com/u/frew)\
**Replies:** 4\
**Last updated:** [May 22, 2008, 5:41am UTC](https://www.ruby-forum.com/t/how-to-do-a-join-with-rails/138338 "2008-05-22T05:41:40Z")

</div>

Hey all, I am trying to do a regular old join with ActiveRecord. This is the code that a friend suggested: A.find(:all, :conditions =\> {‘b.foo’ =\> 25}, :joins =\> \[:b\]) The idea here is to find all of the A’s that ha…

---

## [Getting errors in cached environment on destroy](https://www.ruby-forum.com/t/getting-errors-in-cached-environment-on-destroy/138309)

<div class="topic-metadata">

**Author:** [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Replies:** 3\
**Last updated:** [May 22, 2008, 3:31am UTC](https://www.ruby-forum.com/t/getting-errors-in-cached-environment-on-destroy/138309 "2008-05-22T03:31:38Z")

</div>

I have a project that is having some issues in clearing cache files in any environment that allows for data caching. This is the error that I am getting: ArgumentError in Admin/pagesController#destroy wrong number of…

---

## [Test for user logged in](https://www.ruby-forum.com/t/test-for-user-logged-in/138324)

<div class="topic-metadata">

**Author:** [@joel](https://www.ruby-forum.com/u/joel)\
**Replies:** 1\
**Last updated:** [May 22, 2008, 2:38am UTC](https://www.ruby-forum.com/t/test-for-user-logged-in/138324 "2008-05-22T02:38:35Z")

</div>

Hello people, Still a newbie in rails, wanted to know if there is a way to test if there is a user actually logged in from controller action code ? I’m using restful authentication . Regards, Joel

---

## [Strange error.... ActionController::RoutingError](https://www.ruby-forum.com/t/strange-error-actioncontroller-routingerror/125872)

<div class="topic-metadata">

**Author:** [@liberte](https://www.ruby-forum.com/u/liberte)\
**Replies:** 8\
**Last updated:** [May 22, 2008, 1:41am UTC](https://www.ruby-forum.com/t/strange-error-actioncontroller-routingerror/125872 "2008-05-22T01:41:23Z")

</div>

Hello, i have a problem, had a table called news and other called news\_images, the first é for save news and other for save url for images associated with news. Make migrations for each table manual and db:migrate af…

---

## [Fixtures :only and :except?](https://www.ruby-forum.com/t/fixtures-only-and-except/138322)

<div class="topic-metadata">

**Author:** [@ericgoodwin](https://www.ruby-forum.com/u/ericgoodwin)\
**Replies:** 0\
**Last updated:** [May 22, 2008, 1:08am UTC](https://www.ruby-forum.com/t/fixtures-only-and-except/138322 "2008-05-22T01:08:40Z")

</div>

Are there any ways to exclude fixtures from being loaded in certain methods in a test suite? It seems like when you define a fixture it has to be loaded for every method no matter what and you have no control over it.…

---

## [Validate length of uploaded mp3?](https://www.ruby-forum.com/t/validate-length-of-uploaded-mp3/137487)

<div class="topic-metadata">

**Author:** [@dino\_d](https://www.ruby-forum.com/u/dino_d)\
**Replies:** 1\
**Last updated:** [May 21, 2008, 10:54pm UTC](https://www.ruby-forum.com/t/validate-length-of-uploaded-mp3/137487 "2008-05-21T22:54:03Z")

</div>

Hi - I am uploading voice recordings and want to ensure they’re not longer than 30 seconds. Anyone have a good strategy? Thanks, Dino

---

## [Check if error\_messages\_for contains special error](https://www.ruby-forum.com/t/check-if-error-messages-for-contains-special-error/137481)

<div class="topic-metadata">

**Author:** [@dummschwaetz](https://www.ruby-forum.com/u/dummschwaetz)\
**Replies:** 1\
**Last updated:** [May 21, 2008, 10:49pm UTC](https://www.ruby-forum.com/t/check-if-error-messages-for-contains-special-error/137481 "2008-05-21T22:49:22Z")

</div>

Hi, im realy new to ror, so my question may be stupid: in the controller I check if a person who wants to register ist older than 18 years. If the person isn’t I add an error with errors.add\_to\_base($USER\_ERROR\_VOLLJ…

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

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