i just created an application to list the primary details of
userbut it is showing an error lik this
"uninitialized constant UsersController::User"
this is my controlller
class UsersController < ApplicationController
puts"hiiiiiiiii"
def index
puts"hiiiiiiiii"
@users = User.find(:all)
puts @users
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @users }
end
end
end
this is my view file
<h1>Users List</h1>
<table>
<tr>
<th>Name</th>
<th>Age</th>
<th>Designation</th>
<th>Hobby</th>
</tr>
<% @user.each do |user| %>
<tr>
<td><%=h user.name %></td>
<td><%=h user.age %></td>
<td><%=h user.designation %></td>
<td><%=h user.hobby %></td>
<!--<td><%= link_to 'Show', job %></td>
<td><%= link_to 'Edit', edit_job_path(job) %></td>
<td><%= link_to 'Destroy', job, :confirm => 'Are you sure?', :method
=> :delete %></td>-->
</tr>
<% end %>
</table>
and my model is this
class User < ActiveRecord::Base
end
can anyone tell how to solve this
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.