Error_messages_for >> Cannot convert Array into String


#1

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', 'username') %></p>
		<p><%= _('E-Mail') %>: <%= text_field('member', 'email', :id => 

‘asdf’) %>

<%= _(‘Password’) %>: <%= password_field(‘member’, ‘password’)
%>


<%= (‘Password confirmation’) %>: <%= password_field(‘member’,
‘password_confirmation’) %>


<%= submit_tag((‘Register!’)) %>


<%= end_form_tag %>

The register action looks like this (the password encryption with salt
is not built in yet):


def register
if request.get?
@member = Member.new
else
@member = Member.new(params[:member])
flash[:notice] = “You account was successfully created! Please
login now.”
redirect_to :action => “login” if @member.save
end
end

When I press the submit button, then I get the following error:


TypeError in Member#register

Showing app/views/member/register.rhtml where line #11 raised:

cannot convert Array into String

Extracted source (around line #11):

8:
9: Register
10: <%= form_tag %>
11: <%= error_messages_for ‘member’ %>
12:

<%= _(‘Username’) %>: <%= text_field(‘member’, ‘username’)
%>


13:

<%= _(‘E-Mail’) %>: <%= text_field(‘member’, ‘email’, :id =>
‘asdf’) %>


14:

<%= _(‘Password’) %>: <%= password_field(‘member’, ‘password’)
%>


What did I wrong? Thanks for help.

Greetings,
Josh