Displaying 20 results from an estimated 30000 matches similar to: "Why does error_messages_for take string as param?"
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
2009 Apr 02
3
error_messages_for does not display the error
Hi all
I''ve approached Rails since a couple of months to develop a quick
application for my company. Fantastic framework. As every noob, I do
have some gaps to cover. The one which is giving me a little
frustration, generated by my lack of knowledge is as follows.
I need to make sure the region object is not deleted if there are
countries associated with it. I solved this by putting a
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 =>
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
2009 Feb 05
6
get # of errors in error_messages_for
hi everyone here i go again, i have problem we error message validation
here is the sample of my code:
error_messages_for :user, :header_message => ''X errors, please find red
mark'', :message => ''Following errors were found:''
the problem is that how where going to get the value "X errors" or the
number of errors if they have when the is
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 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 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 Mar 20
5
Wrap error_messages_for() call when no instance var present
I am trying to put some smarts around a call to
<%= error_messages_for %>
so that when I first come into this page i.e. when my instance variable
@target_list has not been defined yet, the page doesn''t break.
I''m doing this:
<% if @target_list? %>
<%= error_messages_for ''target_list'' %>
<% end %>
I get a syntax error on line 1.
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
2007 Mar 21
4
How to spec error_messages_for
Hi
I''m trying to spec a call to error_messages_for to avoid stubbing out
whole models. Something like this:
context "A rendered calculate_quote view" do
setup do
@form = mock("form")
assigns[:form] = @form
end
specify "should render the error messages" do
<SOMETHING>.should_receive(:error_messages_for).with
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
2006 Feb 15
6
error_messages_for trouble
I am trying so learn how to do custom validations.
The validation works as expected, but I can''t get "error_messages_for"
to display.
How is the name of the object supposed to be formated?
Where is this object created, the model or controller?
What am I doing wrong here?
#### Model ########################
class MyFolder < ActiveRecord::Base
def validate
# validation
2006 Nov 30
3
model stubs with view/controller specs: error_messages_for??
How would I set up a model stub so that <%= error_messages_for
''some_model'' %> doesn''t complain?
I started going down this road: @some_model.stub!
(:errors).and_return(ActiveRecord::Errors.new)
but it seems like a long, hopefully uneccessary road.
Cheers,
Michael
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 13
1
error_messages_for
I can''t seem to figure out how to validate a few fields some1 please
help me out
model---------
class Record < ActiveRecord::Base
validates_presence_of :sw, :flex
end
controller------------
class RecordController < A;;icationController
def new
@record = Rrecord.new
@product = Product.find(params[''product_id''])
end
def create
2006 Jul 24
6
error_messages_for not working
I have the following code and I am not able to get it working. The error
message is not coming on the top, it is just getting displayed on a
different page if I dont have the rescue block commented at the bottom.
Model: user.rb
require "digest/sha1"
class User < ActiveRecord::Base
validates_presence_of :eaddress, :fname, :passwd, :pcode, :country,
:day, :year, :month, :gender,
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
2008 Apr 10
1
error_messages_for
I''ve been all good and written some great validation in my models, but
when something doesn''t validate, I''m used to using error_messages_for
in my view to display the errors.
Is there some sort of facebook_messages_for equivalent in facebooker?
Or perhaps some parameter I can pass to facebook_messages?
Justin
2006 Jun 27
4
File Column has me stumped
I have an existing entry in my DB under the "users" table that has a
column name "pic". I have a file column field when a new user signs up,
and it work great. I am now trying to give existing users the ability to
add or change their "pic". But, no matter what I do the entry comes up
blank. Here''s what I have so far:
View:
<%= start_form_tag ({:action