Displaying 4 results from an estimated 4 matches for "field_helper".
Did you mean:
field_helpers
2012 Sep 08
4
dash symbol
In the example below, what is the dash doing between the class
attribute and array:
(field_helpers -
[:label, :check_box, :radio_button, :fields_for, :hidden_field, :file_field]).each
do |selector|
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6...
2006 Apr 11
1
Mixins?
...raight into the models directory:
module FieldHelper
def validate_field
if template_field.mandatory? && (!field_value || field_value.length==0)
errors.add(template_field.name, _(''cant.be.blank''))
end
end
end
Now in the model I have this :
require "field_helper"
class SchemeAccountField < ActiveRecord::Base
include FieldHelper
protected
def validate
validate_field
end
end
So basically I want to mix in very similar validation rules.
However, what I get is:
undefined local variable or method `validate_field'' for ...
I'...
2006 Jun 05
3
ActiveRecord validations and FormBuilder
Hi,
I''m writing my own FormBuilder and I wanted to put an asterisk or
something next to any required fields. The Builder has access to the
AR object, is there any method I can call on the AR object that will
tell me whether or not a particular field is required? Failing that,
can I access the complete list of validations so I can look through
it for instances of
2006 Apr 23
3
custom form builder
In the API docs I found this:
"You can also build forms using a customized FormBuilder class. Subclass
FormBuilder and override or define some more helpers, then use your
custom builder "
I couldn''t find any further documentation on this. Where can I read more
about this formbuilder class? For starters, where would I define a
subclass of this class?
TIA,
Jeroen
--