similar to: error_messages_for - Custom formating

Displaying 20 results from an estimated 2000 matches similar to: "error_messages_for - Custom formating"

2007 Jul 15
0
errors_for
Been playing with merb. One of the helpers I liked in rails was on form validations. Found this was real easy to port over, so I thought I''d share. It doesn''t highlight the field with the error, but it gives that same nice little div on top. Say I had an articles controller def create @article = Article.new(params[:article]) @article.save! redirect
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 Apr 11
0
Problem w/ error_messages_for: wrong number of arguments?
Hi guys, I just upgraded to the latest version of Rails 1.1 and am getting some odd error messages. Specifically, I have the line: <%= error_messages_for ''user'' %> at the top of one of my .rhtml files and of course a variable @user. When an error occurs when saving ''user'', instead of getting the error message (which happened fine in Rails 1.0), I now
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
2006 Mar 01
5
scaffold.css and Rails tutorial problem
In iteration D.1 on page 109 I am not getting a styled error message box displayed at the top of the checkout as described in the tutorial and I cannot seem to discover where I have erred. The scaffold.css is copied from the pragmatic programmers site: #-------------------------------------------------------------------- $ cat public/stylesheets/scaffold.css body { background-color: #fff;
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"
2010 Aug 18
7
error_messages_for doesn't work
I''m having a problem, ''cause I wrote the following line in my model "Hi": [code] validates_numericality_of :phone, :only_integer => true, :allow_blank => false, :message => "must be a number" [/code] And in my "new" view, I put: [code] <%= error_messages_for :oi, :header_message => "Erro ao cadastrar
2006 May 03
1
error_messages_for when saving within another model
Hi, I have this save routine: def customer_address_create customer_options @customer = Customer.find(params[:id]) @customer.addresses.create(params[:address]) @saved = @customer.save end That passes to a rjs template like this: if @saved page.visual_effect :Fold, ''add_address'' page.replace_html ''addresses'', :partial =>
2007 Oct 03
3
Why does error_messages_for take string as param?
Hi, I wonder why error_messages_for take strings as params instead of instance variables. error_messages_for ''user'' instead of error_messages_for @user ''user'' is translated into @user eventually. If so, who not take the instance variables directly? Is there any reason for that? Thanks in advance. Sam -- Posted via http://www.ruby-forum.com/.
2006 Jun 07
0
problem with error_messages_for
Hi everyone, I have this weird problem where error_messages_for isn''t working. I have a model group which has to validates constraints.. --------------------------------- class Group < ActiveRecord::Base #directionality points to the user model #this table contains the foreign key belongs_to :user validates_uniqueness_of :name validates_presence_of :name end
2006 Jan 23
2
Problems with error_messages_for
I have a model Area which has_many Streets. The Area has a couple of attributes of its own but mostly I want to be able to add/delete/update Streets for a particular Area, but all on one page rather than having a separate view for editing a Street. I''ve managed to get a form displayed with a row for each Street already assigned to the Area by using form fields with
2006 Jun 20
2
Validation error_messages_for problem
I am having trouble getting error_messages_for to work. My controller(relevant parts) looks like def configure @account = session[:account] @user = User.new end def add_new_user_to_account @user = User.new(params[:user]) if @user.valid? session[:account].users << @user end redirect_to :action=> ''configure'' end end and my
2006 Aug 09
1
Clarification on error_messages_for
Just learning Rails.. So this is probably a noob question. My apologies. Could anyone please give me a quick summary/example on the usage of error_messages_for? I have two tables/models, Group and GroupMembers. Obviously, a Group has_many GroupMembers. I have a customized view which shows a list of GroupMembers followed by a field and a button which facilitates adding a member to the group by
2006 Nov 04
1
error_messages_for ''a''
hi all, i have two models in single form and i want to display error messages for both on submission when i do something like this i get an error <%= error_messages_for ''a'' %> <%= error_messages_for ''b'' %> can anyone tell me how can i do something like this thanks in advance regards gaurav -------------- next part -------------- An HTML
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 nil before using error_message_on ? I
2006 Jun 21
2
error_messages_for not displaying validation errors
Hi all, I''ve been searching the web and the list archives for help on this and I''ve found some tips, but I''ve been racking my brain on this for hours. I have a Model, View, and Controller that are handling the uploading of a file to my server. I want to make sure that the description is set and that a file is selected to be uploaded. I have set validates_presence_of
2006 Jan 11
0
error_messages_for >> Cannot convert Array into String
Hi all I have the following Model: Member(id, username, first_name, last_name, hashed_password, password_salt) Now I want to allow users to register for an account using the following form: --- <%= form_tag %> <%= error_messages_for ''member'' %> <p><%= _(''Username'') %>: <%= text_field(''member'',
2006 Jul 17
2
error_messages_for ?
Hi, I can''t list error_messages in my Form ??, and all the formfields are reset ...(I think my redirect :back clean everything, formfield and error_messages ...), only my flash[:notice] is ok.... I would like to use the "error_messages_for" tag to add a simple red * on my textfiled if a problem occurs ... thanks for help arnaud here are the basics steps to check that
2006 Feb 13
2
Overriding the error_messages_for method
If I wanted to override the error_messages_for method where within the rails structure would I put it? Which file? Thanks :-) John Kopanas http://www.kopanas.com ===================================================================== http://www.soen.info - source of the freshest software engineering information on the net http://cusec.soen.info - software engineering conference