If I understand MVC correctly, basically the SQL statement below can be
"translated" to ruby as a method in the controller, then called from the
view.
I have a "report" method in my controller which I'm trying to call from
the view, but it's presently giving an error of:
undefined method `report'
thufir@arrakis ~/goodfellow-tool $
thufir@arrakis ~/goodfellow-tool $ sqlite3 db/development.sqlite3
SQLite version 3.4.1
Enter ".help" for instructions
SELECT calls.comment,calls.created_at,logins.login FROM
calls,logins WHERE calls.login_id=1 AND logins.id=1;
start work|2008-02-08 15:12:13|0123
start call|2008-02-08 15:12:13|0123
start break|2008-02-08 15:12:13|0123
If I understand MVC correctly, basically the SQL statement below can
be
"translated" to ruby as a method in the controller, then called from
the
view.
I have a "report" method in my controller which I'm trying to call
from
the view, but it's presently giving an error of:
undefined method `report'
Um, you appear to have everything mixed up. You're defining a method
on a controller (such methods aren't accessible from views, unless you
play around with helper_method), and then you're trying to call that
method on an instance of Call ? On top of that, I'd put something like
that in a model.
Um, you appear to have everything mixed up. You're defining a method on
a controller (such methods aren't accessible from views, unless you play
around with helper_method), and then you're trying to call that method
on an instance of Call ? On top of that, I'd put something like that in
a model.
I thought that I conceptually grasped MVC -- guess not. However, I do
know that I have the model and schema correctly configured because I can
get good output through the console: