similar to: Peculiar validation error: undefined local variable or method 'fieldWithErrors'

Displaying 20 results from an estimated 600 matches similar to: "Peculiar validation error: undefined local variable or method 'fieldWithErrors'"

2006 Aug 25
7
acts_as_ferret with conditions
Hello guys, Having a slight problem with acts_as_ferret, specifically using a condition. I have the following code @results = SupplierProduct.find_by_contents(params [:search], :conditions => [''area_id = ?'', @area]) and it seems the condition isn''t being applied. Does anyone have any pointers? Cheers, Alastair ------ Alastair Moore Standards compliant web
2006 Aug 26
3
order of saving/validating
Hi guys, I''m trying to do some validation on an image upload. Basically I have a model, Property, which has_many :property_images. I need to check that one image has been uploaded at least and so it was suggested I checked the number of images uploaded - @property.property_images.count > 0. Makes sense. I''ve added a validation on my Property model, like - def
2006 Jul 12
0
Give form elements "fieldWithErrors" class in non-std. way?
All, I want to know how to force an element of my model to be invalid, but not generate any message for it, so that the corresponding form field on a form will show up with the ''fieldWithErrors'' class. I have some checkboxes on my RHTML form, and they are generated with this code <%= check_box_tag("current_job[target_list_ids][]"...etc. %> target_list_ids
2007 Nov 27
1
O/T div.fieldWithErrors styling
this is kinda trivial but I''m anal and it bugs me :) whenever there''s a error in the form the error field is wrapped with <div class="fieldWithErrors"> </div> this throws my form''s styling off because it puts too much space b/t fields and worse makes the form as wide as possible. How do I fix this? I''ve tried div.fieldWithErrors {
2005 Aug 19
1
css style fieldWithErrors when using tables
I''ve run across something that I''m not sure how to fix. This is with MSIE, Firefox doesn''t seem to have the same problem. When rails displays form fields in error using the css element fieldWithErrors, and the form field is enclosed in a table data tag, the entire background of the table data element is set to red instead of just the border of the form element.
2007 Jan 13
1
fieldWithErrors - does not work
What conditions must be met for ''fieldWithErrors'' automatic wrapping? <% remote_form_for( :subscriber, :update => ''subscription'', :url => {:controller => ''subscribers'', :action => ''subscribe''} ) do |form| %> <p> <%= form.text_field
2006 Mar 25
7
Overriding <div class="fieldWithErrors">
Does anyone know how to override the <div class="fieldWithErrors"> behaviour when a form field is incorrect? Thanks, Dan
2006 Feb 24
5
Changing default behavior of fieldWithErrors
Hi! The topic can be a bit misleading, because it may suggest that i want to change css style. What i''d like to change is that normally, when there''s an error, rails creates a div element with the fieldWithErrors class as the parent of the input. I''d like to change this behavior, so the input element itself will have this class added to its current classes and
2006 Feb 21
1
Custom forms and fieldWithErrors tags
Hi, (probably) A newbie questions: I have a form where a user can choose an email address, but there are only some choices for the domain, so I wrote a helper where the local part of the email is a text field and the domains is a dropdown list, like: Select Email: [ my_name ] @ <domain.com> ..which I defined as a helper: def email_form(tagname, domain_list)
2007 Oct 22
1
installing rspec/rspec_on_rails as system wide generator (or similar)
Hi all, What would be the best/easiest way of installing rspec as a system wide generator so I''m not having to download it or ./script/plugin install it every time? Thanks, Alastair ----- Alastair Moore Freelance web design, development and consultancy t. 07983 983945 e. alastair at kozmo.co.uk w. http://www.kozmo.co.uk skype. alastair_kozmo
2006 May 18
3
Google Map
Used a great howto @ http://iamrice.org/articles/2005/12/09/using-google-maps-in-the-uk-with-rails for using google maps on uk sites. Just having one issue I can''t seem to work out how to draw the postcode from my table I keep getting hit by method errors. The controller is require ''postcode_2_latlong'' postcode = Postcode.new("TN22 2LG") # I want this to
2006 Aug 19
1
Re: validates_associated
On 8/19/06, Alastair Moore <alastair-mb+lb5rSoAr10XsdtD+oqA@public.gmane.org> wrote: > > Hello all, > > Having a bit of a problem with validates_associated. I assume I''m missing > something out but basically got these two models - > > class Seller < User > > has_one :profile, :foreign_key => ''user_id'', :dependent => :destroy
2008 Sep 22
1
Ccreating methods on the fly / counting distinct field values
Hi, I''m pretty new to ruby and rails, so apologies if this has been covered before (I couldn''t find a thread on it). I want to retrieve a count of records held in the DB for every distinct value of an attribute. E.g. given a class Address with a postcode field, I would like to retrieve an array of ValueCount objects. The ValueCount object would hold the value retrieved from
2008 Sep 06
0
Tab control using FXRuby
In the sample program below I have a form of 6 text fields, in a scrolling window, followed by a row of function buttons. Problems: 1) For data entry purposes I''d like the function buttons NOT to be entered by pressing Tab keys, and retain their ''clickability'', but when the user Tab''s out of the last scrolling field (postcode) to have the form scroll to the
2006 Feb 28
1
Wrong id after join!
The Problem ----------- After using a join in my find the id attributes set in my Entity objects are wrong! It is setting the Entity id to the value from Postcode id! The Code -------- entities = Entity.find(:all, :conditions => [...omited...], :joins => "as e inner join postcodes as pc on substring_index(e.postcode,'' '', 1) =
2005 Aug 10
5
validates_format_of on an optional field using :if
Hi there, I''ve got the following in my model: validates_format_of :postcode, :with => /^([a-zA-Z]{1,2}[0-9]{1,2} [0-9]{1}[a-zA-Z]{2})$/, :message => "is not valid", :if => :postcode ... but it''s not working - it always insists on validation, even if postcode is empty. Basically, the postcode field is optional, but if it''s filled in, I want to
2006 May 23
0
where to initialize a variable in an AJAX based application
Hello All, I am getting confused with best practices. I posted a topic earlier but realized how confusing it was. Thus I will do my best to be as clear as possible. I am a bit confused on best practice for instanciate a variable that will be used accross several methods within the same controller. I need this because of AJAX, here is a description of what I intend to do: (all this in done
2008 Jun 18
1
Question
Hi list, I am trying to convert my Data from 1st following format to the second. Any comment? You could copy following in Tinn R Data<- data.frame(location=c("postcode","sector","long/lat","sector"),Grade=c(" h","m","L","h"),value=c(2,3,5,6)) #Question: how can I reshape Data to the following # Grade postcode
2007 Oct 10
9
Rspec Textmate bundle errors
Hello all, Having a problem with the Rspec textmate bundle and having quizzed the guys in #textmate to no success about the errors, I''ve been suggested to try you guys! When I run the "Run Behaviour Description" command, I get the following errors: /Users/alastair/Library/Application Support/TextMate/Bundles/ RSpec.tmbundle/Support/lib/spec/../spec/mate/runner.rb:34:in
2008 Mar 07
0
Time series panel
I have a set of data that consists of a number of biological measurements. The columns are Time that runs from 01/01/2005 to 01/5/2007, Group which has 23 levels and postcode which is nested within group. This is a balanced panel but the number of postcodes differs within groups, from 15 to 400. The rest of this data consists of a number of columns of quantitative measures, largely counts.