Ruby on Rails Wednesday, August 31, 2011



On Wed, Aug 31, 2011 at 5:53 PM, Pab <prabu.net88@gmail.com> wrote:
Hi,


     i got search which shows following error

      ActionView::Template::Error (undefined method `model_name' for
NilClass:Class):

i think this happens when @employee is nil. double check that @employee is not nil.
 
   1: <%= form_for(@employee) do |e| %>
   2: EMP ID<%= e.text_field :id %><br>
   3: <%= e.submit 'search', :controller => 'employees', :action =>
'search1' %>
   4: <% end %>
 in my search action i dint provide anything like
def search
end

if i use  <%= form_for(:employee) do |e| %>
it shows no error but the data is moving in to my "show" action

  could any one provide me a soultion ?

--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.




--
-------------------------------------------------------------
visit my blog at http://jimlabs.heroku.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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment