Stupid question. I'm in deadend

I'm newbie. Please, help. I suppose it's easy :slight_smile:
I have admin controller which is working ok and with usual controller I
have trouble.
This is app/controllers/team_controller.rb

···

____________________________________________
class TeamController < ApplicationController
def show
    @team = Team.find(params[:id])
  end
end
___________________________________________

And in app/controllers/admin/teams_controller.rb "Show" function is
absolutely same. Then, app/views/admin/teams/show.rhtml looks like
<% for column in Team.content_columns %>
<p>
  <% if column.human_name != "Image" %>
    <b><%= column.human_name %>:</b> <%=h @team.send(column.name) %>
   <% else %>
     <%= image_tag url_for_file_column :"team", :"image" %>
    <% end %>
</p>
<% end %>
But when I try to use this code in app/views/team/show.rhtml I get an
error:
" Showing app/views/team/show.rhtml where line #6 raised:
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.split"
--
Posted via http://www.ruby-forum.com/.

Could you please repost this question to the rubyonrails-talk mailing list?

···

On Jan 13, 2008, at 9:00 PM, Artyom None wrote:

I'm newbie. Please, help. I suppose it's easy :slight_smile:
I have admin controller which is working ok and with usual controller I
have trouble.
This is app/controllers/team_controller.rb
____________________________________________
class TeamController < ApplicationController
def show
   @team = Team.find(params[:id])
end
end
___________________________________________

And in app/controllers/admin/teams_controller.rb "Show" function is
absolutely same. Then, app/views/admin/teams/show.rhtml looks like
<% for column in Team.content_columns %>
<p>
<% if column.human_name != "Image" %>
   <b><%= column.human_name %>:</b> <%=h @team.send(column.name) %>
  <% else %>
    <%= image_tag url_for_file_column :"team", :"image" %>
   <% end %>
</p>
<% end %>
But when I try to use this code in app/views/team/show.rhtml I get an
error:
" Showing app/views/team/show.rhtml where line #6 raised:
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.split"
--
Posted via http://www.ruby-forum.com/\.

Xavier Noria wrote:

Could you please repost this question to the rubyonrails-talk mailing
list?

Thanks. I've reported and got right solution

···

--
Posted via http://www.ruby-forum.com/\.