Re: [Rails] Re: Re: Re: problem with complex function to save in db

2010-09-24 Thread Almog Friedman
ok, i think this should work ty very much. i really appreciate it. but I have one question, I didn't quite understand why did you put that: @faction = Faction.find(:last, :order => 'id') at the end of the controller action. On Thu, Sep 23, 2010 at 11:51 PM, Ar Chron wrote: > Hmm... maybe you do

[Rails] Re: Re: Re: problem with complex function to save in db

2010-09-23 Thread Ar Chron
Hmm... maybe you do need a table name involved: Controller: def create hash = params[:faction] hashnew = save_ids(hash, 'FactionContent') Faction.create(hashnew) @faction = Faction.find(:last, :order => 'id') end And that other routine: def save_ids(arguments, table) ret = Hash.new

[Rails] Re: Re: Re: problem with complex function to save in db

2010-09-23 Thread Ar Chron
Almog Friedman wrote: > heres the log hope it'll help: > Processing FactionsController#create (for 127.0.0.1 at 2010-09-23 21:46:39) [POST] Parameters: {"commit"=>"Create", "authenticity_token"=>"1f1aa67b947f0e23dc19aad8debc1e63b6df002c", "faction"=>{"name"=>"asdasd", "name_plural"=>"asdasd", "d