Forum: Ruby on Rails error_messages_for >> Cannot convert Array into String

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Joshua M. (Guest)
on 2006-01-12 01:39
Hi all

I have the following Model:

Member(id, username, first_name, last_name, hashed_password,

Now I want to allow users to register for an account using the following

		<%= form_tag %>
			<%= error_messages_for 'member' %>
			<p><%= _('Username') %>: <%= text_field('member', 'username') %></p>
			<p><%= _('E-Mail') %>: <%= text_field('member', 'email', :id =>
'asdf') %></p>
			<p><%= _('Password') %>: <%= password_field('member', 'password')
			<p><%= _('Password confirmation') %>: <%= password_field('member',
'password_confirmation') %></p>
			<p><%= submit_tag(_('Register!')) %></p>
		<%= 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 =[:member])
      flash[:notice] = "You account was successfully created! Please
login now."
      redirect_to :action => "login" if

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: 	<fieldset>
9: 		<legend>Register</legend>
10: 		<%= form_tag %>
11: 			<%= error_messages_for 'member' %>
12: 			<p><%= _('Username') %>: <%= text_field('member', 'username')
13: 			<p><%= _('E-Mail') %>: <%= text_field('member', 'email', :id =>
'asdf') %></p>
14: 			<p><%= _('Password') %>: <%= password_field('member', 'password')


What did I wrong? Thanks for help.

This topic is locked and can not be replied to.