Take the 2-minute tour ×  I have a Member model that belongs to
User  class Member < ActiveRecord::Base      attr_accessible
:name     belongs_to :user   class User < ActiveRecord::Base
attr_accessible :name     has_many :members, :dependent =>
:destroy   In my Members controller I have  class
MembersController < ApplicationController    def create
@user = User.find(params[:user_id])     @member  =
@user.members.build(params[:member])     if @member.save
flash[:success] = "Member created!"       redirect_to root_path
render 'pages/home'  In /app/views/users/show.html.erb I have
<%= form_for @member do |f| %>    <div class="field">     <%=
f.text_area :name %>   <div class="actions">     <%= f.submit
"Submit" %> <% end %>  But I get the following error: undefined
method `model_name' for NilClass:Class  Extracted source (around
line #18):  16: <h1 class="member">What's up?</h1> 18: <%=
form_for @member do |f| %>  My show action in the Users
controller is    def show       @user = User.find