Displaying 2 results from an estimated 2 matches for "sample_method".
2009 Aug 31
3
NameError: undefined local variable or method `testapp' for main:Object
...ils. Recently, I downloaded and installed the
InstantRails in the D:\ drive of my system. Now I wanted to try some
small examples in ''irb'', so I created a file "testapp.rb" and in that
pasted a code like this:
========================
class sample_class
def sample_method
puts "sample program"
end
end
myclass = sample_class.new
myclass.sample_method
========================
Now when I give command (To run the application) "ruby testapp.rb" ,
I get this error "NameError: undefined local variable or method
`testapp'...
2007 Oct 15
3
NoMethodError
...could get the data
from DB. but pagination is not working. When i see the log file it is
showing the following error.
NoMethodError: undefined method ''paginatior'' #<Hash...>
my pginate.rb and pagination.rb files are not in the same folder
Here is my piece of code:
def sample_method
sql = "select * from customers where rownum < 100"
collection = Sample::Models::Sa::Customer.find_by_sql(sql)
options={:per_page => 10 , Page => 1}
@pages, @customers = paginate_collection(collection,options)
end
Can any one point me where i am doing the mistake. Hope an...