T
tim.hennekey
I get "undefined method `name' for #<TSPProcess:0x38c7fc0>" when I
access the page with the template:
<% @processes.each do |asd| %>
<tr>
<td><%= renderinline => "#{process.name}")%></td>
</tr>
<% end %>
The TSPProcess.rb is:
class TSPProcess
@name = "Nothing"
attr_reader :name
attr_writer :name
end
I tried defining name and name= and I get the same error.
The controller:
require 'TSPProcess'
class ProcessesController < ApplicationController
def index
@processes = Array.new
a = TSPProcess.new
@processes << a
end
end
Any help for a beginner?
access the page with the template:
<% @processes.each do |asd| %>
<tr>
<td><%= renderinline => "#{process.name}")%></td>
</tr>
<% end %>
The TSPProcess.rb is:
class TSPProcess
@name = "Nothing"
attr_reader :name
attr_writer :name
end
I tried defining name and name= and I get the same error.
The controller:
require 'TSPProcess'
class ProcessesController < ApplicationController
def index
@processes = Array.new
a = TSPProcess.new
@processes << a
end
end
Any help for a beginner?