similar to: ruby help / if (cond or cond)

Displaying 20 results from an estimated 2000 matches similar to: "ruby help / if (cond or cond)"

2006 Mar 13
2
Prototype ajax/javascript q
I''m trying to send to my application the coords x,y on an "input type image" in a html form, but x,y variables are not present in the POST_DATA (are not submitted). Any other field (hidden inputs) are being sent when I click on the image input form field. I use rails 1.0 and prototype 1.4, browsers Seamonkey 2.0, Firefox 1.x and Konqueror, Linux, and I''m just a
2009 Apr 06
3
After Rails 2.3.2 upgrade: superclass mismatch for class TestCase (TypeError)
I upgraded a working app from rails 2.1 to 2.3.2. Now when I run rake test:units I get this error: /usr/lib/ruby/gems/1.8/gems/ activesupport-2.3.2/lib/active_support/test_case.rb:17: superclass mismatch for class TestCase (TypeError) I generated a new test app and all tests run OK. For the upgrade I ran rake:update and renamed the class in test_helper to ActiveSupport::TestCase. Also renamed
2007 Feb 25
5
Dynamically uploading a list that's already in a form
I have the classic case of: Posts, and Categories. When the user submits a post, he has a drop-down list of categories. I want to put a "Add category" link next to the list of categories. This is already inside a form, so a "link_to_remote" that creates a small AJAX form inside the "submit post" form will not work because that will mean to embed a form in another
2006 Mar 14
4
ruby-postgres: can''t convert string to integer
Hi everybody, I''m experiencing trouble when trying to use ruby-postgres with a legacy database I need access to. To me it seems the problem is the VARCHAR columns used there as primary keys. On a simple me = User.find(''PS12345'') I get a type error exception with the message ''can''t convert String into Integer''. The trace is:
2010 Jul 08
3
my web app seed data and cucumber
I''m writing a web app which is used a SaS. Each customer has their own db and app directory. I have a rake task which creates all necessary minimum data to run their website: default rights and roles, a superadmin user, a "us_states" table already populated, some local depots and terminals (it''s a logistics app). I don''t have any cucumber scenarios for it and
2007 Mar 23
4
DRY - with modules, render_component or.. ?
I have an B2B application where a pretty complex order form needs to be submitted and edited on the admin controller, buyer controller and seller controller with some small differences. How do I make available the edit order methods all controllers? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are
2008 Feb 03
1
ActiveRecord object.valid? triggers unexepected results
I''m editing an ActiveRecord object in a session through AJAX, updating it with object.attributes = params[:object], and validating it with object.valid? Because it''s associated with other objects in a form, I want to save them all together. The surprise was that object.valid? triggers after_validation_on_update. I''m having an audit log and I was getting bogus entries.
2009 Apr 07
3
assert_valid in unit tests after upgrade to rails 2.3 doesn't work
def test_valid assert_valid State.first end Error: test_valid(StateTest): NoMethodError: undefined method `assert_valid'' for #<StateTest: 0x7f0d60750318> I see that test_valid is now in ActionController::Assertions::ModelAssertions. Does this mean that test_valid is designed to be used i ActionController tests only? I can change my assert_valid(State.first) into assert
2006 Jan 05
13
Date Validation
Hi, How can I validate date in model class Thanks. Sainaba. -- Posted via http://www.ruby-forum.com/.
2006 Mar 23
2
newbie - form_tag with get?
I can''t create a form with method "get". The rhtml code: <%= form_tag :controller => ''teritory'', :action => ''add'', :method => ''get'' %> The generated html code: <form action="/teritory/add?method=get" method="post"> What i''m doing wrong? -- They say money can''t
2012 Jun 04
4
Driver for a REDi Blazer 600VA UPS
I'm running NUT 2.6.3 on Debian wheezy [ with a 3.3.0 i686 kernel ] I've installed NUT via Debian APT [ package nut version 2.6.3-1 ] I have a REDi Blazer 600VA (BLAZER600c) UPS and I want to detect power failures. I have tried the following drivers: * gamatronic: Can't talk to UPS on port /dev/ttyS1! * bestups: Unable to detect a Best/SOLA or Phoenix protocol UPS * blazer_ser: No
2005 Feb 13
5
Select Enumerated Values with FormOptionsHelper
Hey, I''m new, so apologies if I''ve overlooked obvious resources or violated any etiquette rules for this list. Since rails does not support the MySQL enum data type, I''m following David''s advice of using a varchar and storing the valid values in the application: http://one.textdrive.com/pipermail/rails/2005-January/001536.html So here''s my
2007 Dec 27
4
validates_file_format_of only when is there an image
i have a model with this: file_column :image validates_file_format_of :image, :in => ["gif", "png", "jpg"] If inthe form the user not insert the image i receive an error. If i remove: validates_file_format_of :image, :in => ["gif", "png", "jpg"] it works. Is possible do the validation only when user insert the image in form? i
2006 Feb 24
2
Shortcircuit evaluations
This is probably a Ruby questions but since my issue exists in a Rails validation I thought I''d post here. I have the following validator validates_each :thumbnail, :regular do |record, attribute, value| unless value.nil? && value.valid? record.errors.add( attribute,
2004 Dec 22
7
From a newbie: how to run MS Word?
Hi! Half an hour ago I installed wine-20041201 under Mandrake Linux 9.1, successfully I think. On my PC I also have a partition with Windows 98 in it, correctly mounted. I installed Wine with the main purpose of properly writing and reading documents in MS Word, since neither kword, nor Open Office kwrite nor even abiword achieve this purpose in a satisfaying way. Now, probably I haven't
2012 Jun 09
3
[HCL] REDi/Centralion Blazer 600 VA (BLAZER600c) supported by blazer_ser
The REDi Blazer 600VA (BLAZER600c) UPS found here [ro_RO]: http://www.emag.ro/ups-redi-blazer-600va-blazer600c/pd/EX5X2BBBM/ which is actually a Centralion Blazer 600VA [en_TW]: http://www.centralion.com/html/product/back-Product-ups-blazer400.htm works with the blazer_ser driver ----------shell output---------- # upsrw ups # upscmd -l ups Instant commands supported on UPS [ups]: beeper.toggle -
2002 Feb 05
2
Wine always tries to connect to ":0.0"
Wine always give errors when it tries to start on xser ver ":1" because it always tries to connect to ":0.0". I know that DISPLAY is set correctly: Xlib: connection to ":0.0" refused by server Xlib: Client is not authorized to connect to Server
2005 May 04
1
Conditional validations
I''ve been working with the problem that Joe Hosteny has been talking about on this list and on the tickets he''s posted (http://dev.rubyonrails.com/ticket/1196) and have come up with a tentative solution that I''d like to bring up here. What if we use a "conditional" parameter in the validates_* methods? Here''s how it would look like in practice:
2007 Apr 10
15
Poor man''s backup by attaching/detaching mirror drives on a _striped_ pool?
Hi, one quick&dirty way of backing up a pool that is a mirror of two devices is to zpool attach a third one, wait for the resilvering to finish, then zpool detach it again. The third device then can be used as a poor man''s simple backup. Has anybody tried it yet with a striped mirror? What if the pool is composed out of two mirrors? Can I attach devices to both mirrors, let them
2007 Jul 24
4
Possible Bug
I''m trying to test some code that has validates each and I''ve got a very strange failure Mock ''Book_1027'' expected :store_with_privacy? with (#<Clip:0x1a99b96 @name="Clip_1025">) but received it with (#<Clip:0x1a99b96 @name="Clip_1025">) The Spec it "should check that a book can save a clip" do @user =