ruby on rails - why form_for does not work for me -


(ruby 1.9.2 rails 3.0.6)

i new ror, sorry simple question.

i have form , controller, when launch app, can see log have been displayed.. there exception when rendering view...

everything should fine.. problem? how can fix it?

thanks.

undefined method `users_path' #<#<class:0x47c7678>:0x47c6118> extracted source (around line #2):  1: <h1>welcome aboard</h1> 2: <%= form_for(@user) |f| %> 3:   <table> 4:     <tr> 5:       <td><%= f.label :username %></td>  class registercontroller < applicationcontroller    def sign_up     logger.debug("sign_up inoked")      @user = user.new      logger.debug("sign_up finished")   end  end 

views/register/sign_up.html.erb

<%= form_for(@user) |f| %>   <table>     <tr>       <td><%= f.label :username %></td>       <td><%= f.text_field :username %></td>     </tr>     <tr>       <td><%= f.label :password %></td>       <td><%= f.password_field :password %></td>     </tr>     <tr>       <td><%= f.label :password_confirmation %></td>       <td><%= f.password_field :password_confirmation %></td>     </tr>     <tr>       <td colspan="2"></td>     </tr>     <tr>       <td colspan="2"><%= f.submit "sign up" %></td>     </tr>   </table> <% end %> 

it seems not have appropriate routes. have line :

resources :users 

in routes.rb file ? if not try adding please. or create particular users_path named route.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -