search for: error_message_on

Displaying 20 results from an estimated 24 matches for "error_message_on".

2005 Sep 25
2
Problem issue with belongs_tohas_one and error_message_on
Hello I have a problem with relationship with belongs_to - has_one and with error_message_on I have splitted one huge table users into two tables user and profile. In users I''m keeping main fields like id,email,password and in profile there are the rest of fields. Table users: id,email,password Table profiles: id,user_id,publicname, and more ... My models are: - user.rb has...
2007 Jan 03
2
error_message_on broken?
Hi, in my app, using the error_message_on form helper like this: <label for="user_name">User name:</label> <%= error_message_on ''user'', :name %> <%= f.text_field :name %> generates the following error: undefined method `errors'' for :user:Symbol I am using edge revision 5813...
2005 Dec 23
1
Overloading error_message_on method in ActiveRecordHelper
Hello all I would like to overload the error_message_on method in the ActiveRecordHelper module in order to emit a span tag instead of a div tag. I try to achieve this by way of plugins: Under vendor/plugins I''ve made a error_messages_on_fix directory, containing init.rb like this: --- require ''active_record_helper_fix'' --- ....
2005 Dec 27
0
Re: RESOLVED: Overloading error_message_on method in ActiveRecordHelper
...on itself that caused problems. Ruby doesn''t have keyword arguments, but I tried calling the method as if it had. But when I changed the definiton to one with a hash that simulates keywords, it works just fine: --- module ActionView module Helpers module ActiveRecordHelper def error_message_on(object, method, params = nil) if params.class == Hash prepend_text = params[:prepend_text] || "" append_text = params[:append_text] || "" css_class = params[:css_class] || "formError" span = params[:span]...
2006 Jul 17
0
error_message_on / error_messages_for
Hi, just a simple question between error_message_on / error_messages_for ... Well, if you use error_messages_for in your web page, there is no problem even if anObject==nil (for example , the first time you load your form) whereas error_message_on must be use with an instanciated object ... So, you always has to double check if anObject is not n...
2006 Sep 14
0
Work around for problems with error_message_on
Hey all I was encountering problems with error_message_on in the fact that it caused an exception when no object by that name had any errors (or did not exsist) so i created this work around... def display_error(obj, method, prepend_text = "", append_text = "", css_class = "form_error") object = instance_variable_ge...
2006 Aug 02
3
Disabling Error Divs
I am trying to figure out how to disable the error field thing in rails, the thing that wraps errous fields with a div (class fieldWithError). Any help on this would be great! -Ray -- Posted via http://www.ruby-forum.com/.
2007 May 24
3
Help with Create and Update with options_for_select in a select_tag
...]'', options_for_select($types, ''@types''), {:multiple => true, :size => 5, :id => "access_control_value", :onfocus=>"fixedtooltip(CONTROL_MSSG, this, event, '''')", :onblur=>"delayhidetip()"}%> <%= error_message_on :service, :access_controls %><br /> Controller -------------- #create works but is this the best way? def create ..... if params[:access_control] params[:access_control].each do |value| control = AccessControl.new control.value = value control.service_id =...
2008 Feb 27
8
ActiveRecord validation messages not I18N-friendly and enforces grammar
ActiveRecord validation messages are currently not I18N-friendly. Specifically, I''m referring to the fact that it enforces a certain grammar, namely the beginning of the message must consist of the field name. For example: validates_presence_of :name, :message => "can''t be blank." ...generates the message "Name can''t be blank". This grammar
2006 Jul 21
1
validates_acceptance_of weirdness
On my registration form I have a checkbox for a waiver. In the model I have the statement: validates_acceptance_of :waiver, :on => :create, :message => "must be accepted" In the view: <%= check_box_tag("waiver") %> <%= error_message_on "user", "waiver", "Waiver "%> For some reason validate is accepting everything when the checkbox is NOT checked. When it is not checked the value is nil -- when checked it is "1". What am I missing here? There are no other validation statements with...
2006 Apr 04
2
how to perform client side validations in RoR?
Hi, I have a form for user registration. In that form there are fields for password & confirm_password. Now in my database there is column corresponding to password field. Now at clicnt side I want to validate equality of password & confirm_password field. How to do that? I have downloaded one password validator plugin & tried to used it. But it requirs two seperate fields in
2006 Jan 04
1
[SOLVED] Am I going too far or Rails is just confusing?
...llowing your article, I change my I have found the source of the problem. I follow the solution provided by http://blog.teksol.info/articles/2006/01/03/belongs_to-user-interface-take-ii It''s a nice solution, however it contains typo :) There is indeed no error_messages_on method, instead error_message_on :) You can update your article Francois ;) Tq, John
2007 May 24
1
How do I show the selected values in options_for_select? Not as simple as it sounds.
...#39;access_control[]'', options_for_select($types, @types), {:multiple => true, :size => 5, :id => "access_control_value", :onfocus=>"fixedtooltip(CONTROL_MSSG, this, event, '''')", :onblur=>"delayhidetip()"}%> <%= error_message_on :service, :access_controls %><br /> But when I edit a Service with access_controls, nothing is pre- selected. What am I doing wrong? Please, show me in this example, not some simple example that I have seen a million times already, i.e., the API example. Thanks in advance, K --~--~--...
2006 Oct 09
4
error message on the redirected page
def edit @product = Product.find(params[:id]) end def update @product = Product.find(params[:id]) if @product.update_attributes(params[:product]) flash[:notice] = ''Product was successfully updated.'' redirect_to :action => ''show'', :id => @product else render :action => ''edit'' end end when errors happen, to avoid
2006 Mar 29
2
save related models from one form
...login(@customer.username, undigestedPassword, "identity") #Login and redirect the user to the selected identity end #end transaction rescue ActiveRecord::RecordInvalid end end end #end of create data My rhtml-file uses "error_message_on", "error_messages_for" and checking if pwdmismatch is true to mark errors in the input data. Like I said, I would need some help on this. Best regards, Daniel -- Posted via http://www.ruby-forum.com/.
2006 Apr 07
0
validates_acceptance_of problem
...culties getting validates_acceptance_of to work. No matter whether I tick the checkbox for my terms and conditions on my form, it will not submit it and shows my error message. in my model i have: validates_acceptance_of :agree_to_terms, :message => "" in my view i have: <%= error_message_on :user, :agree_to_terms, "You must agree to the terms and conditions" %> <label for="agree_to_terms" class="left">I agree to the <a href="/terms">terms and conditions</a></label> <%= f.check_box :agree_to_terms, ''class...
2006 Apr 28
2
Ajax form error handling
Hi, I have a customer add form in which i call form_remote_tag to update a customer list within another div on my page. I need to also, however, allow for proper error checking, and the issue is that the form_remote_tag will only update a single div tag. I have seen a few ways to deal with this, but I want to know what the best way is, while still allowing the model to do all of the
2006 Nov 13
1
error_messages_on
With the helper "error_messages_on", if a method, "price", for example, has 2 errors (numericality and presence), how can I access on both errors? Thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to
2009 Nov 27
1
Nested model + error message
Hello Friend, I want to override the default error message, but some how I am not able to implement it. The scenario is I have a user table and user detail table I have implement nested model. And the below mention message is appearing and instead of that I want something "User Name cannot be blank" - *User detail given name can''t be blank* Thanks Abhis -- You
2006 Jul 17
0
Ruby-GetText-Package-1.7.0
Hi, Ruby-GetText-Package-1.7.0 is now available. Enjoy L10n! Changes ------- * Improve to support Ruby on Rails * Localize ActionView::Helpers::DateHelper.distance_of_time_in_words. * Localize ActionView::Helpers::ActiveRecordHelper.error_message_on. * Add ActiveRecord::Base.untranslate, .untranslate_all to prevend to translate columns. * "ID" fields are ignored as msgids. It won''t appear in po-files, now. * Fixed bugs, code cleanup. * Update translations * Chinese(zh), Czech(cs), Dutch(nl), English(default),...