search for: error_message_for

Displaying 4 results from an estimated 4 matches for "error_message_for".

Did you mean: error_messages_for
2006 Feb 16
1
Help with validation
...ly: [CODE] def validate if date_start > date_end errors.add_to_base("From date cannot be greater than to date") end end [/CODE] I know the validation works because I can get the ''Failed'' flash notice, but I can''t seem to get the error message using error_message_for(:holiday) in the page. I also can''t seem to get the data to repopulate the form. I normally access the data in the controller using @params[:holiday] as the params go into a hash called holiday in the params hash, but when they get passed back to my form, they don''t live in t...
2007 Dec 09
0
Writing Specifications for Custom Form Builders (and Helpers)
...the extended_form_builder_spec.rb is not running like a view spec where I assume @template would be set up. Which brings me onto my second question, what sort of tone of voice should I be using to describe Helpers, at the moment I am using stuff like: describe ApplicationHelper, ''error_message_for method'' do it ''should not return the error message if the instance doesnt exist yet'' it ''should return the error message if there are errors on the object'' it ''should not return the error message if there are no errors on the obj...
2006 Jun 13
7
help with ''error_messages_for''
Greetings, I''m in the throws of deploying an app on site5, and I''m getting strange errors. I think I might need to understand how error_messages_for works. I get a pretty standard looking error: " You have a nil object when you didn''t expect it! You might have expected an instance of ActiveRecord::Base. The error occured while evaluating nil.errors Extracted
2006 Jan 27
17
Multiple Model Validation
Hey All ! I have a form which contains two models. I would like both models to be validated, but have their validations aggregated on the page. If I do: <%= error_messages_for(:model1) %> <%= error_messages_for(:model2) %> It puts two big validation blocks on the page. I would like all the errors from both models, but only in one validation box. Is this possible ? All my attempts