similar to: accessing validates_... , :message => 'something'

Displaying 20 results from an estimated 2000 matches similar to: "accessing validates_... , :message => 'something'"

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
2006 Aug 07
1
Override flash message - help
How can I modify the flash message that is displayed on a validates_* check? I used the :message => "" parameter, but it still gives me an annoying "Test : Please ensure you have entered the test message". I wanted to get rid of the "Test: " and the above "6 errors prohibited this table from being saved" I looked at the source of
2006 Dec 12
2
Error message translation
I have a problem with translation of english phrase when an input error occurs. When I put: error_messages_for("registratie") above my view. I get the error: "xx errors prohibited this registratie from being saved". The problem now is, the site is for dutch customers and I would like to translate this to a dutch phrase. I know I can translate the individual fields with the
2008 Jan 31
3
presenting validation errors via fbml?
Hi Facebookers, Is there a helper or suggested approach for presenting validation errors on an fbml form? Something to translate rails error markup to fbml:error markup? thanks Joel
2007 Jun 10
2
custom errors for validates_presence, etc..
I am trying to figure out how to customize the error messages when I use validates_presence_of. I am validating a user name and I use <%= error_messages_for ''user'' %> in my view to display the messages. I know you can customize in the model with :message =>''custom message'', but I am trying to get rid of the first part of the error message which is, 1
2005 Jan 17
5
how to override rails errors messages?
hi, how can i override rails errors mesages (that are in english) to display them in an other language? thanks hangon
2006 Sep 27
2
how to get the message from validates_presence_of
hi, I''ve a model with validates_*_of statements, but I have no idea how to get the :message back, anyone has a clue? Thanks. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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
2007 Dec 05
5
Active Record, Migration, and Translation
Hi, I think the columns and table in migration should be able to have an optional "display_name" set manually. Something like: create_table :people, {display_name => "Personne"} do |t| t.column :first_name :string, :display_name => "Prénom". end Let me explain my point of view: Rails is a framework made to write programs in English. You see it when you
2006 Mar 26
1
How to override generated in validation html code?
Hi, I would like to ask how to override validation functionality in RoR? In active_record_helper.rb class there is "hardcoded" default html generated durning validation. If I will use {code:ruby} validates_presence_of :summary, :description {code} in my model class, there is html generated: {code:html} <div class="errorExplanation"
2006 Aug 10
0
Broken validates_* functions
Hi, I''m trying to work my way through the agile book and I''m at the example where I bring in form validation using the validates_presence_of methods and so on. The problem I am having is, my application completely ignores these functions. Even though the methods are there, they don''t catch any empty fields. This is what I have, created with scaffold: class Product
2007 Nov 21
2
When you sometimes wonder how to test this??
Hi Just something that I have been finding very helpful sometimes when I am stuck with "how could I test this?" moments is looking at the Rails test suite. At the moment I am working on testing our custom error_messages_for methods and I have found looking at how the Rails tests in active_record_helper work helpful :-) So just thought I''d share that. Have
2006 Jul 18
2
Turn element hidden by default (ajax question)
(this is my first post on the ruby forum. If this is not the right place for this type of question please let me know). Ajax question I have a checkbox that toggles the visibility of another element (a text field) with the code: --- <p><label for="checkbox">Appear!</label> <%= check_box :object_name, :method, :onClick =>
2006 Apr 07
2
errors.add_to_base
What are the limitations on using: errors.add_to_base to display errors in views? I have tried for days to add errors from my object.rb and they never get displayed. class Keyword < ActiveRecord::Base validates_presence_of(:name, :message => "Name is required.") validates_uniqueness_of(:name, :message => "This name is already in use. Please try
2007 Mar 18
7
How to get more informations about an association at runtime
Hi all I''m working on a Custom Formbuilder. I want it to create me with a single method call checkboxes for a given HABTM association. My model looks like this: [code=ruby]class Member < ActiveRecord::Base has_and_belongs_to_many :preferred_music_styles, :class_name => ''MusicStyle'', :join_table =>
2005 Dec 29
3
NoMethodError problem
Hello. Id like you to help me with something here, i m trying to create a log manager just for fun but I cant make it work since the beginning. I created my project, configured the db, initialized my model Log and then my controller Log, then im just trying to use scaffold :log for the controller but I cant make it work, the error says: undefined method `errors'' for
2007 Apr 09
4
How do i switch off error wrapping for a specific field?
Hi, i have some issues with the default rails error wrapping. It wraps errors in a div with class ''fieldsWithError'', which is not good practice in my eyes. Adding a class ''error'' to the field would be much nicer. My solution to the problem: build your own FormBuilder. Funny enough, i found no (nice) possibility to switch error wrapping off while using the
2006 Jan 26
21
pagination_links help
I want append custom query parameters to my pagination links, like ?page=1&foo=bar. I can''t quite figure out how to do this with the pagination_links helper, although I believe the API says you should be able to: pagination_links(paginator, options={}, html_options={}) options are: :params: any additional routing parameters for page URLs Has anyone tried this? thanks, jeff --
2006 Apr 08
2
ActionView::Helpers::FormHelper instance methods should take an object reference rather than an object_name.
Hi ActionView::Helpers::FormHelper methods (e.g. #text_field, #check_box...) take object_name as an argument. From this argument they infer a name that is supposed to contains the reference to the relevant object. I can''t see why the FormHelper methods were designed that way. Compared to simply passing them a reference, the current way seems too complicated and an invitation to problems
2006 Feb 26
2
howto keep already entered form fields
Hi, is there a way to keep the already entered form fields when the form is re-displayed after some error has been detected and reported to the user via flash? Regards IJD -- Posted via http://www.ruby-forum.com/.