simple Routing Error

Routing Error

No route matches "/user/register" with {:method=>:get}

The URL is http://localhost:3000/user/register

Here is app/views/user/register.rhtml

<h2>Register</h2>
<% form_for :user do |form| %>
  <fieldset>
    <legend>Enter Your Details</legend>
    <div class="form_row">
      <label for="screen_name">Screen name:</label>
      <%= form.text_field :screen_name %>
    </div>

    <div class="form_row">
      <label for="email">Email:</label>
      <%= form.text_field :email %>
    </div>

    <div class="form_row">
      <label for="password">Password:</label>
      <%= form.password_field :password %>
    </div>

    <div class="form_row">
      <%= submit_tag "Register!", :class => "submit" %>
    </div>
  </fieldset>
<% end %>

Also app/controllers/user_controller.rb

class UserController < ApplicationController

def index
end
def register
@title = "Register"
end
end

Don't know, if that's the reason: But your controller should be plural. So the URL would also be plural.

Martin

Sean Six schrieb:

I am not sure I understand by what you mean by plural.

Sean Six wrote:

No route matches "/user/register" with {:method=>:get}

You gotta show your routes.rb. Is it the default?

Can you write a simple UserController#index and call that?

  def index
    render :text => 'I b here'
  end

Sean,
Don't know if you have received an answer on this yet...
You have to add the following to the routes.rb file: