Displaying 7 results from an estimated 7 matches similar to: "Login Generator and Salter"
2006 Jun 13
7
model validation across multiple views
I have a rather complex object with a number of attributes. For a variety
of reasons, I would like one view to create the object with only a couple of
fields completed, then a second and third view to finish all the fields. I
would like the model to validate_presence_of all these fields, since
eventually I need them all there, and I would like each page to validate its
portion of the fields that
2008 May 25
2
record will absolutely not save! so weird, please help.
I have a weird problem going on. All of sudden, records for a certain
model will not save with #save Please take a look at this:
>> p = Payment.new(:payment_reason_id => 1, :payment_method_id => 1, :date => Date.today, :amount => ''5.00'', :payable => Student.find(608))
=> #<Payment id: nil, school_id: nil, payment_reason_id: 1,
payment_method_id: 1,
2006 Jul 25
1
save trouble with has_many belongs_to relationship
I have a bit of code in a controller that looks like this:
@current_festival.monitor_preferences.each do |pref|
if pref.user_id == @me.id
pref.preference = params[:monitor_pref]
#pref.save
end
end
@current_festival.save_with_validation(false)
the Festival class has_many :monitor_preferences
the MonitorPreference class belongs_to :festival
In the configuration above, the
2006 Jan 19
2
Easy way to handle form input without a model class?
I have a couple forms that I''d like to be able to validate and
automatically populate, but it shouldn''t be based on AR. In fact I
often have a bunch of small forms that I can''t really justify writing
a whole new model class for anyway. I''d like to validate the form
input, and then use rails helpers to automatically populate the form
if validations fail.
2006 May 12
1
Some error about adding.
Ok so I''m trying to make a little exchange 3 for 1 of 1 higher rank here
is the code in the controller:
def exch_link
@id = @session[:user].id
@type = @params[:type]
exch(@id,@type)
end
def exch(user_id,this_type)
@user = User.find(:condtions => "id = " + user_id)
@ranks =
2005 Dec 26
3
Override Validation?
Hi all,
is there a way to override the validation methods so as to avoid the
div.fieldWithErrors divs from being created on the redisplayed form?
Many thanks in advance,
Nicky
2006 May 23
2
Overriding validation?
Is there a "normal" way to override the behavior of validator methods
(like validates_presence_of) for updates vs. creation? For example,
in the AWDR example store program, the User class validates the
presence of the password and its length - which makes sense when the
user entry is created. But what if you wanted to provide an update
form that updates just certain items