[Instantrails-users] Mongrel BAD CLIENT errors

Dave Havard david.havard at gmail.com
Tue Oct 10 05:39:04 EDT 2006


Thank you Curt.

That has got debugging working but has made things no clearer on why some of
my form posts are not working. The post does not seem to get logged - only
reported as a bad client to the console window. Any ideas what I should be
looking for? My view contains the following code:

<% @title = "Sign up" %>
<%= error_messages_for 'user' %>
<%= form_tag %>
<table>
    <tr>
        <td>Username:</td>
        <td><%= text_field("user", "username") %></td>
    </tr>
    <tr>
        <td>Password:</td>
        <td><%= password_field("user", "password") %></td>
    </tr>
    <tr>
        <td>Confirm Password:</td>
        <td><%= password_field("user", "confirm_password") %></td>
    </tr>
    <tr>
        <td>Email Address:</td>
        <td><%= text_field("user", "email") %></td>
    <tr>
        <td>First Name:</td>
        <td><%= text_field("user", "first_name") %></td>
    </tr>
    <tr>
        <td>Last Name:</td>
        <td><%= text_field("user", "last_name") %></td>
    </tr>
    <tr>
        <td>Screen Name:</td>
        <td><%= text_field("user", "screen_name") %></td>
    </tr>
    <tr>
        <td></td>
        <td><input type="submit" value="Sign up"/></td>
    </tr>
</table>
<%= end_form_tag %>

Whilst my controller looks like:

  def signup
    if request.get?
      @user = User.new
    else
      if params[:user][:password] != params[:user][:confirm_password]
        flash[:notice] = "Passwords do not match!"
      else
        @user = User.new(params[:user])
        if @user.save
          session[:user] = @user.id
          redirect_to :controller => "pages", :action => "show", :id => 1
        end
      end
    end
  end

The get part of the view is being rendered fine. Only when I post back is it
failing.

Thanks
Dave

On 10/10/06, Curt Hibbs <curt.hibbs at gmail.com> wrote:
>
> On 10/9/06, Dave Havard <david.havard at gmail.com> wrote:
> >
> > Hi
> >
> > I have just installed InstantRails and (after some work) have got my
> > existing app working. I am now getting BAD CLIENT errors on some form posts
> > but have no idea why. Having looked at the mongrel docs it seems I should be
> > able to get to the bottom of this if I can get debug set to true but I
> > cannot see where to do this in InstantRails?
> >
> > Any pointers?
> >
>
> You'll need to start mongrel by hand. Use Instant Rails to open a ruby
> console window (menu command "Rails Applications>Open Ruby Console Window"),
> change your current directory to move in to your Rails application's root
> directory, and then type in the "mongrel_rails" command with whatever
> options you like.
>
> Curt
>
> _______________________________________________
> Instantrails-users mailing list
> Instantrails-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/instantrails-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/instantrails-users/attachments/20061010/19491512/attachment-0001.html 


More information about the Instantrails-users mailing list