A
Adam Akhtar
the basic code below makes kirby complain that im trying to update a
link_to many field in my table when as can be seen I am not. Here is
some code for you to copy into irb to reproduce the error (though the
problem lies with only the pt table i have also included the code to
create the table its linked to called tt). I have read the manual many
times to no avail. I also looked through kirbys code but im a beginner
and i got lost in it
---------------------------------------------
require 'kirbybase'
db = KirbyBase.new
db.drop_tablept) if db.table_exists?pt)
db.drop_tablett) if db.table_exists?tt)
tt = db.create_tablett, :task_title, {ataType=>:String,
efault=>'No Title'}, :completed, {ataType=>:Boolean,
efault=>true}, roject, {ataType=>:String,
efault=>'None'},_project_id, :Integer)
pt = db.create_tablept, roject_title, {ataType=>:String,
efault=>'No Project Name'}, _project_id, {ataType=>:Integer,
efault=>0}, _tasks,{ataType=>:ResultSet,
:Link_many=>[_project_id, :task_table, _project_id]})
pt.insertproject_title => "old") #creates record with recno = 1
pt.updateproject_title => "new") {|r| r.recno == 1}
------------------------
here is my error - p_tasks is the linked item in the other table tt.
ArgumentError: You cannot input a value for this field: p_tasks
from
c:/ruby/lib/ruby/gems/1.8/gems/KirbyBase-2.6/lib/kirbybase.rb:3079:
in `check_against_input_for_specials'
from
c:/ruby/lib/ruby/gems/1.8/gems/KirbyBase-2.6/lib/kirbybase.rb:3078:
in `each'
from
c:/ruby/lib/ruby/gems/1.8/gems/KirbyBase-2.6/lib/kirbybase.rb:3078:
in `check_against_input_for_specials'
from
c:/ruby/lib/ruby/gems/1.8/gems/KirbyBase-2.6/lib/kirbybase.rb:2283:
in `set'
from
c:/ruby/lib/ruby/gems/1.8/gems/KirbyBase-2.6/lib/kirbybase.rb:2256:
in `each'
from
c:/ruby/lib/ruby/gems/1.8/gems/KirbyBase-2.6/lib/kirbybase.rb:2256:
in `set'
from
c:/ruby/lib/ruby/gems/1.8/gems/KirbyBase-2.6/lib/kirbybase.rb:2220:
in `update'
from (irb):72
from :0
-------------------------
in case your wondering, tt is a tasks table and pt is a projects table.
This is for a simple todo list app. Projects are comprised of tasks
hence the link.
Can anyone help?
link_to many field in my table when as can be seen I am not. Here is
some code for you to copy into irb to reproduce the error (though the
problem lies with only the pt table i have also included the code to
create the table its linked to called tt). I have read the manual many
times to no avail. I also looked through kirbys code but im a beginner
and i got lost in it
---------------------------------------------
require 'kirbybase'
db = KirbyBase.new
db.drop_tablept) if db.table_exists?pt)
db.drop_tablett) if db.table_exists?tt)
tt = db.create_tablett, :task_title, {ataType=>:String,
efault=>'No Title'}, :completed, {ataType=>:Boolean,
efault=>true}, roject, {ataType=>:String,
efault=>'None'},_project_id, :Integer)
pt = db.create_tablept, roject_title, {ataType=>:String,
efault=>'No Project Name'}, _project_id, {ataType=>:Integer,
efault=>0}, _tasks,{ataType=>:ResultSet,
:Link_many=>[_project_id, :task_table, _project_id]})
pt.insertproject_title => "old") #creates record with recno = 1
pt.updateproject_title => "new") {|r| r.recno == 1}
------------------------
here is my error - p_tasks is the linked item in the other table tt.
ArgumentError: You cannot input a value for this field: p_tasks
from
c:/ruby/lib/ruby/gems/1.8/gems/KirbyBase-2.6/lib/kirbybase.rb:3079:
in `check_against_input_for_specials'
from
c:/ruby/lib/ruby/gems/1.8/gems/KirbyBase-2.6/lib/kirbybase.rb:3078:
in `each'
from
c:/ruby/lib/ruby/gems/1.8/gems/KirbyBase-2.6/lib/kirbybase.rb:3078:
in `check_against_input_for_specials'
from
c:/ruby/lib/ruby/gems/1.8/gems/KirbyBase-2.6/lib/kirbybase.rb:2283:
in `set'
from
c:/ruby/lib/ruby/gems/1.8/gems/KirbyBase-2.6/lib/kirbybase.rb:2256:
in `each'
from
c:/ruby/lib/ruby/gems/1.8/gems/KirbyBase-2.6/lib/kirbybase.rb:2256:
in `set'
from
c:/ruby/lib/ruby/gems/1.8/gems/KirbyBase-2.6/lib/kirbybase.rb:2220:
in `update'
from (irb):72
from :0
-------------------------
in case your wondering, tt is a tasks table and pt is a projects table.
This is for a simple todo list app. Projects are comprised of tasks
hence the link.
Can anyone help?